| 160 | } |
| 161 | |
| 162 | void Pendulum::stepSimulation(float deltaTime) |
| 163 | { |
| 164 | m_multiBody->addJointTorque(0, 20.0); |
| 165 | #ifdef USE_GTEST |
| 166 | m_dynamicsWorld->stepSimulation(1. / 1000.0, 0); |
| 167 | #else |
| 168 | m_dynamicsWorld->stepSimulation(deltaTime); |
| 169 | #endif |
| 170 | btVector3 from = m_multiBody->getBaseWorldTransform().getOrigin(); |
| 171 | btVector3 to = m_multiBody->getLink(0).m_collider->getWorldTransform().getOrigin(); |
| 172 | btVector4 color(1, 0, 0, 1); |
| 173 | if (m_guiHelper->getRenderInterface()) |
| 174 | { |
| 175 | m_guiHelper->getRenderInterface()->drawLine(from, to, color, btScalar(1)); |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | #ifdef USE_GTEST |
| 180 | |