BuildRigidBodyTransform

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • BuildRigidBodyTransform

      hi,
      In PhysicsComponent::BuildRigidBodyTransform (PhysicsComponent.cpp) about line 249 pPositionElement is used for assigning m_rigidBodyOrientation.
      Should it not be pTransformElement instead for each of the roll, pitch, yaw values.

      PhysicsComponent.cpp starting at line 231

      Source Code

      1. TiXmlElement* pPositionElement = pTransformElement->FirstChildElement("Position");
      2. if (pPositionElement)
      3. {
      4. double x = 0;
      5. double y = 0;
      6. double z = 0;
      7. pPositionElement->Attribute("x", &x);
      8. pPositionElement->Attribute("y", &y);
      9. pPositionElement->Attribute("z", &z);
      10. m_RigidBodyLocation = Vec3(x, y, z);
      11. }
      12. TiXmlElement* pOrientationElement = pTransformElement->FirstChildElement("Orientation");
      13. if (pOrientationElement)
      14. {
      15. double yaw = 0;
      16. double pitch = 0;
      17. double roll = 0;
      18. pPositionElement->Attribute("yaw", &yaw); //shiuld it not be pTransformElement->Attribute("yaw", &yaw);
      19. pPositionElement->Attribute("pitch", &pitch);
      20. pPositionElement->Attribute("roll", &roll);
      21. m_RigidBodyOrientation = Vec3((float)DEGREES_TO_RADIANS(yaw), (float)DEGREES_TO_RADIANS(pitch), (float)DEGREES_TO_RADIANS(roll));
      22. }
      Display All


      Sorry if this is a duplicate of a known issue, I did a quick look (A Mans "Look") and found nothing.
    • Yes and No,

      pPositionElement->Attribute("yaw", &yaw); //shiuld it not be pTransformElement->Attribute("yaw", &yaw);


      Yes you are right in that this should not be pPositionElement.

      Should it not be pTransformElement instead for each of the roll, pitch, yaw values.


      No in that it should actually be pOrientationElement which is retrieved from the pTransformElement. Good catch though, just a quick typo in which one to use.

      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz