Collider2.h
Go to the documentation of this file.
55 void ResolveCollision(double radius, double restitutionCoefficient, Vector2D* position, Vector2D* velocity);
100 void GetClosestPoint(const Surface2Ptr& surface, const Vector2D& queryPoint, ColliderQueryResult* result) const;
103 bool IsPenetrating(const ColliderQueryResult& colliderPoint, const Vector2D& position, double radius);
void SetSurface(const Surface2Ptr &newSurface)
Assigns the surface instance from the subclass.
virtual Vector2D VelocityAt(const Vector2D &point) const =0
Returns the velocity of the collider at given point.
std::shared_ptr< Collider2 > Collider2Ptr
Shared pointer type for the Collider2.
Definition: Collider2.h:112
bool IsPenetrating(const ColliderQueryResult &colliderPoint, const Vector2D &position, double radius)
Returns true if given point is in the opposite side of the surface.
double GetFrictionCoefficient() const
Returns friction coefficient.
Internal query result structure.
Definition: Collider2.h:88
void GetClosestPoint(const Surface2Ptr &surface, const Vector2D &queryPoint, ColliderQueryResult *result) const
Outputs closest point's information.
void SetOnBeginUpdateCallback(const OnBeginUpdateCallback &callback)
Sets the callback function to be called when Collider2::update function is invoked.
void ResolveCollision(double radius, double restitutionCoefficient, Vector2D *position, Vector2D *velocity)
void Update(double currentTimeInSeconds, double timeIntervalInSeconds)
Updates the collider state.
Definition: pybind11Utils.h:24
std::function< void(Collider2 *, double, double)> OnBeginUpdateCallback
Callback function type for update calls.
Definition: Collider2.h:36
std::shared_ptr< Surface2 > Surface2Ptr
Shared pointer for the Surface2 type.
Definition: Surface2.h:100
void SetFrictionCoefficient(double newFrictionCoeffient)
Sets the friction coefficient.