/// <summary> /// Apply torque force on the body. /// </summary> /// <param name="torque">Torque force to apply.</param> /// <param name="asImpulse">If true, will apply torque as an impulse.</param> public void ApplyTorque(Vector3 torque, bool asImpulse = false) { if (asImpulse) { BulletRigidBody.ApplyTorqueImpulse(ToBullet.Vector(torque)); } else { BulletRigidBody.ApplyTorque(ToBullet.Vector(torque)); } BulletRigidBody.Activate(); }
/// <summary> /// Apply impulse on the body, from its center. /// </summary> /// <param name="impulse">Impulse to apply.</param> public void ApplyImpulse(Vector3 impulse) { BulletRigidBody.ApplyCentralImpulse(ToBullet.Vector(impulse)); BulletRigidBody.Activate(); }
/// <summary> /// Apply force on the body, from its center. /// </summary> /// <param name="force">Force to apply.</param> public void ApplyForce(Vector3 force) { BulletRigidBody.ApplyCentralForce(ToBullet.Vector(force)); BulletRigidBody.Activate(); }
/// <summary> /// Apply force on the body, from a given position. /// </summary> /// <param name="force">Force to apply.</param> /// <param name="from">Force source position.</param> public void ApplyForce(Vector3 force, Vector3 from) { BulletRigidBody.ApplyForce(ToBullet.Vector(force), ToBullet.Vector(from)); BulletRigidBody.Activate(); }
/// <summary> /// Apply impulse on the body, from a given position. /// </summary> /// <param name="impulse">Impulse to apply.</param> /// <param name="from">Impulse source position.</param> public void ApplyImpulse(Vector3 impulse, Vector3 from) { BulletRigidBody.ApplyImpulse(ToBullet.Vector(impulse), ToBullet.Vector(from)); BulletRigidBody.Activate(); }