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

Method PrepareForAnimation

trinity/Eve/SpaceObject/EveSpaceObject2.cpp:2791–2816  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2789}
2790
2791void EveSpaceObject2::PrepareForAnimation()
2792{
2793 // If this is the first time we see a mesh we set up a callback on the geometry resource
2794 // file load to check for possible animations. If the file has animations we set up
2795 // the data structures for animation playback.
2796 auto geometryRes = m_mesh->GetGeometryResource();
2797 if( geometryRes && geometryRes != m_geometryResFromMesh )
2798 {
2799 UnregisterAudioGeometry();
2800
2801 // We might be loading, still. The AddNotifyTarget below will trigger a callback
2802 // once the loading is done. If the geometry resource has already loaded we get the callback
2803 // immediately. Further initialization that relies on the granny file being in
2804 // memory happens in the callback (RebuildCachedData)
2805 if( m_geometryResFromMesh )
2806 {
2807 m_geometryResFromMesh->RemoveNotifyTarget( this );
2808 }
2809 m_geometryResFromMesh = geometryRes;
2810
2811 m_animationUpdater->SetUseMeshBinding( true );
2812 m_animationUpdater->SetSharedGeometryRes( m_geometryResFromMesh );
2813
2814 m_geometryResFromMesh->AddNotifyTarget( this );
2815 }
2816}
2817
2818// --------------------------------------------------------------------------------
2819// Description:

Callers

nothing calls this directly

Calls 4

GetGeometryResourceMethod · 0.80
RemoveNotifyTargetMethod · 0.80
AddNotifyTargetMethod · 0.80
SetSharedGeometryResMethod · 0.45

Tested by

no test coverage detected