Collider.hpp
Go to the documentation of this file.
40 std::function<void(Collider*, double, double)>;
Collider & operator=(const Collider &other)=default
Default copy assignment operator.
std::shared_ptr< Collider3 > Collider3Ptr
Shared pointer type for the Collider3.
Definition: Collider.hpp:144
std::shared_ptr< Collider2 > Collider2Ptr
Shared pointer type for the Collider2.
Definition: Collider.hpp:141
std::function< void(Collider *, double, double)> OnBeginUpdateCallback
Callback function type for update calls.
Definition: Collider.hpp:40
Vector< double, N > velocity
Definition: Collider.hpp:112
void GetClosestPoint(const std::shared_ptr< Surface< N >> &surface, const Vector< double, N > &queryPoint, ColliderQueryResult *result) const
Outputs closest point's information.
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.
void ResolveCollision(double radius, double restitutionCoefficient, Vector< double, N > *position, Vector< double, N > *velocity)
void SetFrictionCoefficient(double newFrictionCoefficient)
Sets the friction coefficient.
Definition: Matrix.hpp:27
double GetFrictionCoefficient() const
Returns friction coefficient.
void Update(double currentTimeInSeconds, double timeIntervalInSeconds)
Updates the collider state.
Definition: pybind11Utils.hpp:20
const std::shared_ptr< Surface< N > > & GetSurface() const
Returns the surface instance.
virtual Vector< double, N > VelocityAt(const Vector< double, N > &point) const =0
Returns the velocity of the collider at given point.
Vector< double, N > point
Definition: Collider.hpp:110
Internal query result structure.
Definition: Collider.hpp:107
Vector< double, N > normal
Definition: Collider.hpp:111
void SetSurface(const std::shared_ptr< Surface< N >> &newSurface)
Assigns the surface instance from the subclass.
void SetOnBeginUpdateCallback(const OnBeginUpdateCallback &callback)
Sets the callback function to be called when Collider::update function is invoked.