X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fexhibit.h;h=9b5c753f4de63aa4030362b2b57a72e1f29c5010;hp=c607fdb0a0588bf44bcb0f0efdc12bae436b94ff;hb=37b68f014b46922b885c6344d6b069cba3c9c3c5;hpb=b7c92831285013b2a0783bccaf3d900545ebb5ba diff --git a/src/exhibit.h b/src/exhibit.h index c607fdb..9b5c753 100644 --- a/src/exhibit.h +++ b/src/exhibit.h @@ -1,29 +1,83 @@ #ifndef EXHIBIT_H_ #define EXHIBIT_H_ +#include #include #include "object.h" #include "geom.h" +#include "audio/stream.h" -/* +class Exhibit; +class ExhibitSlot; +class Scene; + +enum { + EXSEL_RAY = 1, + EXSEL_SPHERE = 2 +}; + +class ExSelection { +public: + static ExSelection null; // null selection + + Exhibit *ex; + void *obj; + void *data; + Ray selray; + Sphere selsphere; + float dist; + unsigned int validmask; + + ExSelection(Exhibit *ex = 0); + + operator bool() const; +}; + +enum { + EXDATA_INFO, + EXDATA_VIDEO +}; + +class ExData { +public: + int type; + + std::string text; + AudioStream *voice; + // TODO: video stream + + ExData(); + ~ExData(); +}; + + +/* TODO - select me aktina kai select me sfaira, epistrefei Selection - hover me aktina kai hover me sfaira - move me selection, origin, direction kai rotation (?) */ - class Exhibit : public Object { +private: + SceneNode *orig_parent; + public: + ExhibitSlot *prev_slot; + std::vector data; + Exhibit(); - virtual ~Exhibit() = default; + virtual ~Exhibit(); Exhibit(const Exhibit&) = delete; Exhibit &operator =(const Exhibit &) = delete; - virtual void *select(const Ray &ray) const; - virtual void *select(const Sphere &sph) const; + virtual void set_node(SceneNode *node); + + virtual ExSelection select(const Ray &ray) const; + virtual ExSelection select(const Sphere &sph) const; + + virtual void update(float dt = 0.0f) override; - virtual void update(float dt = 0.0f); - virtual void draw() const; + virtual const AABox &get_aabox() const override; }; #endif // EXHIBIT_H_