| 120 | } |
| 121 | |
| 122 | void Physics::destroyGhostObject() { |
| 123 | if (!m_ghostObject) return; |
| 124 | // Remove From World: |
| 125 | dynamicsWorld->removeCollisionObject(m_ghostObject); |
| 126 | // Delete Collision Shapes: |
| 127 | { |
| 128 | btCollisionShape *mainShape = m_ghostObject->getCollisionShape(); |
| 129 | delete mainShape; |
| 130 | mainShape = NULL; |
| 131 | } |
| 132 | // Delete Ghost Object: |
| 133 | delete m_ghostObject; |
| 134 | m_ghostObject = NULL; |
| 135 | } |
| 136 | |
| 137 | void Physics::buildGhostObject() { |
| 138 | btCollisionShape *shape = buildFrustumShape(); |