MCPcopy Create free account
hub / github.com/dartsim/dart / removeSkeleton

Method removeSkeleton

tutorials/tutorial_collisions_finished/main.cpp:291–306  ·  view source on GitHub ↗

Remove a Skeleton and get rid of the constraint that was associated with it, if one existed

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 7

getBodyNode1Method · 0.80
getBodyNode2Method · 0.80
getConstraintSolverMethod · 0.80
sizeMethod · 0.45
getSkeletonMethod · 0.45
removeConstraintMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected