Hey, the title pretty much says what I’m trying to do. I tried it with this line:
[java]player.getLocalRotation().fromAngleAxis(player.getLocalRotation().getY() * -1, new Vector3f().UNIT_Y);[/java]
It doesn’t seem to work though. “player” is a PhysicsNode object and I’m using jme3 + jbullet. Can someone please give me a codesnippet where it’s done in a smarter way?
thanks and greetings
You trying to rotate it 180 degrees? Use player.getLocalRotation().getY() - FastMath.PI I guess.
But last time I tried to rotate a physicsnode it didn’t work too well, so better to rotate the model in the physicsnode.
Just my 2 cents…
Well, I noticed that the line of code I posted is pretty stupid. And no I’m not trying to rotate the node 180 degrees. I actually wanted to prevent the rotation on the y axis, but I figured that I also can just avoid the rotation on every axis by using setAngularDamping(). That’s sufficient for me.