MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / buildGhostObject

Method buildGhostObject

src/Physics/Physics.cpp:137–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137void 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
152void Physics::updateFrustrum(glm::mat4 viewMatrix) {
153 if (m_ghostObject) m_ghostObject->setWorldTransform(Utils::glmToBullet(viewMatrix).inverse());

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected