Rubeus::Awerere::APlaneCollider class

A 2D plane collider, equivalent to a straight line on a 2D screen.

Base classes

class ACollider
A simple collider. Used to resolve collisions.

Constructors, destructors, conversion operators

APlaneCollider(const RML::Vector2D& normal, RML::Vector2D& emergencePoint)
Contructor.
~APlaneCollider()
Destructor.

Public functions

void selfUpdate(float deltaX, float deltaY) override
Update the emergencePoint with the parameters passed in.
auto tryIntersect(APlaneCollider& plane) -> ACollideData override
Generate collision data with a plane collider.
auto tryIntersect(ASphereCollider& sphere) -> ACollideData override
Generate collision data with a sphere collider.
auto tryIntersect(ABoxCollider& box) -> ACollideData override
Generate collision data with a box collider.
auto normalised(const RML::Vector3D& vector) const -> RML::Vector3D
Normalise a vector by converting it into a unit vector.
auto getNormal() const -> RML::Vector2D
Returns the normal of this plane.
auto getEmergencePoint() const -> RML::Vector2D
Returns a fixed point on the plane.

Function documentation

Rubeus::Awerere::APlaneCollider::APlaneCollider(const RML::Vector2D& normal, RML::Vector2D& emergencePoint)

Contructor.

Parameters
normal The normal vector of the 2D plane.
emergencePoint The fixed point through which the plane is defined.

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

Update the emergencePoint with the parameters passed in.

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

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

Generate collision data with a plane collider.

Parameters
plane The plane collider to check collision with.
Returns Collision data.

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

Generate collision data with a sphere collider.

Parameters
sphere The sphere collider to check collision with.
Returns Collision data.

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

Generate collision data with a box collider.

Parameters
box The box collider to check collision with.
Returns Collision data.

RML::Vector3D Rubeus::Awerere::APlaneCollider::normalised(const RML::Vector3D& vector) const

Normalise a vector by converting it into a unit vector.

Parameters
vector The vector to normalise.
Returns The normalised vector.

RML::Vector2D Rubeus::Awerere::APlaneCollider::getNormal() const

Returns the normal of this plane.

Returns The vector 2D normal.

RML::Vector2D Rubeus::Awerere::APlaneCollider::getEmergencePoint() const

Returns a fixed point on the plane.

Returns Position vector of the emergence point.