Fix item orientation bug. Items should now appear correctly.

This commit is contained in:
nixt
2014-07-25 15:11:49 +05:30
parent a8a6435657
commit 051ee24173

View File

@@ -40,7 +40,9 @@ Item::Item(ItemType type, const Vec3& xyz, const Vec3& normal,
m_distance_2 = 1.2f;
initItem(type, xyz);
// Sets heading to 0, and sets pitch and roll depending on the normal. */
m_original_hpr = Vec3(0, normal);
m_original_hpr.setHPR(btQuaternion(-normal.cross(Vec3(0, 1, 0)),
normal.angle(Vec3(0, 1, 0)))
);
m_original_mesh = mesh;
m_original_lowmesh = lowres_mesh;
m_listener = NULL;