Fix ubuntu warning by removing cancelOutRollAndPitch2()

This commit is contained in:
Anthony J. Thibault 2018-05-14 09:13:26 -07:00
parent 274ac98bd6
commit 1cc7eb635f

View file

@ -3011,29 +3011,6 @@ static void drawBaseOfSupport(float baseOfSupportScale, float footLocal, glm::ma
DebugDraw::getInstance().drawRay(frontLeft, frontRight, rayColor);
}
// cancel out roll and pitch test fix
glm::quat cancelOutRollAndPitch2(const glm::quat& q) {
glm::vec3 zAxis = q * glm::vec3(0.0f, 0.0f, 1.0f);
glm::vec3 newZ;
glm::vec3 newX;
glm::vec3 newY;
// cancel out the roll and pitch
if (zAxis.x == 0 && zAxis.z == 0.0f) {
if (fabs(zAxis.y) > 0.0) {
// new z is the up axis, that is the direction the body is pointing
newZ = glm::normalize(q * glm::vec3(0.0f, 1.0f, 0.0f));
}
newX = glm::cross(vec3(0.0f, 1.0f, 0.0f), newZ);
newY = glm::cross(newZ, newX);
} else {
newZ = glm::normalize(vec3(zAxis.x, 0.0f, zAxis.z));
newX = glm::cross(vec3(0.0f, 1.0f, 0.0f), newZ);
newY = glm::cross(newZ, newX);
}
glm::mat4 temp(glm::vec4(newX, 0.0f), glm::vec4(newY, 0.0f), glm::vec4(newZ, 0.0f), glm::vec4(0.0f, 0.0f, 0.0f, 1.0f));
return glm::quat_cast(temp);
}
// this function finds the hips position using a center of gravity model that
// balances the head and hands with the hips over the base of support
// returns the rotation and position of the Avatar in Sensor space