void CRigidbody::triggerOnCollisionStay(const CollisionData& data) { // Const-cast and modify is okay because we're the only object receiving this event CollisionData& hit = const_cast<CollisionData&>(data); processCollisionData(hit); onCollisionStay(hit); }
void CCollider::triggerOnCollisionStay(const CollisionData& data) { // Const-cast and modify is okay because we're the only object receiving this event CollisionData& hit = const_cast<CollisionData&>(data); hit.collider[0] = mThisHandle; if (hit.collidersRaw[1] != nullptr) { CCollider* other = (CCollider*)hit.collidersRaw[1]->_getOwner(PhysicsOwnerType::Component); hit.collider[1] = other->getHandle(); } onCollisionStay(hit); }