Abstract base class for generic collider object.
More...
#include <jet/collider3.h>
Abstract base class for generic collider object.
This class contains basic interfaces for colliders. Most of the functionalities are implemented within this class, except the member function Collider3::velocityAt. This class also let the subclasses to provide a Surface3 instance to define collider surface using Collider3::setSurface function.
◆ OnBeginUpdateCallback
Callback function type for update calls.
This type of callback function will take the collider pointer, current time, and time interval in seconds.
◆ Collider3()
jet::Collider3::Collider3 |
( |
| ) |
|
◆ ~Collider3()
virtual jet::Collider3::~Collider3 |
( |
| ) |
|
|
virtual |
◆ frictionCoefficient()
double jet::Collider3::frictionCoefficient |
( |
| ) |
const |
Returns friction coefficent.
◆ getClosestPoint()
Outputs closest point's information.
◆ isPenetrating()
Returns true if given point is in the opposite side of the surface.
◆ resolveCollision()
void jet::Collider3::resolveCollision |
( |
double |
radius, |
|
|
double |
restitutionCoefficient, |
|
|
Vector3D * |
position, |
|
|
Vector3D * |
velocity |
|
) |
| |
Resolves collision for given point.
- Parameters
-
radius | Radius of the colliding point. |
restitutionCoefficient | Defines the restitution effect. |
position | Input and output position of the point. |
position | Input and output velocity of the point. |
◆ setFrictionCoefficient()
void jet::Collider3::setFrictionCoefficient |
( |
double |
newFrictionCoeffient | ) |
|
Sets the friction coefficient.
This function assigns the friction coefficient to the collider. Any negative inputs will be clamped to zero.
◆ setOnBeginUpdateCallback()
Sets the callback function to be called when Collider2::update function is invoked.
The callback function takes current simulation time in seconds unit. Use this callback to track any motion or state changes related to this collider.
- Parameters
-
[in] | callback | The callback function. |
◆ setSurface()
void jet::Collider3::setSurface |
( |
const Surface3Ptr & |
newSurface | ) |
|
|
protected |
Assigns the surface instance from the subclass.
◆ surface()
Returns the surface instance.
◆ update()
void jet::Collider3::update |
( |
double |
currentTimeInSeconds, |
|
|
double |
timeIntervalInSeconds |
|
) |
| |
Updates the collider state.
◆ velocityAt()
The documentation for this class was generated from the following file: