X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fobject.h;fp=source%2Flibr2c2%2Fobject.h;h=206ec336d8e1cb99b1dd26f9dad09ea9bd3907a3;hb=2910db1364914c0ab98a0f80250cc39137821577;hp=0000000000000000000000000000000000000000;hpb=3e60e64dc914badcd3ead3e6c4a5c3f08204cebe;p=r2c2.git diff --git a/source/libr2c2/object.h b/source/libr2c2/object.h new file mode 100644 index 0000000..206ec33 --- /dev/null +++ b/source/libr2c2/object.h @@ -0,0 +1,35 @@ +#ifndef LIBR2C2_OBJECT_H_ +#define LIBR2C2_OBJECT_H_ + +#include "geometry.h" +#include "objecttype.h" + +namespace R2C2 { + +class Layout; + +class Object +{ +protected: + Layout &layout; + Vector position; + float rotation; + + Object(Layout &l): layout(l) { } +public: + virtual ~Object() { } + + virtual Object *clone(Layout * = 0) const = 0; + virtual const ObjectType &get_type() const = 0; + Layout &get_layout() const { return layout; } + virtual void set_position(const Vector &) = 0; + virtual void set_rotation(float) = 0; + const Vector &get_position() const { return position; } + float get_rotation() const { return rotation; } + virtual Object *get_parent() const { return 0; } + virtual bool collide_ray(const Vector &, const Vector &) const = 0; +}; + +} // namespace R2C2 + +#endif