00001
00002
00003 #ifndef AR_VRMLINT_H
00004 #define AR_VRMLINT_H
00005
00006 #include <openvrml/browser.h>
00007 #include <openvrml/gl/viewer.h>
00008 #include <openvrml/bounding_volume.h>
00009
00010 class arVrmlViewer : public openvrml::gl::viewer {
00011
00012 public:
00013 arVrmlViewer(openvrml::browser& browser);
00014 ~arVrmlViewer();
00015
00016 char filename[512];
00017 double translation[3];
00018 double rotation[4];
00019 double scale[3];
00020 bool internal_light;
00021
00022 void timerUpdate();
00023 void redraw();
00024 void setInternalLight( bool f );
00025
00026 protected:
00027 virtual void post_redraw();
00028 virtual void set_cursor(openvrml::gl::viewer::cursor_style c);
00029 virtual void swap_buffers();
00030 virtual void set_timer(double);
00031
00032
00033 virtual void set_viewpoint(const openvrml::vec3f & position,
00034 const openvrml::rotation & orientation,
00035 float fieldOfView,
00036 float avatarSize,
00037 float visibilityLimit);
00038
00039 virtual viewer::object_t insert_background(const std::vector<float> & groundAngle,
00040 const std::vector<openvrml::color> & groundColor,
00041 const std::vector<float> & skyAngle,
00042 const std::vector<openvrml::color> & skyColor,
00043 size_t * whc = 0,
00044 unsigned char ** pixels = 0);
00045
00046 virtual viewer::object_t insert_dir_light(float ambientIntensity,
00047 float intensity,
00048 const openvrml::color & color,
00049 const openvrml::vec3f & direction);
00050
00051 virtual viewer::object_t insert_point_light(float ambientIntensity,
00052 const openvrml::vec3f & attenuation,
00053 const openvrml::color & color,
00054 float intensity,
00055 const openvrml::vec3f & location,
00056 float radius);
00057
00058 virtual viewer::object_t insert_spot_light(float ambientIntensity,
00059 const openvrml::vec3f & attenuation,
00060 float beamWidth,
00061 const openvrml::color & color,
00062 float cutOffAngle,
00063 const openvrml::vec3f & direction,
00064 float intensity,
00065 const openvrml::vec3f & location,
00066 float radius);
00067 virtual openvrml::bounding_volume::intersection
00068 intersect_view_volume(const openvrml::bounding_volume & bvolume) const;
00069 };
00070
00071 #endif