Remove a Skeleton and get rid of the constraint that was associated with it, if one existed
| 289 | /// Remove a Skeleton and get rid of the constraint that was associated with |
| 290 | /// it, if one existed |
| 291 | void removeSkeleton(const SkeletonPtr& skel) |
| 292 | { |
| 293 | for (std::size_t i = 0; i < mJointConstraints.size(); ++i) { |
| 294 | const dart::constraint::DynamicJointConstraintPtr& constraint |
| 295 | = mJointConstraints[i]; |
| 296 | |
| 297 | if (constraint->getBodyNode1()->getSkeleton() == skel |
| 298 | || constraint->getBodyNode2()->getSkeleton() == skel) { |
| 299 | mWorld->getConstraintSolver()->removeConstraint(constraint); |
| 300 | mJointConstraints.erase(mJointConstraints.begin() + i); |
| 301 | break; // There should only be one constraint per skeleton |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | mWorld->removeSkeleton(skel); |
| 306 | } |
| 307 | |
| 308 | /// Flag to keep track of whether or not we are randomizing the tosses |
| 309 | bool mRandomize; |
nothing calls this directly
no test coverage detected