History

use kDop volume of avatar mesh parts for capsule

Andrew Meadows committed 10 years ago

Commit ee751ed1 parent 9c29ba23 files · +38 −58Browse files

Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 3 files). Show all

Unified · Split

interface/src/avatar/SkeletonModel.cpp+6−10
@@ -625,19 +625,15 @@ void SkeletonModel::computeBoundingShape() { · 624 unmodified lines
625625 totalExtents.addPoint(glm::vec3(0.0f));
626626 int numStates = _rig->getJointStateCount();
627627 for (int i = 0; i < numStates; i++) {
628− const JointState& state = _rig->getJointState(i);
629−
630− const glm::mat4& jointTransform = state.getTransform();
631− float scale = extractUniformScale(jointTransform);
632−
633628 // Each joint contributes a capsule defined by FBXJoint.shapeInfo.
634629 // For totalExtents we use the capsule endpoints expanded by the radius.
630+ const JointState& state = _rig->getJointState(i);
631+ const glm::mat4& jointTransform = state.getTransform();
635632 const FBXJointShapeInfo& shapeInfo = geometry.joints.at(i).shapeInfo;
636− for (int j = 0; j < shapeInfo.points.size(); ++j) {
637− glm::vec3 transformedPoint = extractTranslation(jointTransform * glm::translate(shapeInfo.points[j]));
638− vec3 radius(scale * shapeInfo.radius);
639− totalExtents.addPoint(transformedPoint + radius);
640− totalExtents.addPoint(transformedPoint - radius);
633+ if (shapeInfo.points.size() > 0) {
634+ for (int j = 0; j < shapeInfo.points.size(); ++j) {
635+ totalExtents.addPoint(extractTranslation(jointTransform * glm::translate(shapeInfo.points[j])));
636+ }
641637 }
642638 // HACK so that default legless robot doesn't knuckle-drag
643639 if (shapeInfo.points.size() == 0 && (state.getName() == "LeftFoot" || state.getName() == "RightFoot")) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t