- Home /
Question by
zenforhire · Jul 01, 2013 at 04:06 PM ·
torque
Rigidbody should only torque around selected axis
Hi All,
Tuning the turning radius of a ship. It flops over and pitches in the first 90 degrees of course change? It slowly rotates around local Z and X axis too. I only want the y axis.
I apply forward force in Z direction. I torque around the Y axis.
gravity is off
capsule collider in the Z direction.
mass = 500
cg = ( 0.0, 0.0, 0.0 )
Relevant code:
// the force is relative to the rb local corrdinate system
bodyToPush.AddRelativeForce( 0.0f, // x : float,
0.0f, // y : float,
force, // z : float,
ForceMode.Force ); // mode : ForceMode = ForceMode.Force) : void
protected virtual void applyTorque( float torque ) {
//print ( "torque: " + torque );
Rigidbody parentRB = connectedRigidbody.rigidbody;
parentRB.AddRelativeTorque( new Vector3( 0.0f, torque, 0.0f ) );
}
Cheers, Kevin
Comment
Your answer
Follow this Question
Related Questions
Nose Diving Plane 1 Answer
Moving a rigid body on a plane applying forces 1 Answer
Car moving in right direction. 1 Answer
Compute inertia tensor based only on colliders in same layer as parent? 0 Answers
Can I, someway, avoid centripetal force? 0 Answers