recently i wanted to create “true” player body with simulated real torso/head movement.
i currently dont have idea how to easly solve this, but i belive some of you might know nice math solution.
what i have:
getNodeAttatchment of HeadBone
add new node with some translation(front of head) to 1) point node
attach camera to CameraNode inside 2) point node
(so camera rotate exactly like head)
rotate head like this:
character.headBone.setUserControl(true); Quaternion headRotation = defaultHeadRotation.clone(); headRotation.fromAngles(FastMath.DEG_TO_RAD * rotationX, FastMath.DEG_TO_RAD * rotationY, 0); character.headBone.setLocalRotation(headRotation);
When headBone parent like neck or upper torso are rotated in below/up direction, then when i rotate head it will not rotate maintaining up Vector. up Vector is different based on parent elements.
How to fix up direction for headBone in this situation?
(please note i cant use lookAt with UNIT_Y vector because it will disallow looking up/below with head)
Also it would be nice to not have UNIT_Y “instant” up vector, but make tpf affect and change it.
im really tired of this math so any help really appreciated.
here is video to make you more understand the problem: