Axiom.Core.SubEntity.PrepareTempBlendBuffers C# (CSharp) Method

PrepareTempBlendBuffers() protected method

Internal method for preparing this sub entity for use in animation.
protected PrepareTempBlendBuffers ( ) : void
return void
		protected internal void PrepareTempBlendBuffers()
		{
			// Handle the case where we have no submesh vertex data (probably shared)
			if ( subMesh.useSharedVertices )
				return;
			if ( skelAnimVertexData != null )
				skelAnimVertexData = null;
			if ( softwareVertexAnimVertexData != null )
				softwareVertexAnimVertexData = null;
			if ( hardwareVertexAnimVertexData != null )
				hardwareVertexAnimVertexData = null;

			if ( !subMesh.useSharedVertices )
			{
				if ( subMesh.VertexAnimationType != VertexAnimationType.None )
				{
					// Create temporary vertex blend info
					// Prepare temp vertex data if needed
					// Clone without copying data, don't remove any blending info
					// (since if we skeletally animate too, we need it)
					softwareVertexAnimVertexData = subMesh.vertexData.Clone( false );
					parent.ExtractTempBufferInfo( softwareVertexAnimVertexData, tempVertexAnimInfo );

					// Also clone for hardware usage, don't remove blend info since we'll
					// need it if we also hardware skeletally animate
					hardwareVertexAnimVertexData = subMesh.vertexData.Clone( false );
				}

				if ( parent.HasSkeleton )
				{
					// Create temporary vertex blend info
					// Prepare temp vertex data if needed
					// Clone without copying data, remove blending info
					// (since blend is performed in software)
					skelAnimVertexData = parent.CloneVertexDataRemoveBlendInfo( subMesh.vertexData );
					parent.ExtractTempBufferInfo( skelAnimVertexData, tempSkelAnimInfo );
				}
			}
		}