Removing Model::findSpherePenetrationWithJoint() which was experimental method that was not finally used.

This commit is contained in:
Andrew Meadows 2014-01-15 17:02:02 -08:00
parent 989b733de6
commit 4b94e53acf
2 changed files with 4 additions and 30 deletions

View file

@ -634,29 +634,6 @@ bool Model::findSpherePenetration(const glm::vec3& penetratorCenter, float penet
return false;
}
// TODO: purge this once we get proper collisions against hand paddles
bool Model::findSpherePenetrationWithJoint(const glm::vec3& sphereCenter, float sphereRadius,
glm::vec3& penetration, int jointIndex, float boneScale) const {
if (jointIndex < 0 || jointIndex > _jointStates.size()) {
return false;
}
const FBXGeometry& geometry = _geometry->getFBXGeometry();
const FBXJoint& joint = geometry.joints[jointIndex];
glm::vec3 end = extractTranslation(_jointStates[jointIndex].transform);
float radiusScale = extractUniformScale(_scale) * boneScale;
float endRadius = joint.boneRadius * radiusScale;
glm::vec3 start = end;
float startRadius = joint.boneRadius * radiusScale;
glm::vec3 bonePenetration;
if (joint.parentIndex != -1) {
start = extractTranslation(_jointStates[joint.parentIndex].transform);
startRadius = geometry.joints[joint.parentIndex].boneRadius * radiusScale;
}
const glm::vec3 relativeCenter = sphereCenter - _translation;
return findSphereCapsuleConePenetration(relativeCenter, sphereRadius, start, end,
startRadius, endRadius, penetration);
}
void Model::updateJointState(int index) {
JointState& state = _jointStates[index];
const FBXGeometry& geometry = _geometry->getFBXGeometry();

View file

@ -84,19 +84,19 @@ public:
/// Retrieve the position of the left hand
/// \return true whether or not the position was found
bool getLeftHandPosition(glm::vec3&) const;
bool getLeftHandPosition(glm::vec3& position) const;
/// Retrieve the rotation of the left hand
/// \return true whether or not the rotation was found
bool getLeftHandRotation(glm::quat&) const;
bool getLeftHandRotation(glm::quat& rotation) const;
/// Retrieve the position of the right hand
/// \return true whether or not the position was found
bool getRightHandPosition(glm::vec3&) const;
bool getRightHandPosition(glm::vec3& position) const;
/// Retrieve the rotation of the right hand
/// \return true whether or not the rotation was found
bool getRightHandRotation(glm::quat&) const;
bool getRightHandRotation(glm::quat& rotation) const;
/// Sets the position of the left hand using inverse kinematics.
/// \return whether or not the left hand joint was found
@ -146,9 +146,6 @@ public:
bool findSpherePenetration(const glm::vec3& penetratorCenter, float penetratorRadius,
glm::vec3& penetration, float boneScale = 1.0f, int skipIndex = -1) const;
bool findSpherePenetrationWithJoint(const glm::vec3& sphereCenter, float sphereRadius,
glm::vec3& penetration, int jointIndex, float boneScale = 1.0f) const;
protected:
QSharedPointer<NetworkGeometry> _geometry;