Objects::Components::Collider

Colliders in Unified Engine

Colliders in the Unified Engine serve as fundamental components for detecting collisions between objects. The engine provides different types of colliders, catering to various shapes and forms.

Collider Enumeration

A set of enumerations representing the types of colliders available in the engine.

enum ColliderType{
    COLLIDER_BOX = 1,
    COLLIDER_SPHERE,
    COLLIDER_MESH
};

Base Collider Class

The foundational class from which all collider types derive. It provides the basic attributes and functionalities common to all colliders.

class Collider : public ObjectComponent{
    public:
        glm::vec3 Offset = glm::vec3(0.0f);
};

Box Collider

The BoxCollider class specializes in axis-aligned bounding box (AABB) collision detection. It carries information about the size of the bounding box.

class BoxCollider : public Collider{
    public:
        glm::vec3 Size = glm::vec3(0.0f);
};

Spherical Collider

The SphericalCollider class specializes in spherical collision detection, utilizing the radius of the sphere to determine collisions.

class SphericalCollider : public Collider{
    public:
        float Radius = 0.0f;
};

Mesh Collider

The MeshCollider class is designed for mesh-based collision detection. It incorporates the structure of a given mesh to ascertain collisions.

class MeshCollider : public Collider{
    public:
        Mesh mesh = {};
};

Last updated