MCPcopy Create free account
hub / github.com/carbonengine/trinity / AddSwarmer

Method AddSwarmer

trinity/Eve/SpaceObject/EveSwarm.cpp:912–940  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: Adds one swarmer to this swarm --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

910// Adds one swarmer to this swarm
911// --------------------------------------------------------------------------------
912void EveSwarm::AddSwarmer()
913{
914 auto componentRegistry = GetComponentRegistry();
915
916 EveSwarmRenderablePtr renderable;
917 renderable.CreateInstance();
918 renderable->InitializeRenderable( this, m_mesh );
919 renderable->InitDecals( m_decals );
920
921 if( componentRegistry )
922 {
923 renderable->Register( componentRegistry );
924 }
925
926 m_renderables.Append( renderable->GetRawRoot() );
927 SwarmVehicle v;
928 v.position = m_worldPosition;
929 m_vehicles.push_back( v );
930 if( m_debugShowForces )
931 {
932 m_debugInfo.push_back( SwarmVehicleDebug() );
933 }
934 m_count++;
935
936 if( m_boosters )
937 {
938 m_boosters->SetCount( m_count );
939 }
940}
941
942// --------------------------------------------------------------------------------
943// Description:

Callers

nothing calls this directly

Calls 6

CreateInstanceMethod · 0.80
InitializeRenderableMethod · 0.80
InitDecalsMethod · 0.80
AppendMethod · 0.80
RegisterMethod · 0.45
SetCountMethod · 0.45

Tested by

no test coverage detected