cmdfx 0.2.0
Lightweight game engine for your terminal
Loading...
Searching...
No Matches
force.h
Go to the documentation of this file.
1
11#pragma once
12
13#include "cmdfx/core/sprites.h"
14#include "cmdfx/physics/util.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20// Base Force Functions
21
29
37
48
57
69
80
90
104
115int Sprite_setFrictionCoefficient(CmdFX_Sprite* sprite, double coefficient);
116
126
127// Impulse Functions
128
137int Sprite_addForceFor(CmdFX_Sprite* sprite, CmdFX_Vector* force, int duration);
138
139#ifdef __cplusplus
140}
141#endif
int Sprite_setFrictionCoefficient(CmdFX_Sprite *sprite, double coefficient)
Sets the friction coefficient of a sprite.
CmdFX_Vector ** Sprite_getAllForces(CmdFX_Sprite *sprite)
Gets all of the forces acting on a sprite.
int Sprite_removeAllForces(CmdFX_Sprite *sprite)
Removes all forces from a sprite.
int Sprite_getAllForcesCount(CmdFX_Sprite *sprite)
Gets the number of forces acting on a sprite.
int Sprite_clearAllForces()
Removes all forces for every sprite and frees the array.
int Sprite_resetFrictionCoefficient(CmdFX_Sprite *sprite)
Resets the friction coefficient of a sprite.
double Sprite_getFrictionCoefficient(CmdFX_Sprite *sprite)
Gets the friction coefficient of a sprite.
int Sprite_removeForce(CmdFX_Sprite *sprite, CmdFX_Vector *force)
Removes a force from a sprite.
int Sprite_addForceFor(CmdFX_Sprite *sprite, CmdFX_Vector *force, int duration)
Adds a temporary force to a sprite.
CmdFX_Vector * Sprite_getNetForce(CmdFX_Sprite *sprite)
Gets the net force acting on a sprite.
int Sprite_addForce(CmdFX_Sprite *sprite, CmdFX_Vector *force)
Adds a force to a sprite.
Physics utilities for cmdfx.
Sprites API for CmdFX.
Represents a sprite that can be drawn to the terminal.
Definition sprites.h:30
A 2D Vector.
Definition util.h:22