Classes |
Public Member Functions |
Static Public Member Functions |
Public Attributes |
List of all members
CubbyFlow::RigidBodyCollider< N > Class Template Referencefinal
N-D rigid body collider class. More...
#include <Core/Geometry/RigidBodyCollider.hpp>
Inheritance diagram for CubbyFlow::RigidBodyCollider< N >:
Classes | |
class | Builder |
Front-end to create RigidBodyCollider objects step by step. More... | |
Public Member Functions | |
RigidBodyCollider (const std::shared_ptr< Surface< N >> &surface) | |
Constructs a collider with a surface. More... | |
RigidBodyCollider (const std::shared_ptr< Surface< N >> &surface, const Vector< double, N > &_linearVelocity, const AngularVelocity< N > &_angularVelocity) | |
Constructs a collider with a surface and other parameters. More... | |
Vector< double, N > | VelocityAt (const Vector< double, N > &point) const override |
Returns the velocity of the collider at given point . More... | |
Public Member Functions inherited from CubbyFlow::Collider< N > | |
Collider ()=default | |
Default constructor. More... | |
virtual | ~Collider ()=default |
Default virtual destructor. More... | |
Collider (const Collider &other)=default | |
Default copy constructor. More... | |
Collider (Collider &&other) noexcept=default | |
Default move constructor. More... | |
Collider & | operator= (const Collider &other)=default |
Default copy assignment operator. More... | |
Collider & | operator= (Collider &&other) noexcept=default |
Default move assignment operator. More... | |
void | ResolveCollision (double radius, double restitutionCoefficient, Vector< double, N > *position, Vector< double, N > *velocity) |
double | GetFrictionCoefficient () const |
Returns friction coefficient. More... | |
void | SetFrictionCoefficient (double newFrictionCoefficient) |
Sets the friction coefficient. More... | |
const std::shared_ptr< Surface< N > > & | 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 Collider::update function is invoked. More... | |
Static Public Member Functions | |
static Builder | GetBuilder () |
Returns builder fox RigidBodyCollider. More... | |
Public Attributes | |
Vector< double, N > | linearVelocity |
Linear velocity of the rigid body. More... | |
AngularVelocity< N > | angularVelocity |
Angular velocity of the rigid body. More... | |
Additional Inherited Members | |
Public Types inherited from CubbyFlow::Collider< N > | |
using | OnBeginUpdateCallback = std::function< void(Collider *, double, double)> |
Callback function type for update calls. More... | |
Protected Member Functions inherited from CubbyFlow::Collider< N > | |
void | SetSurface (const std::shared_ptr< Surface< N >> &newSurface) |
Assigns the surface instance from the subclass. More... | |
void | GetClosestPoint (const std::shared_ptr< Surface< N >> &surface, const Vector< double, N > &queryPoint, ColliderQueryResult *result) const |
Outputs closest point's information. More... | |
bool | IsPenetrating (const ColliderQueryResult &colliderPoint, const Vector< double, N > &position, double radius) |
Returns true if given point is in the opposite side of the surface. More... | |
Detailed Description
template<size_t N>
class CubbyFlow::RigidBodyCollider< N >
N-D rigid body collider class.
This class implements N-D rigid body collider. The collider can only take rigid body motion with linear and rotational velocities.
Constructor & Destructor Documentation
◆ RigidBodyCollider() [1/2]
template<size_t N>
|
explicit |
Constructs a collider with a surface.
◆ RigidBodyCollider() [2/2]
template<size_t N>
CubbyFlow::RigidBodyCollider< N >::RigidBodyCollider | ( | const std::shared_ptr< Surface< N >> & | surface, |
const Vector< double, N > & | _linearVelocity, | ||
const AngularVelocity< N > & | _angularVelocity | ||
) |
Constructs a collider with a surface and other parameters.
Member Function Documentation
◆ GetBuilder()
template<size_t N>
|
static |
Returns builder fox RigidBodyCollider.
◆ VelocityAt()
template<size_t N>
|
overridevirtual |
Returns the velocity of the collider at given point
.
Implements CubbyFlow::Collider< N >.
Member Data Documentation
◆ angularVelocity
template<size_t N>
AngularVelocity<N> CubbyFlow::RigidBodyCollider< N >::angularVelocity |
Angular velocity of the rigid body.
◆ linearVelocity
template<size_t N>
Vector<double, N> CubbyFlow::RigidBodyCollider< N >::linearVelocity |
Linear velocity of the rigid body.
The documentation for this class was generated from the following file:
- Core/Geometry/RigidBodyCollider.hpp