mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 22:39:18 +02:00
only head and torso for bounding capsule radius
This commit is contained in:
parent
376c23f1a3
commit
d6a716a1aa
1 changed files with 7 additions and 4 deletions
|
@ -1274,15 +1274,18 @@ void Rig::computeAvatarBoundingCapsule(
|
||||||
// even if they do not have legs (default robot)
|
// even if they do not have legs (default robot)
|
||||||
totalExtents.addPoint(glm::vec3(0.0f));
|
totalExtents.addPoint(glm::vec3(0.0f));
|
||||||
|
|
||||||
int numPoses = (int)finalPoses.size();
|
// HACK to reduce the radius of the bounding capsule to be tight with the torso, we only consider joints
|
||||||
for (int i = 0; i < numPoses; i++) {
|
// from the head to the hips when computing the rest of the bounding capsule.
|
||||||
const FBXJointShapeInfo& shapeInfo = geometry.joints.at(i).shapeInfo;
|
int index = _animSkeleton->nameToJointIndex(QString("Head"));
|
||||||
AnimPose pose = finalPoses[i];
|
while (index != -1) {
|
||||||
|
const FBXJointShapeInfo& shapeInfo = geometry.joints.at(index).shapeInfo;
|
||||||
|
AnimPose pose = finalPoses[index];
|
||||||
if (shapeInfo.points.size() > 0) {
|
if (shapeInfo.points.size() > 0) {
|
||||||
for (int j = 0; j < shapeInfo.points.size(); ++j) {
|
for (int j = 0; j < shapeInfo.points.size(); ++j) {
|
||||||
totalExtents.addPoint((pose * shapeInfo.points[j]));
|
totalExtents.addPoint((pose * shapeInfo.points[j]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
index = _animSkeleton->getParentIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// compute bounding shape parameters
|
// compute bounding shape parameters
|
||||||
|
|
Loading…
Reference in a new issue