Hi all,
In my game design I use first person view for movement and then switch to an overhead view for combat. This is working fine.
When I setup combat I select a player and the scene is re-rendered with the camera raised few meters and facing down.
Then I want to select a specific player on the screen at a coordinate a move the camera so it’s directly overhead. This part for me is not working.
So in my keyBehavior class I get the Transform3D from the player object and from that get his vector. Then I try to place the camera at that vector. But the camera view goes haywire.
Code is like this:
// Local new transform3D so it should be empty
Transform3D t = new Transform3D();
// init the Transform3D from the selected object
selectedPlayer.getTG().getTransform(t);
// Get the vector for this object
Vector3d vector = new Vector3d();
t.get(vector);
// Reset the KeyBehavior Transform3D
t3d = new Transform3D();
// Set the KeyBehavior TransformGroup
targetTG.getTransform(t3d);
// This is an instance var for repeated calcs
toMove.setTranslation(theMove);
// move the camera? ???
t3d.mul(toMove);
targetTG.setTransform(t3d);
TIA