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

Method RegisterComponents

trinity/Eve/SpaceObject/EveSpaceObject2.cpp:3568–3609  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: Registers itself and its children with the scene registration container. This is so we don't have to traverse the tree every frame --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

3566// This is so we don't have to traverse the tree every frame
3567// --------------------------------------------------------------------------------
3568void EveSpaceObject2::RegisterComponents()
3569{
3570 auto registry = this->GetComponentRegistry();
3571 if( registry )
3572 {
3573 RegisterAudioGeometry();
3574 }
3575
3576 if( registry && m_display )
3577 {
3578 if( !m_lights.empty() )
3579 {
3580 registry->RegisterComponent<ITr2LightOwner>( this );
3581 }
3582
3583 if( EntityComponents::ShouldReflect( m_reflectionMode ) )
3584 {
3585 registry->RegisterComponent<ITr2Renderable>( this );
3586 }
3587
3588 if( m_castShadow )
3589 {
3590 registry->RegisterComponent<IEveShadowCaster>( this );
3591 }
3592
3593 for( auto it = begin( m_effectChildren ); it != end( m_effectChildren ); ++it )
3594 {
3595 if( EveEntityPtr entity = BlueCastPtr( *it ) )
3596 {
3597 entity->Register( registry );
3598 }
3599 }
3600
3601 for( auto it = begin( m_attachments ); it != end( m_attachments ); ++it )
3602 {
3603 if( EveEntityPtr entity = BlueCastPtr( *it ) )
3604 {
3605 entity->Register( registry );
3606 }
3607 }
3608 }
3609}
3610
3611// --------------------------------------------------------------------------------
3612// Description:

Callers

nothing calls this directly

Calls 6

ShouldReflectFunction · 0.85
GetComponentRegistryMethod · 0.80
emptyMethod · 0.80
beginFunction · 0.50
endFunction · 0.50
RegisterMethod · 0.45

Tested by

no test coverage detected