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

Method removeSkeleton

tutorials/tutorial_collisions/main.cpp:229–244  ·  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

227 /// Remove a Skeleton and get rid of the constraint that was associated with
228 /// it, if one existed
229 void removeSkeleton(const SkeletonPtr& skel)
230 {
231 for (std::size_t i = 0; i < mJointConstraints.size(); ++i) {
232 const dart::constraint::DynamicJointConstraintPtr& constraint
233 = mJointConstraints[i];
234
235 if (constraint->getBodyNode1()->getSkeleton() == skel
236 || constraint->getBodyNode2()->getSkeleton() == skel) {
237 mWorld->getConstraintSolver()->removeConstraint(constraint);
238 mJointConstraints.erase(mJointConstraints.begin() + i);
239 break; // There should only be one constraint per skeleton
240 }
241 }
242
243 mWorld->removeSkeleton(skel);
244 }
245
246 /// Flag to keep track of whether or not we are randomizing the tosses
247 bool mRandomize;

Callers 4

TEST_PFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
deleteLastDominoMethod · 0.45

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 3

TEST_PFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36