GetHardwareVertexBuffer() public method

Get a hardware vertex buffer version of the vertex offsets.
public GetHardwareVertexBuffer ( int numVertices ) : HardwareVertexBuffer
numVertices int
return Axiom.Graphics.HardwareVertexBuffer
コード例 #1
0
 /// <summary> Utility method for applying pose animation </summary>
 public void ApplyPoseToVertexData(Pose pose, VertexData data, float influence)
 {
     if (this.targetMode == VertexAnimationTargetMode.Hardware)
     {
         // Hardware
         // If target mode is hardware, need to bind our pose buffer
         // to a target texcoord
         Debug.Assert(data.HWAnimationDataList.Count == 0, "Haven't set up hardware vertex animation elements!");
         // no use for TempBlendedBufferInfo here btw
         // Set pose target as required
         var hwIndex = data.HWAnimDataItemsUsed++;
         // If we try to use too many poses, ignore extras
         if (hwIndex < data.HWAnimationDataList.Count)
         {
             var animData = data.HWAnimationDataList[hwIndex];
             data.vertexBufferBinding.SetBinding(animData.TargetVertexElement.Source,
                                                 pose.GetHardwareVertexBuffer(data.vertexCount));
             // save final influence in parametric
             animData.Parametric = influence;
         }
     }
     else
     {
         // Software
         Mesh.SoftwareVertexPoseBlend(influence, pose.VertexOffsetMap, data);
     }
 }
コード例 #2
0
ファイル: AnimationTrack.cs プロジェクト: WolfgangSt/axiom
		/// <summary> Utility method for applying pose animation </summary>
		public void ApplyPoseToVertexData( Pose pose, VertexData data, float influence )
		{
			if ( targetMode == VertexAnimationTargetMode.Hardware )
			{
				// Hardware
				// If target mode is hardware, need to bind our pose buffer
				// to a target texcoord
				Debug.Assert( data.HWAnimationDataList.Count == 0,
							 "Haven't set up hardware vertex animation elements!" );
				// no use for TempBlendedBufferInfo here btw
				// Set pose target as required
				int hwIndex = data.HWAnimDataItemsUsed++;
				// If we try to use too many poses, ignore extras
				if ( hwIndex < data.HWAnimationDataList.Count )
				{
					HardwareAnimationData animData = data.HWAnimationDataList[ hwIndex ];
					data.vertexBufferBinding.SetBinding( animData.TargetVertexElement.Source,
														pose.GetHardwareVertexBuffer( data.vertexCount ) );
					// save final influence in parametric
					animData.Parametric = influence;
				}
			}
			else
			{
				// Software
				Mesh.SoftwareVertexPoseBlend( influence, pose.VertexOffsetMap, data );
			}
		}