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
625 totalExtents.addPoint(glm::vec3(0.0f));625 totalExtents.addPoint(glm::vec3(0.0f));
626 int numStates = _rig->getJointStateCount();626 int numStates = _rig->getJointStateCount();
627 for (int i = 0; i < numStates; i++) {627 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
633 // Each joint contributes a capsule defined by FBXJoint.shapeInfo.628 // Each joint contributes a capsule defined by FBXJoint.shapeInfo.
634 // For totalExtents we use the capsule endpoints expanded by the radius.629 // 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();
635 const FBXJointShapeInfo& shapeInfo = geometry.joints.at(i).shapeInfo;632 const FBXJointShapeInfo& shapeInfo = geometry.joints.at(i).shapeInfo;
636 for (int j = 0; j < shapeInfo.points.size(); ++j) {633 if (shapeInfo.points.size() > 0) {
637 glm::vec3 transformedPoint = extractTranslation(jointTransform * glm::translate(shapeInfo.points[j]));634 for (int j = 0; j < shapeInfo.points.size(); ++j) {
638 vec3 radius(scale * shapeInfo.radius);635 totalExtents.addPoint(extractTranslation(jointTransform * glm::translate(shapeInfo.points[j])));
639 totalExtents.addPoint(transformedPoint + radius);636 }
640 totalExtents.addPoint(transformedPoint - radius);
641 }637 }
642 // HACK so that default legless robot doesn't knuckle-drag638 // HACK so that default legless robot doesn't knuckle-drag
643 if (shapeInfo.points.size() == 0 && (state.getName() == "LeftFoot" || state.getName() == "RightFoot")) {639 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