Simplify code

This commit is contained in:
Benau
2016-09-13 09:26:05 +08:00
parent f5d43aaa2e
commit 382905716f

View File

@@ -41,17 +41,11 @@ Item::Item(ItemType type, const Vec3& xyz, const Vec3& normal,
m_distance_2 = 1.2f;
initItem(type, xyz);
if (-normal.cross(Vec3(0, 1, 0)).length() == 0)
{
Vec3 axis(0, 0, 1);
m_original_rotation = btQuaternion(axis, normal.angle(Vec3(0, 1, 0)));
}
else
{
Vec3 axis(-normal.cross(Vec3(0, 1, 0)));
m_original_rotation = btQuaternion(axis, normal.angle(Vec3(0, 1, 0)));
}
Vec3 axis = -normal.cross(Vec3(0, 1, 0));
if (axis.length() == 0)
axis = Vec3(0, 0, 1);
m_original_rotation = btQuaternion(axis, normal.angle(Vec3(0, 1, 0)));
m_rotation_angle = 0.0f;
m_original_mesh = mesh;
m_original_lowmesh = lowres_mesh;