Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Physics::Component::BoxCollider Struct Reference

#include <BoxCollider.hpp>

Public Member Functions

 BoxCollider ()=default
 Default constructor (1x1x1 box).
 BoxCollider (const glm::vec3 &extents)
 Construct with half-extents.
 BoxCollider (const glm::vec3 &extents, const glm::vec3 &localOffset)
 Construct with half-extents and offset.
glm::vec3 GetSize () const
 Get full dimensions of the box.
void SetSize (const glm::vec3 &size)
 Set size directly (converts to half-extents).

Public Attributes

glm::vec3 halfExtents {0.5f, 0.5f, 0.5f}
 Half-extents of the box (size / 2).
glm::vec3 offset {0.0f, 0.0f, 0.0f}
 Local offset from entity transform.
float convexRadius = 0.05f
 Convex radius for collision detection (smaller = sharper corners).

Detailed Description

Constructor & Destructor Documentation

◆ BoxCollider() [1/3]

Physics::Component::BoxCollider::BoxCollider ( )
default

Default constructor (1x1x1 box).

◆ BoxCollider() [2/3]

Physics::Component::BoxCollider::BoxCollider ( const glm::vec3 & extents)
inlineexplicit

Construct with half-extents.

Parameters
extentsHalf the size in each dimension

◆ BoxCollider() [3/3]

Physics::Component::BoxCollider::BoxCollider ( const glm::vec3 & extents,
const glm::vec3 & localOffset )
inline

Construct with half-extents and offset.

Parameters
extentsHalf the size in each dimension
localOffsetLocal position offset

Member Function Documentation

◆ GetSize()

glm::vec3 Physics::Component::BoxCollider::GetSize ( ) const
inlinenodiscard

Get full dimensions of the box.

◆ SetSize()

void Physics::Component::BoxCollider::SetSize ( const glm::vec3 & size)
inline

Set size directly (converts to half-extents).

Parameters
sizeFull size in each dimension

Member Data Documentation

◆ convexRadius

float Physics::Component::BoxCollider::convexRadius = 0.05f

Convex radius for collision detection (smaller = sharper corners).

◆ halfExtents

glm::vec3 Physics::Component::BoxCollider::halfExtents {0.5f, 0.5f, 0.5f}

Half-extents of the box (size / 2).

Examples
Basic usage for a 1x2x1 box.

◆ offset

glm::vec3 Physics::Component::BoxCollider::offset {0.0f, 0.0f, 0.0f}

Local offset from entity transform.


The documentation for this struct was generated from the following file: