LinearVelocity related to the ship's coordinate system

Hi all,



I have a Problem with the linearVelocity. The velocity I get from control, is related to the worlds coordinate system. I need it to be related to the ships coordinate system. I tried several things but I cant find the right solution.





Thanks

Niccommander

ship.worldToLocal()?

-.- ok, I should search better :smiley:



Thanks

now I have the problem that this command doesn’t work as I want it.



[java]System.out.println("World: "+activeShip.getControlCasted().getLinearVelocity()+"tLocal: "+activeShip.getControlCasted().getActualSpeed());[/java]

gives out:

World: (0.0, 0.0, 0.0) Local: (-300.0, 0.0, -100.0)



I think this is because I don’t have positions but velocities

probably

Does anyone have a solution?



The velocity is related to the Quaternion of the 3 Ship axes



I tryed to get the value with the division of the Linear velocity and the Ship axes. But I know that it’s impossible to divide a vectors with an other vector.

niccommander said:
Does anyone have a solution?

The velocity is related to the Quaternion of the 3 Ship axes

I tryed to get the value with the division of the Linear velocity and the Ship axes. But I know that it's impossible to divide a vectors with an other vector.


Then use the inverse.
Instead of doing 10 / 2, do 10 * .5

So you would do :
[java]
vector.mult(scalarVector);
[/java]