aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Rigidbody.h
blob: 02ced2e2b63b6b00ec83a0ee376750da07a1c873 (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 {

// 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(game_object_id_t 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