Antkeeper  0.0.1
Public Types | Public Member Functions | List of all members
physics::sphere_collider Class Reference

Sphere collision object. More...

#include <sphere-collider.hpp>

Inheritance diagram for physics::sphere_collider:
physics::collider

Public Types

using sphere_type = geom::sphere< float >
 Sphere type. More...
 

Public Member Functions

constexpr collider_type type () const noexcept override
 Returns the collider type. More...
 
constexpr sphere_collider (const sphere_type &sphere) noexcept
 Constructs a sphere collider from a sphere. More...
 
constexpr void set_sphere (const sphere_type &sphere) noexcept
 Sets the collider's sphere. More...
 
constexpr void set_center (const math::fvec3 &center) noexcept
 Sets the center of the sphere. More...
 
constexpr void set_radius (float radius) noexcept
 Sets the radius of the sphere. More...
 
constexpr const sphere_typeget_sphere () const noexcept
 Returns the sphere shape. More...
 
constexpr const math::fvec3get_center () const noexcept
 Returns the center of the sphere, in object space. More...
 
constexpr float get_radius () const noexcept
 Returns the radius of the sphere. More...
 
constexpr sphere_collider (const math::fvec3 &center, float radius) noexcept
 Constructs a sphere collider. More...
 
constexpr sphere_collider (float radius) noexcept
 Constructs a sphere collider. More...
 
constexpr sphere_collider () noexcept=default
 Constructs a sphere collider. More...
 
- Public Member Functions inherited from physics::collider
constexpr void set_layer_mask (std::uint32_t mask) noexcept
 Sets the layer mask of the collider. More...
 
void set_material (std::shared_ptr< collider_material > material) noexcept
 Sets the collider material. More...
 
constexpr std::uint32_t get_layer_mask () const noexcept
 Returns the layer mask of the collider. More...
 
constexpr const std::shared_ptr< collider_material > & get_material () const noexcept
 Returns the collider material. More...
 

Detailed Description

Sphere collision object.

Definition at line 31 of file sphere-collider.hpp.

Member Typedef Documentation

◆ sphere_type

Sphere type.

Definition at line 35 of file sphere-collider.hpp.

Constructor & Destructor Documentation

◆ sphere_collider() [1/4]

constexpr physics::sphere_collider::sphere_collider ( const sphere_type sphere)
inlineexplicitconstexprnoexcept

Constructs a sphere collider from a sphere.

Parameters
sphereSphere shape.

Definition at line 47 of file sphere-collider.hpp.

◆ sphere_collider() [2/4]

constexpr physics::sphere_collider::sphere_collider ( const math::fvec3 center,
float  radius 
)
inlineconstexprnoexcept

Constructs a sphere collider.

Parameters
centerSphere center.
radiusSphere radius.

Definition at line 58 of file sphere-collider.hpp.

◆ sphere_collider() [3/4]

constexpr physics::sphere_collider::sphere_collider ( float  radius)
inlineexplicitconstexprnoexcept

Constructs a sphere collider.

Parameters
centerSphere center.
radiusSphere radius.

Definition at line 61 of file sphere-collider.hpp.

◆ sphere_collider() [4/4]

constexpr physics::sphere_collider::sphere_collider ( )
constexprdefaultnoexcept

Constructs a sphere collider.

Parameters
centerSphere center.
radiusSphere radius.

Member Function Documentation

◆ get_center()

constexpr const math::fvec3& physics::sphere_collider::get_center ( ) const
inlineconstexprnoexcept

Returns the center of the sphere, in object space.

Definition at line 104 of file sphere-collider.hpp.

◆ get_radius()

constexpr float physics::sphere_collider::get_radius ( ) const
inlineconstexprnoexcept

Returns the radius of the sphere.

Definition at line 110 of file sphere-collider.hpp.

◆ get_sphere()

constexpr const sphere_type& physics::sphere_collider::get_sphere ( ) const
inlineconstexprnoexcept

Returns the sphere shape.

Definition at line 98 of file sphere-collider.hpp.

◆ set_center()

constexpr void physics::sphere_collider::set_center ( const math::fvec3 center)
inlineconstexprnoexcept

Sets the center of the sphere.

Parameters
centerSphere center, in object space.

Definition at line 82 of file sphere-collider.hpp.

◆ set_radius()

constexpr void physics::sphere_collider::set_radius ( float  radius)
inlineconstexprnoexcept

Sets the radius of the sphere.

Parameters
radiusSphere radius.

Definition at line 92 of file sphere-collider.hpp.

◆ set_sphere()

constexpr void physics::sphere_collider::set_sphere ( const sphere_type sphere)
inlineconstexprnoexcept

Sets the collider's sphere.

Parameters
sphereSphere shape.

Definition at line 72 of file sphere-collider.hpp.

◆ type()

constexpr collider_type physics::sphere_collider::type ( ) const
inlineconstexproverridevirtualnoexcept

Returns the collider type.

Implements physics::collider.

Definition at line 37 of file sphere-collider.hpp.


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