| 70 | }; |
| 71 | |
| 72 | void SimpleClothExample::initPhysics() |
| 73 | { |
| 74 | m_guiHelper->setUpAxis(1); |
| 75 | |
| 76 | createEmptyDynamicsWorld(); |
| 77 | |
| 78 | m_guiHelper->createPhysicsDebugDrawer(m_dynamicsWorld); |
| 79 | |
| 80 | if (m_dynamicsWorld->getDebugDrawer()) |
| 81 | m_dynamicsWorld->getDebugDrawer()->setDebugMode(btIDebugDraw::DBG_DrawWireframe + btIDebugDraw::DBG_DrawContactPoints); |
| 82 | |
| 83 | ///create a few basic rigid bodies |
| 84 | btBoxShape* groundShape = createBoxShape(btVector3(btScalar(50.), btScalar(50.), btScalar(50.))); |
| 85 | m_collisionShapes.push_back(groundShape); |
| 86 | |
| 87 | btTransform groundTransform; |
| 88 | groundTransform.setIdentity(); |
| 89 | groundTransform.setOrigin(btVector3(0, -50, 0)); |
| 90 | { |
| 91 | btScalar mass(0.); |
| 92 | createRigidBody(mass, groundTransform, groundShape, btVector4(0, 0, 1, 1)); |
| 93 | } |
| 94 | |
| 95 | { |
| 96 | const btScalar s = 4; //size of cloth patch |
| 97 | const int NUM_X = 31; //vertices on X axis |
| 98 | const int NUM_Z = 31; //vertices on Z axis |
| 99 | createSoftBody(s, NUM_X, NUM_Z); |
| 100 | } |
| 101 | |
| 102 | m_guiHelper->autogenerateGraphicsObjects(m_dynamicsWorld); |
| 103 | } |
| 104 | |
| 105 | void SimpleClothExample::createSoftBody(const btScalar s, |
| 106 | const int numX, |
nothing calls this directly
no test coverage detected