Howdy monkeys! Soo, basically what I’m attempting to do is rotate the character to “compensate” for acceleration (ala wolfire style). Now, I have a node which I attach the character control to and then I attach the Sinbad spatial to node, and as many of you know, the BetterCharacterControl uses the node’s rotation to handle view direction and such, so I can’t really mess with that (otherwise everything is wicked glitchy).
Anyways, I have the code for rotation and such, which works really well (it rotates my test objects the way I want it to perfectly). In fact, the way I have it set up (rotating the Sinbad spatial every update) works perfectly too… That is, until I change the ViewDirection of the character control… Then, because I do all the calculations and stuff with the local rotation (world rotation doesn’t quite work the way I’m doing things…), it doesn’t compensate for the rotations of the parent node; so it still rotates along the axis that it thinks it’s supposed to be rotating on, but it’s not the one that it should be XDD
My code for rotation (for anyone who’s trying to accomplish the same task; it works perfectly fine when not in a parent-child problem like I am >.<):
[java]Vector3f vv = getVelocity().cross(getLocalUp());
Quaternion q = new Quaternion();
final Quaternion j = new Quaternion();
So, really what I need help with here is a way to rotate the model the way I need it to without having to rewrite the entirety of BetterCharacterControl… I mean it works perfectly with rotating the rigid body but then the rigid body doesn’t rotate the character node?? (also the whole “onGround” check goes totes whack XD but I feel that would be easier to solve if only the darn control rotated its spatial like it’s supposed to… I probably buggered up somewhere or something idk)… Any suggestions? Thanks!