ups sorry for the long answering time:(
But this time i can explain the problem better.
Now the Movenfunction of the game runs over the Camera.class :
Like this i want to make the new moventfunction of the ship.
I wish there where functions in the Object3D.class names move(forward|back, distance) and rotateX/rotateY like the Camera.
But the roatex function from Object3D rotate at the world-axes wight?
not like the camera.rotateX function, which calculate with his own direction vector?
Because in the future i want to move only the ship object and command the camera to follow.
I hope this was eraser to understand.
Jan
But this time i can explain the problem better.
Now the Movenfunction of the game runs over the Camera.class :
Code Select
// RotateX/RotateY value = -1 | 0 | 1 for up/down and left/right
//AxisXchange/AxisYchange value = 1-360 (°)
//speeddirection value = 1 (unit per s)
//speeddirectionchange value = 1 (° per s)
//Ship and camera created at Vector (0,0,0)
//Camera move behind ship
world.getCamera().moveCamera(2, 10);
//player change direction to upper direction
RotateX = 1
//Camera move to ship position
world.getCamera().moveCamera(1, 10);
//camera rotate the direction to upper direction
if(RotateX != 0)
{
AxisXchange= RotateX * speeddirectionchange * deltaTime;
activity.world.getCamera().rotateX(AxisXchange/360);
}
if( RotateY != 0)
{
AxisYchange= -RotateY * speeddirectionchange * deltaTime;
activity.world.getCamera().rotateY(AxisYchange/360);
}
//camera move the distance which the ship must move
world.getCamera().moveCamera(1,.speeddirection *activity.deltaTime);
//ship get the new position of the camera
newshipposition= world.getCamera().getPosition();
//camera move behind the ship
world.getCamera().moveCamera(2, 10);
Like this i want to make the new moventfunction of the ship.
I wish there where functions in the Object3D.class names move(forward|back, distance) and rotateX/rotateY like the Camera.
But the roatex function from Object3D rotate at the world-axes wight?
not like the camera.rotateX function, which calculate with his own direction vector?
Because in the future i want to move only the ship object and command the camera to follow.
I hope this was eraser to understand.
Jan