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

#include <Colliders.hpp>

Public Member Functions

 BoundingSphere ()
 BoundingSphere (const Vector3D &center, float radius)
bool Contains (const Vector3D &point) const
bool Overlaps (const BoundingSphere &other) const
AABB ToAABB () const

Static Public Member Functions

static BoundingSphere FromAABB (const AABB &aabb)
 Builds the sphere circumscribing the given AABB.

Public Attributes

Vector3D center
float radius

Detailed Description

Sphere collider, cheapest shape to test against.

Definition at line 99 of file Colliders.hpp.

Constructor & Destructor Documentation

◆ BoundingSphere() [1/2]

Sleak::Physics::BoundingSphere::BoundingSphere ( )
inline

Definition at line 103 of file Colliders.hpp.

◆ BoundingSphere() [2/2]

Sleak::Physics::BoundingSphere::BoundingSphere ( const Vector3D & center,
float radius )
inline

Definition at line 104 of file Colliders.hpp.

Member Function Documentation

◆ Contains()

bool Sleak::Physics::BoundingSphere::Contains ( const Vector3D & point) const
inline

Definition at line 107 of file Colliders.hpp.

◆ FromAABB()

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

Builds the sphere circumscribing the given AABB.

Definition at line 124 of file Colliders.hpp.

◆ Overlaps()

bool Sleak::Physics::BoundingSphere::Overlaps ( const BoundingSphere & other) const
inline

Definition at line 111 of file Colliders.hpp.

◆ ToAABB()

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

Definition at line 116 of file Colliders.hpp.

Member Data Documentation

◆ center

Vector3D Sleak::Physics::BoundingSphere::center

Definition at line 100 of file Colliders.hpp.

◆ radius

float Sleak::Physics::BoundingSphere::radius

Definition at line 101 of file Colliders.hpp.