blob: 6079a76b1e918033de425daf509cec3b1f1cc158 (
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
|
#pragma once
#include <cstdint>
#include "../Component.h"
namespace crepe::api {
// FIXME: can't this enum be defined inside the class declaration of Rigidbody?
enum class BodyType {
//! Does not move (e.g. walls, ground ...)
STATIC,
//! Moves and responds to forces (e.g. player, physics objects ...)
DYNAMIC,
//! Moves but does not respond to forces (e.g. moving platforms ...)
KINEMATIC,
};
class Rigidbody : public Component {
public:
Rigidbody(uint32_t game_object_id, int mass, int gravity_scale,
BodyType body_type);
int32_t velocity_x;
int32_t velocity_y;
int mass;
int gravity_scale;
BodyType body_type;
};
} // namespace crepe::api
|