MCPcopy Create free account
hub / github.com/axmolengine/axmol / collisionBeginCallbackFunc

Method collisionBeginCallbackFunc

core/physics/PhysicsWorld.cpp:114–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112bool PhysicsWorldCallback::continues = true;
113
114cpBool PhysicsWorldCallback::collisionBeginCallbackFunc(cpArbiter* arb, struct cpSpace* /*space*/, PhysicsWorld* world)
115{
116 CP_ARBITER_GET_SHAPES(arb, a, b);
117
118 PhysicsShape* shapeA = static_cast<PhysicsShape*>(cpShapeGetUserData(a));
119 PhysicsShape* shapeB = static_cast<PhysicsShape*>(cpShapeGetUserData(b));
120 AX_ASSERT(shapeA != nullptr && shapeB != nullptr);
121
122 auto contact = PhysicsContact::construct(shapeA, shapeB);
123 cpArbiterSetUserData(arb, contact);
124 contact->_contactInfo = arb;
125
126 return world->collisionBeginCallback(*contact);
127}
128
129cpBool PhysicsWorldCallback::collisionPreSolveCallbackFunc(cpArbiter* arb, cpSpace* /*space*/, PhysicsWorld* world)
130{

Callers

nothing calls this directly

Calls 4

cpShapeGetUserDataFunction · 0.85
cpArbiterSetUserDataFunction · 0.85
constructFunction · 0.50

Tested by

no test coverage detected