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

Method makeRigidBody

src/physics/PhysicsSystem.cpp:485–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483}
484
485Handle::PhysicsObjectHandle
486PhysicsSystem::makeRigidBody(Handle::CollisionShapeHandle shape, const Math::Matrix& transform, float mass)
487{
488 Handle::PhysicsObjectHandle ph = m_PhysicsObjectAllocator.createObject();
489 PhysicsObject& p = getPhysicsObject(ph);
490 CollisionShape& s = getCollisionShape(shape);
491
492 p.collisionShape = shape;
493 p.rigidBody = new btRigidBody(mass, nullptr, s.collisionShape); // TODO: Implement motionstate and inertia
494
495 // Add to physics-world
496 m_pDynamicsWorld->addRigidBody(p.rigidBody);
497
498 return Handle::PhysicsObjectHandle();
499}
500
501void PhysicsSystem::compoundShapeAddChild(Handle::CollisionShapeHandle target, Handle::CollisionShapeHandle childShape, const Math::Matrix& localTransform)
502{

Callers 1

initMethod · 0.80

Calls 2

addRigidBodyMethod · 0.80
createObjectMethod · 0.45

Tested by

no test coverage detected