@@ -18,9 +18,10 @@ namespace
1818
1919 void shipExplode (Entity *ship)
2020 {
21- TransformComponent &st = ship->value <TransformComponent>();
22- RenderComponent &sr = ship->value <RenderComponent>();
23- PhysicsComponent &sp = ship->value <PhysicsComponent>();
21+ const TransformComponent &st = ship->value <TransformComponent>();
22+ const ModelComponent &sr = ship->value <ModelComponent>();
23+ const ColorComponent &sc = ship->value <ColorComponent>();
24+ const PhysicsComponent &sp = ship->value <PhysicsComponent>();
2425 uint32 cnt = randomRange (4 , 7 );
2526 for (uint32 i = 0 ; i < cnt; i++)
2627 {
@@ -29,12 +30,12 @@ namespace
2930 t.scale = st.scale ;
3031 t.position = st.position + randomDirection3 () * st.scale ;
3132 t.orientation = randomDirectionQuat ();
32- RenderComponent &r = e->value <RenderComponent >();
33- r.object = HashString (" ants/explosion/particle.blend" );
34- r. color = colorVariation (sr. color );
35- r. intensity = 2 ;
36- TextureAnimationComponent &at = e-> value <TextureAnimationComponent>() ;
37- at. startTime = engineControlTime ();
33+ ModelComponent &r = e->value <ModelComponent >();
34+ r.model = HashString (" ants/explosion/particle.blend" );
35+ ColorComponent &c = e-> value <ColorComponent>( );
36+ c. color = colorVariation (sc. color ) ;
37+ c. intensity = 2 ;
38+ AnimationSpeedComponent &at = e-> value <AnimationSpeedComponent> ();
3839 at.speed = randomRange (0.7 , 1.5 );
3940 e->value <PhysicsComponent>().velocity = randomDirection3 () * t.scale * 0.07 + sp.velocity ;
4041 e->value <TimeoutComponent>().ttl = numeric_cast<sint32>(Real (30 ) / at.speed );
0 commit comments