Constraint about a spaceship

XT95
Posts: 1
Joined: Mon Nov 22, 2010 9:21 pm

Constraint about a spaceship

Post by XT95 »

Hi all,
I'm trying to make a little game like star wars racer or f-zero.
So, I have a spaceship flying at ca. 1m above the ground.
My problem is : when the spaceship hits the heightmap, it suddenly rotates and can get upside-down..
I limit the angular velocity, to simulate the wind force, by :

Code: Select all

    velocity = m_body->getAngularVelocity();
    velocity *= .9f;
    m_body->setAngularVelocity(velocity);
So, how may I have a constraint or something like that to always have a good orientation of my spaceship ?


Thx a lot in advance :)