| 135 | } |
| 136 | |
| 137 | void Physics::buildGhostObject() { |
| 138 | btCollisionShape *shape = buildFrustumShape(); |
| 139 | destroyGhostObject(); |
| 140 | |
| 141 | if (!m_ghostPairCallback) { |
| 142 | m_ghostPairCallback = new btGhostPairCallback(); |
| 143 | dynamicsWorld->getBroadphase()->getOverlappingPairCache()->setInternalGhostPairCallback(m_ghostPairCallback); |
| 144 | } |
| 145 | |
| 146 | m_ghostObject = new btPairCachingGhostObject(); |
| 147 | m_ghostObject->setCollisionShape(shape); |
| 148 | m_ghostObject->setCollisionFlags(btCollisionObject::CF_NO_CONTACT_RESPONSE); |
| 149 | dynamicsWorld->addCollisionObject(m_ghostObject, btBroadphaseProxy::AllFilter, btBroadphaseProxy::StaticFilter); |
| 150 | } |
| 151 | |
| 152 | void Physics::updateFrustrum(glm::mat4 viewMatrix) { |
| 153 | if (m_ghostObject) m_ghostObject->setWorldTransform(Utils::glmToBullet(viewMatrix).inverse()); |
nothing calls this directly
no outgoing calls
no test coverage detected