| 103 | } |
| 104 | |
| 105 | void SimpleClothExample::createSoftBody(const btScalar s, |
| 106 | const int numX, |
| 107 | const int numY, |
| 108 | const int fixed) |
| 109 | { |
| 110 | btSoftBody* cloth = btSoftBodyHelpers::CreatePatch(softBodyWorldInfo, |
| 111 | btVector3(-s / 2, s + 1, 0), |
| 112 | btVector3(+s / 2, s + 1, 0), |
| 113 | btVector3(-s / 2, s + 1, +s), |
| 114 | btVector3(+s / 2, s + 1, +s), |
| 115 | numX, numY, |
| 116 | fixed, true); |
| 117 | |
| 118 | cloth->getCollisionShape()->setMargin(0.001f); |
| 119 | cloth->getCollisionShape()->setUserPointer((void*)cloth); |
| 120 | cloth->generateBendingConstraints(2, cloth->appendMaterial()); |
| 121 | cloth->setTotalMass(10); |
| 122 | //cloth->m_cfg.citerations = 10; |
| 123 | // cloth->m_cfg.diterations = 10; |
| 124 | cloth->m_cfg.piterations = 5; |
| 125 | cloth->m_cfg.kDP = 0.005f; |
| 126 | getSoftDynamicsWorld()->addSoftBody(cloth); |
| 127 | } |
| 128 | |
| 129 | void SimpleClothExample::renderScene() |
| 130 | { |
nothing calls this directly
no test coverage detected