raycast vehicle - understanding coordinate system

Post Reply
Tadek
Posts: 7
Joined: Sun Jan 22, 2017 5:41 pm

raycast vehicle - understanding coordinate system

Post by Tadek »

Bullet world space coordinate system is the same as opengl world coordinate system. I have noticed that raycast vehicle has the following function:

Code: Select all

virtual void btRaycastVehicle::setCoordinateSystem(int rightIndex,
                                                   int upIndex,
                                                   int forwardIndex);
How does that function work ?

By default raycast vehicle has the following parametets:
  • forward vector: [0, 1, 0]
  • forward axis: 1
  • right axis: 0
  • up axis: 2
Does it mean that y axis is swapped with z axis ?

After calling:

Code: Select all

raycastVehicle.setCoordinateSystem(0,1,2);
I get the following parameters:
  • forward vector: [0, 0, 1]
  • forward axis: 2
  • right axis: 0
  • up axis: 1
which makes more sense to me but I'm still confused why a default setup is other (not compatible with world coordinate system) and how to interpret it.
Post Reply