Wich Physic should I use for a Spaceship?

Hi all,



I have a problem. I want to control a Spaceship with Physic. So i thought i can use the “VehicleControl” class. Now I have the problem that I can’t move and rotate the ship how I want to. My rotation-method rotates the ship related to the worlds coordinate-axes but it should be rotated related to the ships coordinate-axes.



The rotation method I use:

[java]public void rotate(float yaw, float roll, float pitch, float tpf,

float value) {



TempVars vars = TempVars.get();

Quaternion q = vars.quat1;

q.fromAngles(yawtpfvalueactualRotationSpeed, rolltpfvalueactualRotationSpeed, pitchtpfvalue*actualRotationSpeed);

q.multLocal(control.getPhysicsRotation());



vars.release();



control.setPhysicsRotation(q);



}[/java]



And how can I move the ship?



Sould I try to write a new Physic Class or can i use the existing classes?



Thanks

Niccommander

Just use a RigidBody, the VehicleControl is for wheeled vehicles primarily.

Edit: Oh, and dont setRotation or setLocation to control it, thats like beaming the object in the physics space. You will have to apply proper forces to the ship. If thats too much for you then you dont really want physics and should implement your own movement.

1 Like

Ok, thanks for the answer. I need physic only for collision. The movement I can do without physic. I thought I do movement with physic because I need it for collision. Is there an other way to realise collision?