Beispiel #1
0
 public void CopyTo(MAnimatedModel m)
 {
     //do not call base(MSceneObject) CopyTo here because it is handled by SpawnHandler and adds extra Physics
     m.SetMaterial(material);
     //m.Meshes = Meshes;
     m.scene      = scene;
     m.BoneOffset = BoneOffset;
     m.m_global_inverse_transform = m_global_inverse_transform;
     m.m_num_bones     = m_num_bones;
     m.m_bone_matrices = m_bone_matrices;
     m.m_bone_mapping  = m_bone_mapping;
     //controller must not be linked otherwise all animations have the same controller
     m._animationController = new MAnimationController();
     m._animationController.Setup(this);
     _animationController.CopyTo(m._animationController);
 }
Beispiel #2
0
 public void CopyTo(MAnimatedModel m)
 {
     //do not call base(MSceneObject) CopyTo here because it is handled by SpawnHandler and adds extra Physics
     //base.CopyTo(m);
     m.SetMaterial(material);
     //m.Meshes = Meshes;
     m.scene      = scene;
     m.BoneOffset = BoneOffset;
     m.m_global_inverse_transform = m_global_inverse_transform;
     m.transforms      = transforms;
     m.m_num_bones     = m_num_bones;
     m.m_bone_matrices = m_bone_matrices;
     for (int i = 0; i < MAX_BONES; i++)
     {
         m.transforms[i] = Matrix4x4.Identity;
     }
     m.m_bone_mapping = m_bone_mapping;
     //controller must not be linked otherwise all animations have the same controller
     m._animationController = new MAnimationController();
     m.CalculateDrawMatrices(Matrix4d.Identity, Matrix4d.Identity);
     m._animationController.Setup(m);
     _animationController.CopyTo(m._animationController);
     _animationController.PlayAnimation("idle", 1);
 }
 public void Setup(MAnimatedModel model)
 {
     _model = model;
 }