]> git.bts.cx Git - benzene.git/blob - src/bz/fx/agent_simulation.h
Sprites
[benzene.git] / src / bz / fx / agent_simulation.h
1 #ifndef BZ_FX_AGENT_SIMULATION_H
2 #define BZ_FX_AGENT_SIMULATION_H
3
4 #include <bz/collision/collision.h>
5 #include <bz/math/vector.h>
6 #include <bz/memory/arena.h>
7 #include <bz/types/identifier.h>
8
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12
13 typedef struct BZAgentSimulation BZAgentSimulation;
14 typedef BZAgentSimulation * BZAgentSimulationID;
15
16 typedef struct BZAgent BZAgent;
17 typedef BZAgent * BZAgentID;
18
19 struct BZAgentDetails {
20 float mass;
21 BZVector position;
22 float angle;
23 float maxForce;
24 float maxSpeed;
25 };
26 typedef struct BZAgentDetails BZAgentDetails;
27
28 #define bzAgentDefaultMass 1.0f
29 #define bzAgentDefaultMaxForce 50.0f
30 #define bzAgentDefaultMaxSpeed 100.0f
31
32 extern BZAgentSimulationID bzFXCreateAgentSimulation(BZMemoryArenaID arena, size_t maxAgents, const char *identifierFmt, ...);
33
34 extern void bzFXUpdateAgentSimulation(BZAgentSimulationID simulation, float deltaTime, BZCollisionSpaceID collisionSpace, BZVector *v);
35
36 extern BZAgentID bzFXAgentSimulationAddAgent(BZAgentSimulationID simulation, const BZAgentDetails *details);
37 extern void bzFXAgentSimulationRemoveAgent(BZAgentSimulationID simulation, BZAgentID agent);
38
39 extern void bzFXAgentSimulationGetAgentDetails(BZAgentDetails *detailsOut, BZAgentSimulationID simulation, BZAgentID agent);
40
41 extern void bzFXAgentSimulationDrawDebug(BZAgentSimulationID simulation);
42
43 #ifdef __cplusplus
44 }
45 #endif
46
47 #endif