0

I have been looking into the RagdollDemo and have kind of got stuck in the part where setEulerZYX() is used in basis matrix.

transform.setIdentity();
transform.setOrigin(btVector3(btScalar(-0.35), btScalar(1.45),     btScalar(0.)));
  transform.getBasis().setEulerZYX(0,0,M_PI_2);
  m_bodies[BODYPART_LEFT_UPPER_ARM] = localCreateRigidBody(btScalar(1.), offset*transform, m_shapes[BODYPART_LEFT_UPPER_ARM]);

I did some research, yet couldn`t fully understand what exactly does this function do and why it is needed. Any help would be very nice.

user3124361
  • 471
  • 5
  • 21

1 Answers1

1

It is a way (there are others) to set the rotation of the body.

http://bulletphysics.org/Bullet/BulletFull/classbtMatrix3x3.html#a0acce3d3502e34b4f34efd275c140d2a

So this is setting it to 0,0,M_PI_2, M_PI_2 being Pi/2 means this is a rotation on the x axis of 1/4 turn, i.e. 90 degrees.

weston
  • 54,145
  • 21
  • 145
  • 203