Hi there,
I’m trying to get my model who has a BetterCharacterControl to face a certain spatial in the scene.
Unfortunately everything I have tried has no effect on the actual way the camera is facing.
Vector3f pointA = player.getWorldTranslation();
Vector3f pointB = ((Node)gm.getSceneManager().getScene().getChild
("Entity Node")).getChild("Torch").getWorldTranslation();
Vector3f viewDirection = (pointB.subtract(pointA));
player.getPhys().setViewDirection(viewDirection);
System.out.println(player.getPhys().getViewDirection());
Running this code on a loop while moving around the room does change the rotation of the Physics Control but has no effect on the camera.
Here is a small snippet of the output. Hypothetically this should force the camera to remain focused on the “Torch”
but has no effect.
(-6.4092374, 0.47387758, 2.0293849)
(-6.3187323, 0.47386888, 2.1332579)
(-6.228227, 0.47386274, 2.2371304)
(-6.137723, 0.4738532, 2.341002)
(-6.0472174, 0.47384822, 2.444875)
(-5.9567127, 0.47384366, 2.5487473)
(-5.866208, 0.47383896, 2.6526196)
(-5.775704, 0.47383377, 2.7564917)
(-5.6851997, 0.47382858, 2.8603635)
(-5.592414, 0.48771226, 2.9668534)
(-5.5046434, 0.4849484, 3.0675883)
(-5.4140506, 0.48272365, 3.1715624)
(-5.323473, 0.48094493, 3.2755187)
(-5.23291, 0.47951943, 3.3794572)
(-5.142359, 0.478379, 3.4833832)
(-5.051817, 0.47746623, 3.5872982)
(-4.9612823, 0.4767355, 3.6912045)
(-4.8707533, 0.4761535, 3.7951045)
(-4.7802305, 0.47568524, 3.8989983)