Rubeus::Awerere::ASphereCollider class

A Sphere Collider for handling spherical collisions.

Base classes

class ACollider
A simple collider. Used to resolve collisions.

Constructors, destructors, conversion operators

ASphereCollider(RML::Vector2D& center, const float radius)
Contructor.

Public functions

void selfUpdate(float deltaX, float deltaY) override
Update the center with the parameters passed in.
auto tryIntersect(ASphereCollider& other) -> ACollideData override
Generate collision data with a sphere collider.
auto tryIntersect(APlaneCollider& plane) -> ACollideData override
Query collision status with another plane type collider.
auto tryIntersect(ABoxCollider& box) -> ACollideData override
Generate collision data with a box collider.
auto getCenter() const -> const RML::Vector2D&
Returns the center of the sphere collider.
auto getRadius() const -> const float&
Returns the radius of the sphere collider.

Function documentation

Rubeus::Awerere::ASphereCollider::ASphereCollider(RML::Vector2D& center, const float radius)

Contructor.

Parameters
center Center of the sphere.
radius Radius of the sphere.

void Rubeus::Awerere::ASphereCollider::selfUpdate(float deltaX, float deltaY) override

Update the center with the parameters passed in.

Parameters
deltaX The change in X position.
deltaY The change in Y position.

ACollideData Rubeus::Awerere::ASphereCollider::tryIntersect(ASphereCollider& other) override

Generate collision data with a sphere collider.

Parameters
other The other sphere collider.
Returns Collision data.

ACollideData Rubeus::Awerere::ASphereCollider::tryIntersect(APlaneCollider& plane) override

Query collision status with another plane type collider.

Parameters
plane The plane collider this collider is being queried with.
Returns Collision data.

ACollideData Rubeus::Awerere::ASphereCollider::tryIntersect(ABoxCollider& box) override

Generate collision data with a box collider.

Parameters
box The box collider.
Returns Collision data.

const RML::Vector2D& Rubeus::Awerere::ASphereCollider::getCenter() const

Returns the center of the sphere collider.

Returns Center of the sphere.

const float& Rubeus::Awerere::ASphereCollider::getRadius() const

Returns the radius of the sphere collider.

Returns Radius of the sphere.