blob: 05cbb03b32ff2b3824853dc1a5748945802b0f4b (
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
|
#pragma once
#include <cstdint>
#include "../Component.h"
namespace crepe::api {
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
|