Force-related physics declarations.
More...
Go to the source code of this file.
Force-related physics declarations.
- Author
- Gregory Mitchell (me@gm.nosp@m.itch.nosp@m.215.x.nosp@m.yz)
- Version
- 0.1.1
- Date
- 2025-02-09
- Copyright
- Copyright (c) 2025
◆ Sprite_addForce()
Adds a force to a sprite.
- Parameters
-
sprite | The sprite to use. |
force | The force to add. |
- Returns
- 0 if successful, -1 if an error occurred.
◆ Sprite_addImpulse()
Adds an impulse to a sprite.
- Parameters
-
sprite | The sprite to use. |
force | The impulse to add. |
duration | The duration of the impulse, in milliseconds. |
- Returns
- 0 if successful, -1 if an error occurred.
◆ Sprite_getAllForces()
Gets all of the forces acting on a sprite.
- Parameters
-
- Returns
- The forces acting on the sprite as a vector array.
◆ Sprite_getFrictionCoefficient()
double Sprite_getFrictionCoefficient |
( |
CmdFX_Sprite * | sprite | ) |
|
Gets the friction coefficient of a sprite.
The friction coefficient is a value between 0 and 1 that determines how much a sprite will slow down when moving on the ground.
If the sprite does not have a custom friction coefficient, the default value of Engine_getDefaultFrictionCoefficient
will be returned.
- Parameters
-
- Returns
- The friction coefficient of the sprite.
◆ Sprite_getNetForce()
Gets the net force acting on a sprite.
- Parameters
-
- Returns
- The net force acting on the sprite.
◆ Sprite_removeAllForces()
Removes all forces from a sprite.
- Parameters
-
- Returns
- 0 if successful, -1 if an error occurred.
◆ Sprite_removeForce()
Removes a force from a sprite.
The force will be removed if it is found in the sprite's force array.
- Parameters
-
sprite | The sprite to use. |
force | The force to remove. |
- Returns
- 0 if successful, -1 if an error occurred.
◆ Sprite_resetFrictionCoefficient()
int Sprite_resetFrictionCoefficient |
( |
CmdFX_Sprite * | sprite | ) |
|
Resets the friction coefficient of a sprite.
The friction coefficient will be reset to the default value.
- Parameters
-
- Returns
- 0 if successful, -1 if an error occurred.
◆ Sprite_setFrictionCoefficient()
int Sprite_setFrictionCoefficient |
( |
CmdFX_Sprite * | sprite, |
|
|
double | coefficient ) |
Sets the friction coefficient of a sprite.
The friction coefficient is a value between 0 and 1 that determines how much a sprite will slow down when moving on the ground.
- Parameters
-
sprite | The sprite to use. |
coefficient | The friction coefficient to set. |
- Returns
- 0 if successful, -1 if an error occurred.