Class PhysicsCollider

Inheritance Relationships

Derived Type

Class Documentation

class legion::physics::PhysicsCollider

Subclassed by legion::physics::ConvexCollider

Public Functions

inline PhysicsCollider()
virtual void AddConverganceIdentifier(const physics_contact &contact) = 0
inline void AttemptFindAndCopyConverganceID(physics_contact &contact)
inline virtual void CheckCollision(PhysicsCollider *physicsCollider, physics_manifold &manifold)

given a PhysicsCollider, CheckCollision calls “CheckCollisionWith”. Both colliders are then passed through to the correct “CheckCollisionWith” function with double dispatch.

Parameters
  • physicsCollider: The collider we would like to check collision against

  • [in/out]: manifold A physics_manifold that holds information about the collision

inline virtual void CheckCollisionWith(ConvexCollider *convexCollider, physics_manifold &manifold)

given a convexCollider checks if this collider collides the convexCollider. The information the information is then passed to the manifold.

inline int GetColliderID() const

Gets the unique id of this collider.

inline virtual void PopulateContactPoints(PhysicsCollider *physicsCollider, physics_manifold &manifold)

given a PhysicsCollider, PopulateContactPoints calls PopulateContactPointsWith. Both colliders are then passed through to the corrent FillManifoldWith function with double dispatch.

inline virtual void PopulateContactPointsWith(ConvexCollider *convexCollider, physics_manifold &manifold)

Creates the contact points between this physics collider and the given ConvexCollider and stores them in the manifold.

inline virtual void DrawColliderRepresentation(const math::mat4 &transform, math::color usedColor, float width, float time, bool ignoreDepth = false)

Given the transform of the entity that the collider is attached to, draws a visual representation of the collider.

Note

This is called internally by PhysicsSysten

inline virtual void UpdateTransformedTightBoundingVolume(const math::mat4 &transform)
inline virtual void UpdateLocalAABB()
inline virtual std::vector<HalfEdgeFace*> &GetHalfEdgeFaces()
inline math::vec3 GetLocalCentroid() const noexcept
inline std::pair<math::vec3, math::vec3> GetMinMaxLocalAABB() const
inline std::pair<math::vec3, math::vec3> GetMinMaxWorldAABB() const

Public Members

bool shouldBeDrawn = true
std::vector<std::unique_ptr<ConverganceIdentifier>> converganceIdentifiers

Protected Attributes

math::vec3 localColliderCentroid = math::vec3(0, 0, 0)
std::pair<math::vec3, math::vec3> minMaxLocalAABB
std::pair<math::vec3, math::vec3> minMaxWorldAABB