SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Sleak::Physics::BoundingCapsule Struct Reference

#include <Colliders.hpp>

Public Member Functions

 BoundingCapsule ()
 BoundingCapsule (const Vector3D &center, float radius, float halfHeight, int axis=1)
Vector3D GetPointA () const
 World position of the capsule's positive-axis cap center.
Vector3D GetPointB () const
 World position of the capsule's negative-axis cap center.
AABB ToAABB () const

Static Public Member Functions

static BoundingCapsule FromAABB (const AABB &aabb)
 Fits a capsule inside the AABB, picking its longest axis as the capsule axis.

Public Attributes

int axis
Vector3D center
float halfHeight
float radius

Detailed Description

Cylinder-plus-hemispherical-caps shape, commonly used for character controllers.

Definition at line 133 of file Colliders.hpp.

Constructor & Destructor Documentation

◆ BoundingCapsule() [1/2]

Sleak::Physics::BoundingCapsule::BoundingCapsule ( )
inline

Definition at line 139 of file Colliders.hpp.

◆ BoundingCapsule() [2/2]

Sleak::Physics::BoundingCapsule::BoundingCapsule ( const Vector3D & center,
float radius,
float halfHeight,
int axis = 1 )
inline

Definition at line 141 of file Colliders.hpp.

Member Function Documentation

◆ FromAABB()

BoundingCapsule Sleak::Physics::BoundingCapsule::FromAABB ( const AABB & aabb)
inlinestatic

Fits a capsule inside the AABB, picking its longest axis as the capsule axis.

Definition at line 179 of file Colliders.hpp.

◆ GetPointA()

Vector3D Sleak::Physics::BoundingCapsule::GetPointA ( ) const
inline

World position of the capsule's positive-axis cap center.

Definition at line 145 of file Colliders.hpp.

◆ GetPointB()

Vector3D Sleak::Physics::BoundingCapsule::GetPointB ( ) const
inline

World position of the capsule's negative-axis cap center.

Definition at line 154 of file Colliders.hpp.

◆ ToAABB()

AABB Sleak::Physics::BoundingCapsule::ToAABB ( ) const
inline

Definition at line 162 of file Colliders.hpp.

Member Data Documentation

◆ axis

int Sleak::Physics::BoundingCapsule::axis

Definition at line 137 of file Colliders.hpp.

◆ center

Vector3D Sleak::Physics::BoundingCapsule::center

Definition at line 134 of file Colliders.hpp.

◆ halfHeight

float Sleak::Physics::BoundingCapsule::halfHeight

Definition at line 136 of file Colliders.hpp.

◆ radius

float Sleak::Physics::BoundingCapsule::radius

Definition at line 135 of file Colliders.hpp.