The physics system is divided as follows:
PhysicManager: Manages the collisionManager, collisionResolver and Rigidbodies.
collisionManager: Detection of collisions and line traces
collisionResolver: Resolution of collisions and trigger collisions
void RegisterCollider(Actor* pOwner, ColliderComponent* pCollider);
Used to register a ColliderComponent in mColliders.
By default, when you create a new ColliderComponent, it is automatically added to mColliders - CollisionManager.
void RemoveCollider(Actor* pOwner, ColliderComponent* pCollider);
Removes a ColliderComponent from mColliders.
void RegisterRigidBody(Actor* pOwner, RigidbodyComponent* pRigidbody);
Registers a RigidbodyComponent in mRigidbodies.
By default, when you create a new RigidbodyComponent, it is automatically added to mRigidbodies - CollisionResolver.
void RemoveRigidBody(Actor* pOwner, RigidbodyComponent* pRigidbody);
Removes RigidbodyComponent from mRigidbodies.
bool LineTrace(const Vector3D& start, const Vector3D& end, HitResult& outHit, Actor* ignoreActor);
This function determines whether there has been a collision between a line and an OBB box, using the Slab method. It takes as parameters the start of the line, the end of the line, a HitResult structure and an Actor to ignore.
⚠️ This function returns only the first object encountered by the line. A more complete version is currently under development.