MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / Init_ClothAttach

Function Init_ClothAttach

examples/SoftDemo/SoftDemo.cpp:531–550  ·  view source on GitHub ↗

Cloth attach

Source from the content-addressed store, hash-verified

529// Cloth attach
530//
531static void Init_ClothAttach(SoftDemo* pdemo)
532{
533 //TRACEDEMO
534 const btScalar s = 4;
535 const btScalar h = 6;
536 const int r = 9;
537 btSoftBody* psb = btSoftBodyHelpers::CreatePatch(pdemo->m_softBodyWorldInfo, btVector3(-s, h, -s),
538 btVector3(+s, h, -s),
539 btVector3(-s, h, +s),
540 btVector3(+s, h, +s), r, r, 4 + 8, true);
541 pdemo->getSoftDynamicsWorld()->addSoftBody(psb);
542
543 btTransform startTransform;
544 startTransform.setIdentity();
545 startTransform.setOrigin(btVector3(0, h, -(s + 3.5)));
546 btRigidBody* body = pdemo->createRigidBody(20, startTransform, new btBoxShape(btVector3(s, 1, 3)));
547 psb->appendAnchor(0, body);
548 psb->appendAnchor(r - 1, body);
549 pdemo->m_cutting = true;
550}
551
552//
553// Impact

Callers

nothing calls this directly

Calls 6

appendAnchorMethod · 0.80
btVector3Class · 0.50
addSoftBodyMethod · 0.45
getSoftDynamicsWorldMethod · 0.45
setIdentityMethod · 0.45
createRigidBodyMethod · 0.45

Tested by

no test coverage detected