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
Display All
Sorry if this is a duplicate of a known issue, I did a quick look (A Mans "Look") and found nothing.
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
- TiXmlElement* pPositionElement = pTransformElement->FirstChildElement("Position");
- if (pPositionElement)
- {
- double x = 0;
- double y = 0;
- double z = 0;
- pPositionElement->Attribute("x", &x);
- pPositionElement->Attribute("y", &y);
- pPositionElement->Attribute("z", &z);
- m_RigidBodyLocation = Vec3(x, y, z);
- }
- TiXmlElement* pOrientationElement = pTransformElement->FirstChildElement("Orientation");
- if (pOrientationElement)
- {
- double yaw = 0;
- double pitch = 0;
- double roll = 0;
- pPositionElement->Attribute("yaw", &yaw); //shiuld it not be pTransformElement->Attribute("yaw", &yaw);
- pPositionElement->Attribute("pitch", &pitch);
- pPositionElement->Attribute("roll", &roll);
- m_RigidBodyOrientation = Vec3((float)DEGREES_TO_RADIANS(yaw), (float)DEGREES_TO_RADIANS(pitch), (float)DEGREES_TO_RADIANS(roll));
- }
Sorry if this is a duplicate of a known issue, I did a quick look (A Mans "Look") and found nothing.