Rotation of complex object

Post Reply
P_Kras
Posts: 2
Joined: Sat Oct 24, 2015 6:57 pm

Rotation of complex object

Post by P_Kras »

I'm creating space ship.
ship1.png
ship1.png (9.61 KiB) Viewed 1722 times

Ship consisting of modules. Each of them have btRigidBody. Contacting modules connected with constraints.
Four small spheres at sides are maneuvering thrusters.
I want to control my ship by applying forces to them.
When I tries to apply force like this:
ship3.png
ship3.png (9.71 KiB) Viewed 1722 times
everything is ok, ship is moving forward.
But when I tries to rotate ship (yaw in this case) ship isn't rotating.
ship3.png
ship3.png (9.66 KiB) Viewed 1704 times
I also noticed that when I apply side force to only one thruster (can't attach fourth image, look at second) ship is moving sideway but not rotating.

I'm sure there is something wrong with constraints here. I tried to use fixed, hinge and dof6 constraints but it didn't help.
P_Kras
Posts: 2
Joined: Sat Oct 24, 2015 6:57 pm

Re: Rotation of complex object

Post by P_Kras »

I've found problem. I didn't call m_shape.calculateLocalInertia() and didn't specify inertia in rigid body constructor.
Post Reply