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

A circle collider. More...

#include <Collider.hpp>

Inheritance diagram for stw::CircleCollider:
Collaboration diagram for stw::CircleCollider:

Public Member Functions

 CircleCollider ()=default
 
 CircleCollider (float radius)
 
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 radius = 0
 Radius of the circle.
 
- Public Attributes inherited from stw::Collider
Vector2 center {}
 The center of the collider.
 

Detailed Description

A circle collider.

Constructor & Destructor Documentation

◆ CircleCollider() [1/2]

stw::CircleCollider::CircleCollider ( )
default

◆ CircleCollider() [2/2]

stw::CircleCollider::CircleCollider ( float radius)

Member Function Documentation

◆ FindFurthestPoint()

Vector2 stw::CircleCollider::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:

◆ GetBoundingBoxSize()

Vector2 stw::CircleCollider::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::CircleCollider::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::CircleCollider::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::CircleCollider::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::CircleCollider::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

◆ radius

float stw::CircleCollider::radius = 0

Radius of the circle.


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