Can't get rotation from applyForce's rel_pos
Posted: Sun Nov 07, 2021 5:47 pm
Hello,
I'm unable to achieve 'natural' rotation of a rigidbody by modifiying the position from centre of mass to offseted.
Effect of this code is the same as running applyCentralForce(force). The getRotation() quaternion remains at (1, 0, 0, 0);
The body is rigidbody dynamic with a mass of 1 in world with no gravity, compound shape made of a few convex hulls. It rotates normally via manual transformation.
Am I doing this wrong and should I supply a world coordinate that matches some point on the hull itself? My goal is similar to aircraft thrust vectoring, by offsetting the thrust point from the centre.
Thanks for tips in advance
I'm unable to achieve 'natural' rotation of a rigidbody by modifiying the position from centre of mass to offseted.
Code: Select all
btVector3 force(-1, 0, 0);
force *= 13.0f;
btVector3 thrust_position(0, 1.7, 0);
btVector3 com = body->getCenterOfMassPosition();
thrust_position += com;
body->applyForce(force, thrust_position);
The body is rigidbody dynamic with a mass of 1 in world with no gravity, compound shape made of a few convex hulls. It rotates normally via manual transformation.
Am I doing this wrong and should I supply a world coordinate that matches some point on the hull itself? My goal is similar to aircraft thrust vectoring, by offsetting the thrust point from the centre.
Thanks for tips in advance