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

A rotatable box collider. More...

#include <Collider.hpp>

Inheritance diagram for stw::BoxCollider:
Collaboration diagram for stw::BoxCollider:

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 *circleTransform) 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.
 
std::array< Vector2, 4 > GetTransformedVertices (const Transform &transform) const
 Gets the transformed vertices of the box.
 
std::array< Vector2, 4 > GetVertices () const
 Gets the untransformed vertices of the box.
 
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
 

Static Public Member Functions

static Projection Project (const Vector2 &axis, const std::array< Vector2, 4 > &vertices)
 
static std::array< Vector2, 4 > GetAxes (const std::array< Vector2, 4 > &vertices)
 

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

A rotatable box collider.

Member Function Documentation

◆ FindFurthestPoint()

Vector2 stw::BoxCollider::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.

Here is the call graph for this function:

◆ GetAxes()

std::array< Vector2, 4 > stw::BoxCollider::GetAxes ( const std::array< Vector2, 4 > & vertices)
static
Here is the call graph for this function:

◆ GetBoundingBoxSize()

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

Gets the size of the box that surrounds the collider.

Returns
The bounding box of the collider.

Implements stw::Collider.

◆ GetTransformedVertices()

std::array< Vector2, 4 > stw::BoxCollider::GetTransformedVertices ( const Transform & transform) const

Gets the transformed vertices of the box.

Parameters
transformThe transform to apply to the collider.
Returns
The transform vertices of the box.
Here is the call graph for this function:

◆ GetVertices()

std::array< Vector2, 4 > stw::BoxCollider::GetVertices ( ) const

Gets the untransformed vertices of the box.

Returns
The vertices of the box.
Here is the call graph for this function:

◆ Project()

Projection stw::BoxCollider::Project ( const Vector2 & axis,
const std::array< Vector2, 4 > & vertices )
static
Here is the call graph for this function:

◆ TestCollision() [1/4]

Manifold stw::BoxCollider::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::BoxCollider::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::BoxCollider::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::BoxCollider::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::BoxCollider::halfHeight = 0

Half of the height of the box.

◆ halfWidth

float stw::BoxCollider::halfWidth = 0

Half of the width of the box.


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