MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / addCollider

Method addCollider

src/systems/BroadPhaseSystem.cpp:84–97  ·  view source on GitHub ↗

Add a collider into the broad-phase collision detection

Source from the content-addressed store, hash-verified

82
83// Add a collider into the broad-phase collision detection
84void BroadPhaseSystem::addCollider(Collider* collider, const AABB& aabb) {
85
86 assert(collider->getBroadPhaseId() == -1);
87
88 // Add the collision shape into the dynamic AABB tree and get its broad-phase ID
89 int nodeId = mDynamicAABBTree.addObject(aabb, collider);
90
91 // Set the broad-phase ID of the collider
92 mCollidersComponents.setBroadPhaseId(collider->getEntity(), nodeId);
93
94 // Add the collision shape into the array of bodies that have moved (or have been created)
95 // during the last simulation step
96 addMovedCollider(collider->getBroadPhaseId(), collider);
97}
98
99// Remove a collider from the broad-phase collision detection
100void BroadPhaseSystem::removeCollider(Collider* collider) {

Callers

nothing calls this directly

Calls 4

addObjectMethod · 0.80
setBroadPhaseIdMethod · 0.80
getBroadPhaseIdMethod · 0.45
getEntityMethod · 0.45

Tested by

no test coverage detected