18 ExSelection::ExSelection(Exhibit *ex)
25 ExSelection::operator bool() const
41 // private data for each exhibit type
42 ExhibitPriv::ExhibitPriv()
50 priv = new ExhibitPriv;
58 void Exhibit::set_node(SceneNode *node)
60 this->node = priv->orig_node = node;
61 priv->orig_pos = node->get_position();
62 priv->orig_rot = node->get_rotation();
65 ExSelection Exhibit::select(const Ray &ray) const
69 if(get_aabox().intersect(ray, &hit)) {
70 sel.ex = (Exhibit*)this;
73 sel.validmask = EXSEL_RAY;
78 ExSelection Exhibit::select(const Sphere &sph) const
80 return ExSelection(0); // TODO
83 void Exhibit::update(float dt)
87 void Exhibit::pre_draw() const
90 glMatrixMode(GL_MODELVIEW);
92 glMultMatrixf(node->get_matrix()[0]);
96 void Exhibit::draw() const
100 void Exhibit::post_draw() const
103 glMatrixMode(GL_MODELVIEW);
106 if(exsel_hover.ex == this) {
107 const AABox &bvol = get_aabox();
108 draw_geom_object(&bvol);
114 const AABox &Exhibit::get_aabox() const
116 aabb = node->get_bounds();