rename function, remove indirection, fix bug
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user