Axiom.Animating.Skeleton.CreateAttachmentPoint C# (CSharp) Метод

CreateAttachmentPoint() публичный Метод

TODO: should this replace an existing attachment point with the same name?
public CreateAttachmentPoint ( string name, ushort parentHandle, Axiom.MathLib.Quaternion rotation, Vector3 translation ) : AttachmentPoint
name string
parentHandle ushort
rotation Axiom.MathLib.Quaternion
translation Vector3
Результат AttachmentPoint
		public virtual AttachmentPoint CreateAttachmentPoint( string name, ushort parentHandle,
															 Quaternion rotation, Vector3 translation )
		{
			Bone parentBone = boneList[ parentHandle ];
			AttachmentPoint ap = new AttachmentPoint( name, parentBone.Name, rotation, translation );
			attachmentPoints.Add( ap );
			return ap;
		}

Usage Example

Пример #1
0
 /// <summary>
 ///   Utility method to add attachment points to an existing skeleton
 /// </summary>
 /// <param name="dstDir">the directory to which the modified skeleton will be saved</param>
 /// <param name="skelFile">the name of the file to which the modified skeleton will be written</param>
 /// <param name="skeleton">the original skeleton</param>
 /// <param name="attachPoints">the list of attachment points</param>
 private static void AddAttachments( string dstDir,
                                    string skelFile,
                                    Skeleton skeleton,
                                    List<AttachmentPointNode> attachPoints )
 {
     if( skeleton.AttachmentPoints.Count > 0 &&
         attachPoints.Count != skeleton.AttachmentPoints.Count )
         log.WarnFormat( "Skeleton attachment points count ({0}) does not match new count ({1})",
                         skeleton.AttachmentPoints.Count, attachPoints.Count );
     foreach( AttachmentPointNode attachPoint in attachPoints )
     {
         Quaternion rotate;
         Vector3 translate, scale;
         Matrix4 transform = attachPoint.Transform;
         Matrix4.DecomposeMatrix( ref transform, out translate, out rotate, out scale );
         Bone parentBone = skeleton.GetBone( attachPoint.ParentBone );
         bool isDup = false;
         foreach( AttachmentPoint tmp in skeleton.AttachmentPoints )
             if( tmp.Name == attachPoint.Name )
                 isDup = true;
         if( isDup )
             continue;
         skeleton.CreateAttachmentPoint( attachPoint.Name, parentBone.Handle, rotate, translate );
     }
     OgreSkeletonSerializer skelWriter = new OgreSkeletonSerializer();
     skelWriter.ExportSkeleton( skeleton, dstDir + skelFile );
 }
All Usage Examples Of Axiom.Animating.Skeleton::CreateAttachmentPoint