|
| Rigidbody () |
|
const Vector2 & | GravityForce () const |
| Gets the force of the gravity on this body.
|
|
void | SetGravityForce (const Vector2 &gravityForce) |
| Sets the gravity force.
|
|
const Vector2 & | Force () const |
| Gets the force on this body.
|
|
void | ApplyForce (const Vector2 &addedForce) |
| Adds force to this body.
|
|
void | SetForce (const Vector2 &force) |
| Sets the force of this body.
|
|
const Vector2 & | Velocity () const |
| Gets the velocity of this body.
|
|
void | SetVelocity (const Vector2 &velocity) |
| Sets the velocity of this body.
|
|
float | Mass () const |
| Computes the mass of this body. Only the inverted mass is stored, so it's computed as 1 / InvMass();.
|
|
float | InvMass () const |
| Returns 1 / Mass of this body.
|
|
void | SetMass (float mass) |
| Sets the mass of this body.
|
|
bool | TakesGravity () const |
| Gets a boolean indicating whether this body takes gravity.
|
|
void | SetTakesGravity (bool takesGravity) |
| Sets a boolean indicating whether this body takes gravity.
|
|
float | StaticFriction () const |
| Gets the static friction of this body.
|
|
void | SetStaticFriction (float staticFriction) |
| Sets the static friction of this body.
|
|
float | DynamicFriction () const |
| Gets the dynamic friction of this body.
|
|
void | SetDynamicFriction (float dynamicFriction) |
| Sets the dynamic friction of this body.
|
|
float | Restitution () const |
| Gets the restitution of this body. Can be seen as the "Bounciness".
|
|
void | SetRestitution (float restitution) |
| Sets the restitution of this body. Can be seen as the "Bounciness".
|
|
Public Member Functions inherited from stw::CollisionBody |
| CollisionBody () |
|
Transform * | Trans () |
| Gets the transform of the body.
|
|
void | SetTransform (const Transform &transform) |
| Sets the transform of the body.
|
|
Collider * | Col () const |
| Gets the collider of the body.
|
|
void | SetCollider (Collider *collider) |
| Sets the collider of the body.
|
|
bool | IsTrigger () const |
| A boolean saying if the collider is a trigger collider. This means that it will not have a collision response and will only have a callback.
|
|
void | SetIsTrigger (bool isTrigger) |
| Sets is trigger on the body. True means that it will not have a collision response and will only have a callback.
|
|
void | SetCollisionCallback (const std::function< void(const Collision &, float)> &callback) |
| Sets the collision callback function.
|
|
void | OnCollision (const Collision &collision, float deltaTime) const |
| Triggers the collision callback function.
|
|
const Vector2 & | Position () const |
| Gets the position of the body in the world.
|
|
void | SetPosition (const Vector2 &position) |
| Sets the position of the body in the world.
|
|
bool | IsKinematic () const |
| Gets a boolean that indicates if this body will receive a collision response.
|
|
void | SetIsKinematic (bool isKinematic) |
| Sets a boolean that indicates if this body will receive a collision response.
|
|
bool | IsDynamic () const |
| Gets a boolean indicating if this body is dynamic. This means that this is a Rigidbody.
|
|
A Rigidbody that has dynamics.