Exemplo n.º 1
0
        public void Force(Vector3 direction, ForceType forceType)
        {
            switch (forceType)
            {
            case ForceType.CentralForce:
                rigidBodyObject.ApplyCentralForce(direction);
                break;

            case ForceType.CentralImpulse:
                rigidBodyObject.ApplyCentralImpulse(direction);
                break;

            case ForceType.Torque:
                rigidBodyObject.ApplyTorque(direction);
                break;

            case ForceType.TorqueImpulse:
                rigidBodyObject.ApplyTorqueImpulse(direction);
                break;

            default:
                rigidBodyObject.ApplyForce(direction, gameObject._transform.Position);
                break;
            }
        }
Exemplo n.º 2
0
 public unsafe static void ApplyTorque(this RigidBody obj, ref OpenTK.Vector3 torque)
 {
     fixed(OpenTK.Vector3 *torquePtr = &torque)
     {
         obj.ApplyTorque(ref *(BulletSharp.Math.Vector3 *)torquePtr);
     }
 }
Exemplo n.º 3
0
        protected override void Apply(RigidBody obj, int slice)
        {
            Vector3D torque = this.FTorque[slice];

            obj.ApplyTorque(new Vector3((float)torque.x, (float)torque.y, (float)torque.z));
        }