From ef10e5734d301df5f042b761a79b43149df8ab56 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 31 Mar 2015 16:53:33 -0700 Subject: [PATCH] bounding box for skeleton with bad mesh weights --- interface/src/avatar/SkeletonModel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/src/avatar/SkeletonModel.cpp b/interface/src/avatar/SkeletonModel.cpp index 3a61f69dee..dc5427ab48 100644 --- a/interface/src/avatar/SkeletonModel.cpp +++ b/interface/src/avatar/SkeletonModel.cpp @@ -685,6 +685,10 @@ void SkeletonModel::computeBoundingShape(const FBXGeometry& geometry) { * joint.preTransform * glm::mat4_cast(modifiedRotation) * joint.postTransform; } + // Each joint contributes its point to the bounding box + glm::vec3 jointPosition = extractTranslation(transforms[i]); + totalExtents.addPoint(jointPosition); + Shape* shape = _shapes[i]; if (!shape) { continue; @@ -694,8 +698,6 @@ void SkeletonModel::computeBoundingShape(const FBXGeometry& geometry) { // that contains the sphere centered at the end of the joint with radius of the bone. // TODO: skip hand and arm shapes for bounding box calculation - glm::vec3 jointPosition = extractTranslation(transforms[i]); - int type = shape->getType(); if (type == CAPSULE_SHAPE) { // add the two furthest surface points of the capsule