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

Function Init_ClusterCollide1

examples/SoftDemo/SoftDemo.cpp:1181–1212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1179
1180//
1181static void Init_ClusterCollide1(SoftDemo* pdemo)
1182{
1183 const btScalar s = 8;
1184 btSoftBody* psb = btSoftBodyHelpers::CreatePatch(pdemo->m_softBodyWorldInfo, btVector3(-s, 0, -s),
1185 btVector3(+s, 0, -s),
1186 btVector3(-s, 0, +s),
1187 btVector3(+s, 0, +s),
1188 17, 17, //9,9,//31,31,
1189 1 + 2 + 4 + 8,
1190 true);
1191 btSoftBody::Material* pm = psb->appendMaterial();
1192 pm->m_kLST = 0.4;
1193 pm->m_flags -= btSoftBody::fMaterial::DebugDraw;
1194 psb->m_cfg.kDF = 1;
1195 psb->m_cfg.kSRHR_CL = 1;
1196 psb->m_cfg.kSR_SPLT_CL = 0;
1197 psb->m_cfg.collisions = btSoftBody::fCollision::CL_SS +
1198
1199 btSoftBody::fCollision::CL_RS;
1200 psb->generateBendingConstraints(2, pm);
1201
1202 psb->getCollisionShape()->setMargin(0.05);
1203 psb->setTotalMass(50);
1204
1205 ///pass zero in generateClusters to create cluster for each tetrahedron or triangle
1206 psb->generateClusters(0);
1207 //psb->generateClusters(64);
1208
1209 pdemo->getSoftDynamicsWorld()->addSoftBody(psb);
1210
1211 Ctor_RbUpStack(pdemo, 10);
1212}
1213
1214//
1215static void Init_ClusterCollide2(SoftDemo* pdemo)

Callers

nothing calls this directly

Calls 10

Ctor_RbUpStackFunction · 0.85
appendMaterialMethod · 0.80
generateClustersMethod · 0.80
btVector3Class · 0.50
setMarginMethod · 0.45
getCollisionShapeMethod · 0.45
setTotalMassMethod · 0.45
addSoftBodyMethod · 0.45
getSoftDynamicsWorldMethod · 0.45

Tested by

no test coverage detected