Simplify code
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user