]> git.tdb.fi Git - libs/game.git/blob - examples/bassteroids/source/physicalentity.h
Use the setup generator to create setup structs
[libs/game.git] / examples / bassteroids / source / physicalentity.h
1 #ifndef PHYSICALENTITY_H_
2 #define PHYSICALENTITY_H_
3
4 #include <msp/game/entity.h>
5 #include <msp/game/transform.h>
6 #include "collider.h"
7 #include "rigidbody.h"
8 #include "setups.h"
9
10 class PhysicalEntity: public Msp::Game::Entity
11 {
12 public:
13         using Setup = PhysicalSetup;
14
15 protected:
16         Msp::Game::Owned<RigidBody> body;
17         Msp::Game::Owned<Collider> collider;
18
19 public:
20         PhysicalEntity(Msp::Game::Handle<Msp::Game::Entity>, const Setup &, const Msp::Game::TransformValues & = Msp::Game::TransformValues());
21
22         bool is_fixture() const { return !body; }
23         Msp::Game::Handle<RigidBody> get_body() const { return body; }
24         Msp::Game::Handle<Collider> get_collider() const { return collider; }
25 };
26
27 #endif