Stowy Physics Engine 0.1.0
Loading...
Searching...
No Matches
stw::AabbCollider Class Referencefinal

An Axis Aligned Bounding Box collider. More...

#include <Collider.hpp>

Inheritance diagram for stw::AabbCollider:
Collaboration diagram for stw::AabbCollider:

Public Member Functions

Manifold TestCollision (const Transform *transform, const Collider *collider, const Transform *colliderTransform) const override
 Tests the collision against a generic collider.
 
Manifold TestCollision (const Transform *transform, const BoxCollider *collider, const Transform *boxTransform) const override
 Tests the collision against a box collider.
 
Manifold TestCollision (const Transform *transform, const CircleCollider *collider, const Transform *circleTransform) const override
 Tests the collision against a circle collider.
 
Manifold TestCollision (const Transform *transform, const AabbCollider *collider, const Transform *aabbTransform) const override
 Tests the collision against a aabb collider.
 
Vector2 FindFurthestPoint (const Transform *transform, const Vector2 &direction) const override
 Find the furthest point in the specified direction.
 
Vector2 GetBoundingBoxSize () const override
 Gets the size of the box that surrounds the collider.
 
- Public Member Functions inherited from stw::Collider
 Collider ()=default
 
 Collider (Collider &&col) noexcept=default
 
virtual ~Collider ()=default
 
Collideroperator= (Collider &&col)=default
 
Collideroperator= (const Collider &col)=default
 
 Collider (const Collider &col)=default
 

Public Attributes

float halfWidth = 0
 Half of the width of the box.
 
float halfHeight = 0
 Half of the height of the box.
 
- Public Attributes inherited from stw::Collider
Vector2 center {}
 The center of the collider.
 

Detailed Description

An Axis Aligned Bounding Box collider.

Member Function Documentation

◆ FindFurthestPoint()

Vector2 stw::AabbCollider::FindFurthestPoint ( const Transform * transform,
const Vector2 & direction ) const
overridevirtual

Find the furthest point in the specified direction.

Parameters
transformThe transform of this collider.
directionDirection in which to find the furthest point.
Returns
The furthest point.

Implements stw::Collider.

◆ GetBoundingBoxSize()

Vector2 stw::AabbCollider::GetBoundingBoxSize ( ) const
overridevirtual

Gets the size of the box that surrounds the collider.

Returns
The bounding box of the collider.

Implements stw::Collider.

◆ TestCollision() [1/4]

Manifold stw::AabbCollider::TestCollision ( const Transform * transform,
const AabbCollider * collider,
const Transform * aabbTransform ) const
overridevirtual

Tests the collision against a aabb collider.

Parameters
transformThe transform of this collider.
colliderThe circle collider to collide with.
aabbTransformThe transform of the collider to collide with.
Returns
The manifold of that collision.

Implements stw::Collider.

Here is the call graph for this function:

◆ TestCollision() [2/4]

Manifold stw::AabbCollider::TestCollision ( const Transform * transform,
const BoxCollider * collider,
const Transform * boxTransform ) const
overridevirtual

Tests the collision against a box collider.

Parameters
transformThe transform of this collider.
colliderThe box collider to collide with.
boxTransformThe transform of the collider to collide with.
Returns
The manifold of that collision.

Implements stw::Collider.

Here is the call graph for this function:

◆ TestCollision() [3/4]

Manifold stw::AabbCollider::TestCollision ( const Transform * transform,
const CircleCollider * collider,
const Transform * circleTransform ) const
overridevirtual

Tests the collision against a circle collider.

Parameters
transformThe transform of this collider.
colliderThe circle collider to collide with.
circleTransformThe transform of the collider to collide with.
Returns
The manifold of that collision.

Implements stw::Collider.

Here is the call graph for this function:

◆ TestCollision() [4/4]

Manifold stw::AabbCollider::TestCollision ( const Transform * transform,
const Collider * collider,
const Transform * colliderTransform ) const
overridevirtual

Tests the collision against a generic collider.

Parameters
transformThe transform of this collider.
colliderThe collider to collide with.
colliderTransformThe transform of the collider to collide with.
Returns
The manifold of that collision.

Implements stw::Collider.

Here is the call graph for this function:

Member Data Documentation

◆ halfHeight

float stw::AabbCollider::halfHeight = 0

Half of the height of the box.

◆ halfWidth

float stw::AabbCollider::halfWidth = 0

Half of the width of the box.


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