Stowy Physics Engine 0.1.0
Loading...
Searching...
No Matches
stw::Collider Class Referenceabstract

A pure virtual struct that represents colliders. More...

#include <Collider.hpp>

Inheritance diagram for stw::Collider:
Collaboration diagram for stw::Collider:

Public Member Functions

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

Public Attributes

Vector2 center {}
 The center of the collider.
 

Detailed Description

A pure virtual struct that represents colliders.

Constructor & Destructor Documentation

◆ Collider() [1/3]

stw::Collider::Collider ( )
default

◆ Collider() [2/3]

stw::Collider::Collider ( Collider && col)
defaultnoexcept

◆ ~Collider()

virtual stw::Collider::~Collider ( )
virtualdefault

◆ Collider() [3/3]

stw::Collider::Collider ( const Collider & col)
default

Member Function Documentation

◆ FindFurthestPoint()

virtual Vector2 stw::Collider::FindFurthestPoint ( const Transform * transform,
const Vector2 & direction ) const
pure virtual

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.

Implemented in stw::BoxCollider, stw::CircleCollider, and stw::AabbCollider.

◆ GetBoundingBoxSize()

virtual Vector2 stw::Collider::GetBoundingBoxSize ( ) const
pure virtual

Gets the size of the box that surrounds the collider.

Returns
The bounding box of the collider.

Implemented in stw::BoxCollider, stw::CircleCollider, and stw::AabbCollider.

◆ operator=() [1/2]

Collider & stw::Collider::operator= ( Collider && col)
default

◆ operator=() [2/2]

Collider & stw::Collider::operator= ( const Collider & col)
default

◆ TestCollision() [1/4]

virtual Manifold stw::Collider::TestCollision ( const Transform * transform,
const AabbCollider * collider,
const Transform * aabbTransform ) const
pure virtual

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.

Implemented in stw::CircleCollider, stw::AabbCollider, and stw::BoxCollider.

◆ TestCollision() [2/4]

virtual Manifold stw::Collider::TestCollision ( const Transform * transform,
const BoxCollider * collider,
const Transform * boxTransform ) const
pure virtual

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.

Implemented in stw::BoxCollider, stw::CircleCollider, and stw::AabbCollider.

◆ TestCollision() [3/4]

virtual Manifold stw::Collider::TestCollision ( const Transform * transform,
const CircleCollider * collider,
const Transform * circleTransform ) const
pure virtual

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.

Implemented in stw::BoxCollider, stw::CircleCollider, and stw::AabbCollider.

◆ TestCollision() [4/4]

virtual Manifold stw::Collider::TestCollision ( const Transform * transform,
const Collider * collider,
const Transform * colliderTransform ) const
pure virtual

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.

Implemented in stw::BoxCollider, stw::CircleCollider, and stw::AabbCollider.

Member Data Documentation

◆ center

Vector2 stw::Collider::center {}

The center of the collider.


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