MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / makeCompoundCollisionShape

Method makeCompoundCollisionShape

src/physics/PhysicsSystem.cpp:201–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201Handle::CollisionShapeHandle PhysicsSystem::makeCompoundCollisionShape(CollisionShape::ECollisionType type, const std::string& name)
202{
203 if (m_ShapeCache.find(name) != m_ShapeCache.end())
204 return m_ShapeCache[name];
205
206 Handle::CollisionShapeHandle csh = m_CollisionShapeAllocator.createObject();
207 CollisionShape& cs = getCollisionShape(csh);
208
209 // TODO: Find out if "dynamicAABBTree" can be set to false for performance?
210 cs.collisionShape = new btCompoundShape();
211 cs.shapeType = CollisionShape::Compound;
212 cs.collisionType = type;
213
214 cs.collisionShape->setUserIndex(csh.index);
215
216 if (!name.empty())
217 m_ShapeCache[name] = csh;
218
219 return csh;
220}
221
222void PhysicsSystem::deleteCollisionShape(Handle::CollisionShapeHandle shape)
223{

Callers 1

initMethod · 0.80

Calls 4

findMethod · 0.80
endMethod · 0.45
createObjectMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected