public static void DrawModel(Model model, StillDesign.PhysX.MathPrimitives.Matrix pose, Camera camera) { Matrix[] transforms = new Matrix[model.Bones.Count]; model.CopyAbsoluteBoneTransformsTo(transforms); Matrix m = new Matrix(pose.M11, pose.M12, pose.M13, pose.M14, pose.M21, pose.M22, pose.M23, pose.M24, pose.M31, pose.M32, pose.M33, pose.M34, pose.M41, pose.M42, pose.M43, pose.M44); foreach (ModelMesh mesh in model.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.World = transforms[mesh.ParentBone.Index] * m; effect.View = camera.View; effect.Projection = camera.Projection; effect.EnableDefaultLighting(); effect.SpecularColor = new Vector3(0.5f); effect.Alpha = 1; } mesh.Draw(); } }
public static Matrix AsXNA(this StillDesign.PhysX.MathPrimitives.Matrix m) { return(new Matrix ( m.M11, m.M12, m.M13, m.M14, m.M21, m.M22, m.M23, m.M24, m.M31, m.M32, m.M33, m.M34, m.M41, m.M42, m.M43, m.M44 )); }
public static Microsoft.Xna.Framework.Matrix Convert(StillDesign.PhysX.MathPrimitives.Matrix input) { Microsoft.Xna.Framework.Matrix output = new Microsoft.Xna.Framework.Matrix ( input.M11, input.M12, input.M13, input.M14, input.M21, input.M22, input.M23, input.M24, input.M31, input.M32, input.M33, input.M34, input.M41, input.M42, input.M43, input.M44 ); return(output); }