blob: ed6d182b78f1b5b7e8de77f1200c9053956851ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#include "mussolini.h"
#include "assets.h"
#include "game.h"
#include "util.h"
void initMussolini(Entity * entity, Game * game) {
entity->model = &game->assets.models[MUSSOLINI_ASSET];
setEntityRadius(entity);
// PID configs.
PIDConfig stickPIDConfig = {
.kP = 0.5,
.kI = 0.0,
.kD = 0.0,
.angleMode = false,
.doClamp = false,
.min = 0.0,
.max = 0.0
};
// Allocate data.
entity->data = KF_MALLOC(sizeof(Mussolini));
if (entity->data == NULL) {
ALLOCATION_ERROR;
return;
}
Mussolini * data = (Mussolini*)entity->data;
data->xStickPID = createPID(stickPIDConfig);
data->yStickPID = createPID(stickPIDConfig);
data->zStickPID = createPID(stickPIDConfig);
}
void closeMussolini(Entity * entity) {
if (entity->data != NULL)
KF_FREE(entity->data);
}
void updateMussolini(Game * game, Entity * entity) {
Entity * ship = getEntityFromWorld(game->world, 0);
Mussolini * data = (Mussolini*)entity->data;
}
void drawMussolini(Game * game, Entity * entity) {
entityDraw(entity);
}
|