8 //! argument to ExhibitSlot::attach
9 enum ExSlotAttachMode {
10 EXSLOT_ATTACH_PERMANENT,
11 EXSLOT_ATTACH_TRANSIENT
14 //! slot which can hold a single exhibit
20 Quat rotation, grab_rot;
23 ExhibitSlot(Exhibit *ex = 0);
26 void init(Exhibit *ex);
29 Exhibit *get_exhibit() const;
31 bool attach_exhibit(Exhibit *ex, ExSlotAttachMode mode = EXSLOT_ATTACH_PERMANENT);
32 bool detach_exhibit();
36 class ExhibitManager {
38 std::vector<Exhibit*> items, stashed;
39 std::vector<ExhibitSlot*> exslots;
40 // TODO kdtree of slots for quick nearest queries
42 Scene *own_scn; // scene to manage all exhibits not taken from an existing scene
50 void add(Exhibit *ex);
51 bool remove(Exhibit *ex);
53 bool load(MetaScene *mscn, const char *fname);
55 ExSelection select(const Ray &ray) const;
56 ExSelection select(const Sphere &sph) const;
58 ExhibitSlot *nearest_empty_slot(const Vec3 &pos, float max_dist = 10) const;
60 void stash_exhibit(Exhibit *ex);
62 void update(float dt = 0.0f);