What would that code look like if I wanted to take that forward direction and nudge it towards the left/right by a 45 degrees? Any links to posts that might help are greatly appreciated. Thanks for your time.
I really thing we should add documentation to getRotationColumn() that says “If you think you need to use this then you are probably incorrect.” It’s the long way to go to do a really simple thing.
Is the same as:
getPhysicsRotation().mult(Vector3f.UNIT_X).mult(2)
…only this version is clearer to just about anyone as to what’s really going on. It also perhaps hints at a possible solution to your question. For example, what if you passed a different vector to that mult? (Is the 45 degree rotation thing a constant?)
I think maybe some of the tutorials mention getRotationColumn() and it would be really nice if we could carve those out with a rusty spoon.
I couldn’t figure it out. However I got some nice results with the following code:
bananaSplit = kartNode.getControl(RigidBodyControl.class).getPhysicsRotation().mult(Vector3f.UNIT_X);
bananaSplit.y += impulseAngle;// can be + or - for right or left, impulseAngle is 45 / 180f * FastMath.PI
kartNode.getControl(RigidBodyControl.class).applyTorqueImpulse(bananaSplit);