I know, I know… see “scenegraph for dummies”… already done that, please bear with me
I’ve made a parent Node, attached a child Geometry to it and attached a CharacterControl to the parent Node.
Then I want to rotate the parent Node. The method getWorldRotation() shows that the parent Node is rotated, but on the screen I don’t see the child rotating…
When the Spatial is linked to a physics object, it cannot be transformed normally. You have to use the physics functions for those operations.
Makes sense. Let’s do yet another intermediary node…
.setViewDirection should do the Trick
Well… more or less. With this code I get endless spinning:
How should I fix it?
A quaternion is a rotation, and you probablly apply it in every single frame? resulting in a spinning.
I know, I want to do the CharacterControl equivalent of this:
Don’t you already have an simple lookat point? I mean there has to be a reason for what you want to lookat.
Other than that, simply use x = sin Rotation around y axis (phi) and z = cos phi.
BUt i guess there is something built in like createLookAt.
Take a look at like the chasercams and stuff
new Vector3f(0,0,1) → forward
→ forward in q rotated space now
setViewDir(forward) → set the rotated forward dir