Axiom.Core.Entity.PrepareTempBlendedBuffers C# (CSharp) Метод

PrepareTempBlendedBuffers() защищенный Метод

Internal method for preparing this Entity for use in animation.
protected PrepareTempBlendedBuffers ( ) : void
Результат void
		protected internal void PrepareTempBlendedBuffers()
		{
			if ( this.skelAnimVertexData != null )
			{
				this.skelAnimVertexData = null;
			}
			if ( this.softwareVertexAnimVertexData != null )
			{
				this.softwareVertexAnimVertexData = null;
			}
			if ( this.hardwareVertexAnimVertexData != null )
			{
				this.hardwareVertexAnimVertexData = null;
			}

			if ( this.mesh.HasVertexAnimation )
			{
				// Shared data
				if ( this.mesh.SharedVertexData != null &&
					 this.mesh.SharedVertexDataAnimationType != 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)
					this.softwareVertexAnimVertexData = this.mesh.SharedVertexData.Clone( false );
					this.ExtractTempBufferInfo( this.softwareVertexAnimVertexData, this.tempVertexAnimInfo );

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

			if ( this.HasSkeleton )
			{
				// shared data
				if ( this.mesh.SharedVertexData != null )
				{
					// Create temporary vertex blend info
					// Prepare temp vertex data if needed
					// Clone without copying data, remove blending info
					// (since blend is performed in software)
					this.skelAnimVertexData = this.CloneVertexDataRemoveBlendInfo( this.mesh.SharedVertexData );
					this.ExtractTempBufferInfo( this.skelAnimVertexData, this.tempSkelAnimInfo );
				}
			}

			// prepare temp blending buffers for subentites as well
			foreach ( SubEntity se in this.subEntityList )
			{
				se.PrepareTempBlendBuffers();
			}
		}