MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / writeAnimation

Method writeAnimation

OgreMain/src/OgreMeshSerializerImpl.cpp:2332–2367  ·  view source on GitHub ↗

---------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2330 }
2331 //---------------------------------------------------------------------
2332 void MeshSerializerImpl::writeAnimation( const Animation *anim )
2333 {
2334 writeChunkHeader( M_ANIMATION, calcAnimationSize( anim ) );
2335 // char* name
2336 writeString( anim->getName() );
2337 // float length
2338 float len = anim->getLength();
2339 writeFloats( &len, 1 );
2340 pushInnerChunk( mStream );
2341 if( anim->getUseBaseKeyFrame() )
2342 {
2343 size_t size = MSTREAM_OVERHEAD_SIZE;
2344 // char* baseAnimationName (including terminator)
2345 size += anim->getBaseKeyFrameAnimationName().length() + 1;
2346 // float baseKeyFrameTime
2347 size += sizeof( float );
2348
2349 writeChunkHeader( M_ANIMATION_BASEINFO, size );
2350
2351 // char* baseAnimationName (blank for self)
2352 writeString( anim->getBaseKeyFrameAnimationName() );
2353
2354 // float baseKeyFrameTime
2355 float t = (float)anim->getBaseKeyFrameTime();
2356 writeFloats( &t, 1 );
2357 }
2358
2359 // tracks
2360 Animation::VertexTrackIterator trackIt = anim->getVertexTrackIterator();
2361 while( trackIt.hasMoreElements() )
2362 {
2363 VertexAnimationTrack *vt = trackIt.getNext();
2364 writeAnimationTrack( vt );
2365 }
2366 popInnerChunk( mStream );
2367 }
2368 //---------------------------------------------------------------------
2369 void MeshSerializerImpl::writeAnimationTrack( const VertexAnimationTrack *track )
2370 {

Callers

nothing calls this directly

Calls 7

getUseBaseKeyFrameMethod · 0.80
getBaseKeyFrameTimeMethod · 0.80
hasMoreElementsMethod · 0.80
getNameMethod · 0.45
getLengthMethod · 0.45
lengthMethod · 0.45
getNextMethod · 0.45

Tested by

no test coverage detected