CreateVertexMorphKeyFrame() public méthode

Creates a new morph KeyFrame and adds it to this animation at the given time index.
It is better to create KeyFrames in time order. Creating them out of order can result in expensive reordering processing. Note that a KeyFrame at time index 0.0 is always created for you, so you don't need to create this one, just access it using getKeyFrame(0);
public CreateVertexMorphKeyFrame ( float time ) : VertexMorphKeyFrame
time float The time from which this KeyFrame will apply.
Résultat VertexMorphKeyFrame
		protected void ReadMorphKeyframe( BinaryReader reader, VertexAnimationTrack track )
		{
			var time = ReadFloat( reader );
			var mkf = track.CreateVertexMorphKeyFrame( time );
			var vertexCount = track.TargetVertexData.vertexCount;
			// create/populate vertex buffer
			var decl = HardwareBufferManager.Instance.CreateVertexDeclaration();
			decl.AddElement( 0, 0, VertexElementType.Float3, VertexElementSemantic.Position );

			var buffer = HardwareBufferManager.Instance.CreateVertexBuffer( decl, vertexCount, BufferUsage.Static, true );
			// lock the buffer for editing
			var vertices = buffer.Lock( BufferLocking.Discard );
			// stuff the floats into the normal buffer
			ReadFloats( reader, vertexCount*3, vertices );
			// unlock the buffer to commit
			buffer.Unlock();
			mkf.VertexBuffer = buffer;
		}
 protected void ReadMorphKeyframe(BinaryMemoryReader reader, VertexAnimationTrack track)
 {
     float time = ReadFloat(reader);
     VertexMorphKeyFrame mkf = track.CreateVertexMorphKeyFrame(time);
     int vertexCount = track.TargetVertexData.vertexCount;
     // create/populate vertex buffer
     HardwareVertexBuffer buffer =
         HardwareBufferManager.Instance.CreateVertexBuffer(
                 VertexElement.GetTypeSize(VertexElementType.Float3),
                 vertexCount, BufferUsage.Static, true);
     // lock the buffer for editing
     IntPtr vertices = buffer.Lock(BufferLocking.Discard);
     // stuff the floats into the normal buffer
     ReadFloats(reader, vertexCount * 3, vertices);
     // unlock the buffer to commit
     buffer.Unlock();
     mkf.VertexBuffer = buffer;
 }