Exemple #1
0
 public ModelMesh NewMesh(string name, ModelBone parentBone, BoundingBox boundingBox)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     if (parentBone == null)
     {
         throw new ArgumentNullException("parentBone");
     }
     if (parentBone.Model != this)
     {
         throw new InvalidOperationException("Parent bone must belong to the same model.");
     }
     return(new ModelMesh
     {
         Name = name,
         ParentBone = parentBone,
         BoundingBox = boundingBox
     });
 }
Exemple #2
0
 public void CopyAbsoluteBoneTransformsTo(Matrix[] absoluteTransforms)
 {
     if (absoluteTransforms == null)
     {
         throw new ArgumentNullException("transforms");
     }
     if (absoluteTransforms.Length < m_bones.Count)
     {
         throw new ArgumentOutOfRangeException("transforms");
     }
     for (int i = 0; i < m_bones.Count; i++)
     {
         ModelBone modelBone = m_bones[i];
         if (modelBone.ParentBone == null)
         {
             absoluteTransforms[i] = modelBone.Transform;
         }
         else
         {
             Matrix.MultiplyRestricted(ref modelBone.m_transform, ref absoluteTransforms[modelBone.ParentBone.Index], out absoluteTransforms[i]);
         }
     }
 }
Exemple #3
0
 public void InternalDispose()
 {
     m_rootBone = null;
     m_bones.Clear();
     Utilities.DisposeCollection(m_meshes);
 }