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

Function Ctor_SoftBox

examples/SoftDemo/SoftDemo.cpp:443–459  ·  view source on GitHub ↗

Softbox

Source from the content-addressed store, hash-verified

441// Softbox
442//
443static btSoftBody* Ctor_SoftBox(SoftDemo* pdemo, const btVector3& p, const btVector3& s)
444{
445 const btVector3 h = s * 0.5;
446 const btVector3 c[] = {p + h * btVector3(-1, -1, -1),
447 p + h * btVector3(+1, -1, -1),
448 p + h * btVector3(-1, +1, -1),
449 p + h * btVector3(+1, +1, -1),
450 p + h * btVector3(-1, -1, +1),
451 p + h * btVector3(+1, -1, +1),
452 p + h * btVector3(-1, +1, +1),
453 p + h * btVector3(+1, +1, +1)};
454 btSoftBody* psb = btSoftBodyHelpers::CreateFromConvexHull(pdemo->m_softBodyWorldInfo, c, 8);
455 psb->generateBendingConstraints(2);
456 pdemo->getSoftDynamicsWorld()->addSoftBody(psb);
457
458 return (psb);
459}
460
461//
462// SoftBoulder

Callers 1

Init_FrictionFunction · 0.85

Calls 4

btVector3Class · 0.50
addSoftBodyMethod · 0.45
getSoftDynamicsWorldMethod · 0.45

Tested by

no test coverage detected