X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fexhibit.h;h=f2c521b5f19af2c3f51dfaa745a500f12ff5cf9f;hp=c4c0ec9490d16461fbc5598b445d0351314f80f3;hb=03085a16aa2fef785083fa3921be83015e08b290;hpb=004eca3966c8cc7bed607311a90d56eecab1752f diff --git a/src/exhibit.h b/src/exhibit.h index c4c0ec9..f2c521b 100644 --- a/src/exhibit.h +++ b/src/exhibit.h @@ -1,32 +1,83 @@ #ifndef EXHIBIT_H_ #define EXHIBIT_H_ +#include #include #include "object.h" #include "geom.h" +#include "audio/stream.h" -/* +class Exhibit; +class ExhibitPriv; +class Scene; + +enum { + EXSEL_RAY = 1, + EXSEL_SPHERE = 2 +}; + +class ExSelection { +public: + Exhibit *ex; + void *obj; + void *data; + Ray selray; + Sphere selsphere; + 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: + ExhibitPriv *priv; + public: + 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 void update(float dt = 0.0f); + virtual ExSelection select(const Ray &ray) const; + virtual ExSelection select(const Sphere &sph) const; + + virtual void update(float dt = 0.0f) override; virtual void pre_draw() const; - virtual void draw() const; + virtual void draw() const override; virtual void post_draw() const; + + virtual const AABox &get_aabox() const override; }; #endif // EXHIBIT_H_