X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=examples%2Fbassteroids%2Fsource%2Fphysicalentity.h;fp=examples%2Fbassteroids%2Fsource%2Fphysicalentity.h;h=a0cca3768a0308cfe35ba7321d11e32057ec00b1;hb=0636566dd84ca185d3e9a6fae02459569c42d220;hp=0000000000000000000000000000000000000000;hpb=29aa52b23d74d390c677b728776022a9b267d9e6;p=libs%2Fgame.git diff --git a/examples/bassteroids/source/physicalentity.h b/examples/bassteroids/source/physicalentity.h new file mode 100644 index 0000000..a0cca37 --- /dev/null +++ b/examples/bassteroids/source/physicalentity.h @@ -0,0 +1,32 @@ +#ifndef PHYSICALENTITY_H_ +#define PHYSICALENTITY_H_ + +#include +#include "rigidbody.h" +#include "collider.h" + +struct PhysicalSetup +{ + bool fixture = false; + RigidBodySetup body; + ColliderSetup collider; +}; + +class PhysicalEntity: public Msp::Game::Entity +{ +public: + using Setup = PhysicalSetup; + +protected: + Msp::Game::Owned body; + Msp::Game::Owned collider; + +public: + PhysicalEntity(Msp::Game::Handle, const Setup &); + + bool is_fixture() const { return !body; } + Msp::Game::Handle get_body() const { return body; } + Msp::Game::Handle get_collider() const { return collider; } +}; + +#endif