rename function, remove indirection, fix bug

This commit is contained in:
Irlan
2017-04-11 16:35:18 -03:00
parent d082c59754
commit bd69458750
16 changed files with 74 additions and 63 deletions

View File

@ -64,7 +64,7 @@ b3Mat44 Camera::BuildProjectionMatrix() const
b3Transform Camera::BuildWorldTransform() const
{
b3Transform xf;
xf.rotation = b3ConvertQuatToRot(m_q);
xf.rotation = b3ConvertQuatToMat(m_q);
xf.position = (m_zoom * xf.rotation.z) - m_center;
return xf;
}
@ -78,7 +78,7 @@ b3Mat44 Camera::BuildWorldMatrix() const
b3Transform Camera::BuildViewTransform() const
{
b3Transform xf;
xf.rotation = b3ConvertQuatToRot(m_q);
xf.rotation = b3ConvertQuatToMat(m_q);
xf.position = (m_zoom * xf.rotation.z) - m_center;
return b3Inverse(xf);
}

View File

@ -25,14 +25,14 @@ public:
CapsuleAndHullCollision1()
{
m_xfA.position.Set(0.0f, 0.0f, 0.0f);
m_xfA.rotation = b3ConvertQuatToRot(b3Quat(b3Vec3(0.0f, 0.0f, 1.0f), 0.55f * B3_PI));
m_xfA.rotation = b3ConvertQuatToMat(b3Quat(b3Vec3(0.0f, 0.0f, 1.0f), 0.55f * B3_PI));
m_sA.m_centers[0].Set(1.0f, -1.0f, 0.0f);
m_sA.m_centers[1].Set(0.0f, 1.0f, 0.0f);
m_sA.m_radius = 2.0f;
m_xfB.position.Set(0.f, 0.0f, 0.0f);
m_xfB.rotation = b3ConvertQuatToRot(b3Quat(b3Vec3(0.0f, 0.0f, 1.0f), 0.0f * B3_PI));
m_xfB.rotation = b3ConvertQuatToMat(b3Quat(b3Vec3(0.0f, 0.0f, 1.0f), 0.0f * B3_PI));
b3Transform xf;
xf.SetIdentity();

View File

@ -25,14 +25,14 @@ public:
CapsuleAndHullCollision2()
{
m_xfA.position.Set(0.0f, 0.0f, 0.0f);
m_xfA.rotation = b3ConvertQuatToRot(b3Quat(b3Vec3(0.0f, 0.0f, 1.0f), 0.55f * B3_PI));
m_xfA.rotation = b3ConvertQuatToMat(b3Quat(b3Vec3(0.0f, 0.0f, 1.0f), 0.55f * B3_PI));
m_sA.m_centers[0].Set(0.0f, 0.0f, 0.0f);
m_sA.m_centers[1].Set(0.0f, 0.0f, 0.0f);
m_sA.m_radius = 0.05f;
m_xfB.position.Set(0.f, 0.0f, 0.0f);
m_xfB.rotation = b3ConvertQuatToRot(b3Quat(b3Vec3(0.0f, 0.0f, 1.0f), 0.0f * B3_PI));
m_xfB.rotation = b3ConvertQuatToMat(b3Quat(b3Vec3(0.0f, 0.0f, 1.0f), 0.0f * B3_PI));
b3Transform xf;
xf.SetIdentity();

View File

@ -92,7 +92,7 @@ public:
if (key == GLFW_KEY_X)
{
b3Quat qx(b3Vec3(1.0f, 0.0f, 0.0f), 0.05f * B3_PI);
b3Mat33 xfx = b3ConvertQuatToRot(qx);
b3Mat33 xfx = b3ConvertQuatToMat(qx);
m_xfB.rotation = m_xfB.rotation * xfx;
}
@ -100,7 +100,7 @@ public:
if (key == GLFW_KEY_Y)
{
b3Quat qy(b3Vec3(0.0f, 1.0f, 0.0f), 0.05f * B3_PI);
b3Mat33 xfy = b3ConvertQuatToRot(qy);
b3Mat33 xfy = b3ConvertQuatToMat(qy);
m_xfB.rotation = m_xfB.rotation * xfy;
}

View File

@ -103,7 +103,7 @@ public:
if (key == GLFW_KEY_X)
{
b3Quat qx(b3Vec3(1.0f, 0.0f, 0.0f), 0.05f * B3_PI);
b3Mat33 xfx = b3ConvertQuatToRot(qx);
b3Mat33 xfx = b3ConvertQuatToMat(qx);
m_xfB.rotation = m_xfB.rotation * xfx;
}
@ -111,7 +111,7 @@ public:
if (key == GLFW_KEY_Y)
{
b3Quat qy(b3Vec3(0.0f, 1.0f, 0.0f), 0.05f * B3_PI);
b3Mat33 xfy = b3ConvertQuatToRot(qy);
b3Mat33 xfy = b3ConvertQuatToMat(qy);
m_xfB.rotation = m_xfB.rotation * xfy;
}

View File

@ -26,6 +26,7 @@ public:
{
{
b3BodyDef bd;
bd.orientation.Set(b3Vec3(0.0f, 1.0f, 0.0f), 0.18f * B3_PI);
b3Body* ground = m_world.CreateBody(bd);
b3MeshShape ms;