| 199 | } |
| 200 | |
| 201 | Handle::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 | |
| 222 | void PhysicsSystem::deleteCollisionShape(Handle::CollisionShapeHandle shape) |
| 223 | { |
no test coverage detected