Beispiel #1
0
        protected Vector3 SetMass(float mass)
        {
            PrimitiveProperties primitiveProperties = new PrimitiveProperties(PrimitiveProperties.MassDistributionEnum.Solid, PrimitiveProperties.MassTypeEnum.Density, mass);

            collision.GetMassProperties(primitiveProperties, out junk, out com, out it, out itCoM);
            body.BodyInertia = itCoM;
            body.Mass        = junk;

            return(com);
        }
Beispiel #2
0
        public Vector3 SetMass(float mass)
        {
            PrimitiveProperties primitiveProperties =
                new PrimitiveProperties(PrimitiveProperties.MassDistributionEnum.Solid, PrimitiveProperties.MassTypeEnum.Density, mass);

            float junk; Vector3 com; Matrix it, itCoM;

            collision.GetMassProperties(primitiveProperties, out junk, out com, out it, out itCoM);
            body.BodyInertia = itCoM;
            body.Mass        = junk;
            centerOfMass     = com;

            return(com);
        }
Beispiel #3
0
        internal Vector3 SetMass(float mass)
        {
            PrimitiveProperties primitiveProperties = new PrimitiveProperties(
                PrimitiveProperties.MassDistributionEnum.Solid,
                PrimitiveProperties.MassTypeEnum.Mass,
                mass);

            float   oMass;
            Vector3 com = new Vector3();
            Matrix  it, itCom;

            Skin.GetMassProperties(primitiveProperties, out oMass, out com, out it, out itCom);
            body.BodyInertia = itCom;
            body.Mass        = oMass;

            return(com);
        }
Beispiel #4
0
        private Vector3 ApplyMass(float mass)
        {
            float   junk;
            Vector3 com;

            Microsoft.Xna.Framework.Matrix it;
            Microsoft.Xna.Framework.Matrix itCoM;

            var primitiveProperties = new PrimitiveProperties(PrimitiveProperties.MassDistributionEnum.Solid, PrimitiveProperties.MassTypeEnum.Mass, mass);

            collisionSkin.GetMassProperties(primitiveProperties, out junk, out com, out it, out itCoM);

            PhysicsBody.BodyInertia = itCoM;
            PhysicsBody.Mass        = junk;

            return(com);
        }
Beispiel #5
0
        private static Vector3 SetMass(float mass, CollisionSkin skin, Body body)
        {
            PrimitiveProperties primitiveProperties = new PrimitiveProperties(
                PrimitiveProperties.MassDistributionEnum.Solid,
                PrimitiveProperties.MassTypeEnum.Mass, mass);

            float   junk;
            Vector3 com;
            Matrix4 it;
            Matrix4 itCoM;

            skin.GetMassProperties(primitiveProperties, out junk, out com, out it, out itCoM);

            body.BodyInertia = itCoM;
            body.Mass        = junk;

            return(com);
        }