| 2789 | } |
| 2790 | |
| 2791 | void 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: |
nothing calls this directly
no test coverage detected