コード例 #1
0
 /// <summary>
 /// Addsa  torque to the rigidbody relative to its local coordinate system
 /// </summary>
 /// <param name="x">Size of torque along local x-axis</param>
 /// <param name="y">Size of torque along local y-axis</param>
 /// <param name="z">Size of torque along local z-axis</param>
 /// <param name="mode">Type of force to apply</param>
 public static void DebugAddRelativeTorque(this Rigidbody rigidbody, float x, float y, float z, ForceMode mode = ForceMode.Force)
 {
     DebugRigidbody.DrawTorque(rigidbody, rigidbody.worldCenterOfMass, rigidbody.transform.TransformDirection(new Vector3(x, y, z)), mode);
     rigidbody.AddRelativeTorque(x, y, z, mode);
 }
コード例 #2
0
 /// <summary>
 /// Adds a torque to the rigidbody
 /// </summary>
 /// <param name="x">Size of torque along world x-axis</param>
 /// <param name="y">Size of torque along world y-axis</param>
 /// <param name="z">Size of torque along world z-axis</param>
 /// <param name="mode">Type of force to apply</param>
 public static void DebugAddTorque(this Rigidbody rigidbody, float x, float y, float z, ForceMode mode = ForceMode.Force)
 {
     DebugRigidbody.DrawTorque(rigidbody, rigidbody.worldCenterOfMass, new Vector3(x, y, z), mode);
     rigidbody.AddTorque(x, y, z, mode);
 }
コード例 #3
0
 /// <summary>
 /// Addsa  torque to the rigidbody relative to its local coordinate system
 /// </summary>
 /// <param name="torque">Torque vector in local coordinates</param>
 /// <param name="mode">Type of force to apply</param>
 public static void DebugAddRelativeTorque(this Rigidbody rigidbody, Vector3 torque, ForceMode mode = ForceMode.Force)
 {
     DebugRigidbody.DrawTorque(rigidbody, rigidbody.worldCenterOfMass, rigidbody.transform.TransformDirection(torque), mode);
     rigidbody.AddRelativeTorque(torque, mode);
 }
コード例 #4
0
 /// <summary>
 /// Adds a torque to the rigidbody
 /// </summary>
 /// <param name="torque">Torque vector in world coordinates</param>
 /// <param name="mode">Type of force to apply</param>
 public static void DebugAddTorque(this Rigidbody rigidbody, Vector3 torque, ForceMode mode = ForceMode.Force)
 {
     DebugRigidbody.DrawTorque(rigidbody, rigidbody.worldCenterOfMass, torque, mode);
     rigidbody.AddTorque(torque, mode);
 }