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

Default collider using mesh bounds. More...

#include <DefaultCollider.hpp>

Public Member Functions

 DefaultCollider ()=default
 Default constructor (1x1x1 box).
 DefaultCollider (const glm::vec3 &extents)
 Construct with half-extents.
 DefaultCollider (const glm::vec3 &extents, const glm::vec3 &localOffset)
 Construct with half-extents and offset.
glm::vec3 GetSize () const
 Get full dimensions of the box.

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.

Detailed Description

Default collider using mesh bounds.

This collider is automatically created if:

The box dimensions are calculated from the mesh bounds.

Note
Auto-managed by RigidBodySystem

Constructor & Destructor Documentation

◆ DefaultCollider() [1/3]

Physics::Component::DefaultCollider::DefaultCollider ( )
default

Default constructor (1x1x1 box).

◆ DefaultCollider() [2/3]

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

Construct with half-extents.

Parameters
extentsHalf the size in each dimension

◆ DefaultCollider() [3/3]

Physics::Component::DefaultCollider::DefaultCollider ( 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::DefaultCollider::GetSize ( ) const
inlinenodiscard

Get full dimensions of the box.

Member Data Documentation

◆ halfExtents

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

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

◆ offset

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

Local offset from entity transform.


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