CubbyFlow::ColliderSet2 Class Referencefinal

Collection of 2-D colliders. More...

#include <Core/Collider/ColliderSet2.h>

Inheritance diagram for CubbyFlow::ColliderSet2:
CubbyFlow::Collider2

Classes

class  Builder
 Front-end to create ColliderSet2 objects step by step. More...
 

Public Member Functions

 ColliderSet2 ()
 Default constructor. More...
 
 ColliderSet2 (const std::vector< Collider2Ptr > &others)
 Constructs with other colliders. More...
 
Vector2D VelocityAt (const Vector2D &point) const override
 Returns the velocity of the collider at given point. More...
 
void AddCollider (const Collider2Ptr &collider)
 Adds a collider to the set. More...
 
size_t NumberOfColliders () const
 Returns number of colliders. More...
 
Collider2Ptr Collider (size_t i) const
 Returns collider at index i. More...
 
- Public Member Functions inherited from CubbyFlow::Collider2
 Collider2 ()
 Default constructor. More...
 
virtual ~Collider2 ()
 Default destructor. More...
 
void ResolveCollision (double radius, double restitutionCoefficient, Vector2D *position, Vector2D *velocity)
 
double GetFrictionCoefficient () const
 Returns friction coefficient. More...
 
void SetFrictionCoefficient (double newFrictionCoeffient)
 Sets the friction coefficient. More...
 
const Surface2Ptr & GetSurface () const
 Returns the surface instance. More...
 
void Update (double currentTimeInSeconds, double timeIntervalInSeconds)
 Updates the collider state. More...
 
void SetOnBeginUpdateCallback (const OnBeginUpdateCallback &callback)
 Sets the callback function to be called when Collider2::update function is invoked. More...
 

Static Public Member Functions

static Builder GetBuilder ()
 Returns builder fox ColliderSet2. More...
 

Additional Inherited Members

- Public Types inherited from CubbyFlow::Collider2
using OnBeginUpdateCallback = std::function< void(Collider2 *, double, double)>
 Callback function type for update calls. More...
 
- Protected Member Functions inherited from CubbyFlow::Collider2
void SetSurface (const Surface2Ptr &newSurface)
 Assigns the surface instance from the subclass. More...
 
void GetClosestPoint (const Surface2Ptr &surface, const Vector2D &queryPoint, ColliderQueryResult *result) const
 Outputs closest point's information. More...
 
bool IsPenetrating (const ColliderQueryResult &colliderPoint, const Vector2D &position, double radius)
 Returns true if given point is in the opposite side of the surface. More...
 

Detailed Description

Collection of 2-D colliders.

Constructor & Destructor Documentation

◆ ColliderSet2() [1/2]

CubbyFlow::ColliderSet2::ColliderSet2 ( )

Default constructor.

◆ ColliderSet2() [2/2]

CubbyFlow::ColliderSet2::ColliderSet2 ( const std::vector< Collider2Ptr > &  others)
explicit

Constructs with other colliders.

Member Function Documentation

◆ AddCollider()

void CubbyFlow::ColliderSet2::AddCollider ( const Collider2Ptr &  collider)

Adds a collider to the set.

◆ Collider()

Collider2Ptr CubbyFlow::ColliderSet2::Collider ( size_t  i) const

Returns collider at index i.

◆ GetBuilder()

static Builder CubbyFlow::ColliderSet2::GetBuilder ( )
static

Returns builder fox ColliderSet2.

◆ NumberOfColliders()

size_t CubbyFlow::ColliderSet2::NumberOfColliders ( ) const

Returns number of colliders.

◆ VelocityAt()

Vector2D CubbyFlow::ColliderSet2::VelocityAt ( const Vector2D &  point) const
overridevirtual

Returns the velocity of the collider at given point.

Implements CubbyFlow::Collider2.


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