Merge pull request #3265 from AndrewMeadows/ragdoll

fix for extraneous joints in avatar ragdoll
This commit is contained in:
Brad Hefta-Gaub 2014-08-08 09:00:35 -07:00
commit e882e08579

View file

@ -685,6 +685,9 @@ void SkeletonModel::buildShapes() {
// this shape is forced to be a sphere
type = Shape::SPHERE_SHAPE;
}
if (radius < EPSILON) {
type = Shape::UNKNOWN_SHAPE;
}
Shape* shape = NULL;
int parentIndex = joint.parentIndex;
if (type == Shape::SPHERE_SHAPE) {
@ -699,7 +702,9 @@ void SkeletonModel::buildShapes() {
}
if (parentIndex != -1) {
// always disable collisions between joint and its parent
disableCollisions(i, parentIndex);
if (shape) {
disableCollisions(i, parentIndex);
}
} else {
// give the base joint a very large mass since it doesn't actually move
// in the local-frame simulation (it defines the origin)