I’ve been using JME for 2 days, and am following the tutorials and Math for Dummies guide, but still cannot get something right.
I am using physics, and have a CharacterControl. I want to rotate it left and right on the spot, with no additional movement (and no camera movement, I’m using the FlyByCamera - so like the HelloCollision tutorial, but without a first person camera to get rotation from).
This is the code for me trying to rotate it 45 degrees around the Y axis
Quaternion roll45 = new Quaternion();
vectorB = roll45.mult(characterControl.getViewDirection()); System.out.println("final view direction: "+vectorB.toString()); characterControl.setViewDirection(vectorB);
I’ve tried playing with it but the result I get in vectorB is always 0,0,0.
Also I have noticed that despite doing CharacterControl.setViewDirection(1,0,0); or any other set of numbers, as soon as I do getViewDirection() in my update loop it is set back to 0,0,0. Not sure how I use this?