From: Braden M. <br...@us...> - 2006-08-31 06:45:38
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14506/src/libopenvrml/openvrml Modified Files: Vrml97Parser.g basetypes.cpp basetypes.h bounding_volume.cpp browser.cpp script.cpp vrml97node.cpp x3d_dis.cpp x3d_geometry2d.cpp x3d_geospatial.cpp x3d_grouping.cpp x3d_hanim.cpp x3d_nurbs.cpp x3d_shape.cpp x3d_texturing.cpp Log Message: Made openvrml::color, openvrml::color_rgba, openvrml::vec2f, openvrml::vec2d, openvrml::vec3f, openvrml::vec3d, openvrml::rotation, openvrml::mat4f, and openvrml::quatf POD-structs. This allows safe usage of these types in C APIs. Index: basetypes.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/basetypes.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** basetypes.h 23 Aug 2006 06:41:27 -0000 1.24 --- basetypes.h 31 Aug 2006 06:45:30 -0000 1.25 *************** *** 42,59 **** ! class color; ! ! OPENVRML_API std::istream & operator>>(std::istream & in, color & c); ! ! class OPENVRML_API color { ! friend std::istream & operator>>(std::istream & in, color & c); ! float rgb[3]; - public: - color() OPENVRML_NOTHROW; - explicit color(const float (&rgb)[3]) OPENVRML_NOTHROW; - color(float r, float g, float b) OPENVRML_NOTHROW; - const float & operator[](size_t index) const OPENVRML_NOTHROW; --- 42,48 ---- ! struct OPENVRML_API color { float rgb[3]; const float & operator[](size_t index) const OPENVRML_NOTHROW; *************** *** 70,77 **** --- 59,73 ---- }; + OPENVRML_API const color make_color() OPENVRML_NOTHROW; + OPENVRML_API const color make_color(const float (&rgb)[3]) + OPENVRML_NOTHROW; + OPENVRML_API const color make_color(float r, float g, float b) + OPENVRML_NOTHROW; + OPENVRML_API bool operator==(const color & lhs, const color & rhs) OPENVRML_NOTHROW; OPENVRML_API bool operator!=(const color & lhs, const color & rhs) OPENVRML_NOTHROW; + OPENVRML_API std::istream & operator>>(std::istream & in, color & c); OPENVRML_API std::ostream & operator<<(std::ostream & out, const color & c); *************** *** 115,132 **** ! class color_rgba; ! ! OPENVRML_API std::istream & operator>>(std::istream & in, color_rgba & c); ! ! class OPENVRML_API color_rgba { ! friend std::istream & operator>>(std::istream & in, color_rgba & c); ! float rgba[4]; - public: - color_rgba() OPENVRML_NOTHROW; - explicit color_rgba(const float (&rgba)[4]) OPENVRML_NOTHROW; - color_rgba(float r, float g, float b, float a = 1.0f) OPENVRML_NOTHROW; - const float & operator[](size_t index) const OPENVRML_NOTHROW; --- 111,117 ---- ! struct OPENVRML_API color_rgba { float rgba[4]; const float & operator[](size_t index) const OPENVRML_NOTHROW; *************** *** 145,148 **** --- 130,142 ---- }; + OPENVRML_API const color_rgba make_color_rgba() OPENVRML_NOTHROW; + OPENVRML_API const color_rgba make_color_rgba(const float (&rgba)[4]) + OPENVRML_NOTHROW; + OPENVRML_API const color_rgba make_color_rgba(float r, + float g, + float b, + float a) + OPENVRML_NOTHROW; + OPENVRML_API bool operator==(const color_rgba & lhs, const color_rgba & rhs) *************** *** 151,154 **** --- 145,149 ---- const color_rgba & rhs) OPENVRML_NOTHROW; + OPENVRML_API std::istream & operator>>(std::istream & in, color_rgba & c); OPENVRML_API std::ostream & operator<<(std::ostream & out, const color_rgba & c); *************** *** 202,219 **** ! class vec2f; ! ! OPENVRML_API std::istream & operator>>(std::istream & in, vec2f & v); ! ! class OPENVRML_API vec2f { ! friend std::istream & operator>>(std::istream & in, vec2f & v); ! float vec[2]; - public: - vec2f() OPENVRML_NOTHROW; - explicit vec2f(const float (&vec)[2]) OPENVRML_NOTHROW; - vec2f(float x, float y) OPENVRML_NOTHROW; - vec2f & operator*=(float scalar) OPENVRML_NOTHROW; vec2f & operator/=(float scalar) OPENVRML_NOTHROW; --- 197,203 ---- ! struct OPENVRML_API vec2f { float vec[2]; vec2f & operator*=(float scalar) OPENVRML_NOTHROW; vec2f & operator/=(float scalar) OPENVRML_NOTHROW; *************** *** 236,239 **** --- 220,228 ---- }; + OPENVRML_API const vec2f make_vec2f() OPENVRML_NOTHROW; + OPENVRML_API const vec2f make_vec2f(const float (&vec)[2]) + OPENVRML_NOTHROW; + OPENVRML_API const vec2f make_vec2f(float x, float y) OPENVRML_NOTHROW; + OPENVRML_API const vec2f operator*(const vec2f & lhs, float rhs) OPENVRML_NOTHROW; *************** *** 251,254 **** --- 240,244 ---- OPENVRML_NOTHROW; + OPENVRML_API std::istream & operator>>(std::istream & in, vec2f & v); OPENVRML_API std::ostream & operator<<(std::ostream & out, const vec2f & v); *************** *** 292,309 **** ! class vec2d; ! ! OPENVRML_API std::istream & operator>>(std::istream & in, vec2d & v); ! ! class OPENVRML_API vec2d { ! friend std::istream & operator>>(std::istream & in, vec2d & v); ! double vec[2]; - public: - vec2d() OPENVRML_NOTHROW; - explicit vec2d(const double (&vec)[2]) OPENVRML_NOTHROW; - vec2d(double x, double y) OPENVRML_NOTHROW; - vec2d & operator*=(double scalar) OPENVRML_NOTHROW; vec2d & operator/=(double scalar) OPENVRML_NOTHROW; --- 282,288 ---- ! struct OPENVRML_API vec2d { double vec[2]; vec2d & operator*=(double scalar) OPENVRML_NOTHROW; vec2d & operator/=(double scalar) OPENVRML_NOTHROW; *************** *** 326,329 **** --- 305,313 ---- }; + OPENVRML_API const vec2d make_vec2d() OPENVRML_NOTHROW; + OPENVRML_API const vec2d make_vec2d(const double (&vec)[2]) + OPENVRML_NOTHROW; + OPENVRML_API const vec2d make_vec2d(double x, double y) OPENVRML_NOTHROW; + OPENVRML_API const vec2d operator*(const vec2d & lhs, double rhs) OPENVRML_NOTHROW; *************** *** 341,344 **** --- 325,329 ---- OPENVRML_NOTHROW; + OPENVRML_API std::istream & operator>>(std::istream & in, vec2d & v); OPENVRML_API std::ostream & operator<<(std::ostream & out, const vec2d & v); *************** *** 383,400 **** class mat4f; - class vec3f; - - OPENVRML_API std::istream & operator>>(std::istream & in, vec3f & v); - - class OPENVRML_API vec3f { - friend std::istream & operator>>(std::istream & in, vec3f & v); float vec[3]; - public: - vec3f() OPENVRML_NOTHROW; - explicit vec3f(const float (&vec)[3]) OPENVRML_NOTHROW; - vec3f(float x, float y, float z) OPENVRML_NOTHROW; - vec3f & operator*=(const vec3f & vec) OPENVRML_NOTHROW; vec3f & operator*=(const mat4f & mat) OPENVRML_NOTHROW; --- 368,375 ---- class mat4f; + struct OPENVRML_API vec3f { float vec[3]; vec3f & operator*=(const vec3f & vec) OPENVRML_NOTHROW; vec3f & operator*=(const mat4f & mat) OPENVRML_NOTHROW; *************** *** 422,425 **** --- 397,406 ---- }; + OPENVRML_API const vec3f make_vec3f() OPENVRML_NOTHROW; + OPENVRML_API const vec3f make_vec3f(const float (&vec)[3]) + OPENVRML_NOTHROW; + OPENVRML_API const vec3f make_vec3f(float x, float y, float z) + OPENVRML_NOTHROW; + OPENVRML_API const vec3f operator*(const vec3f & lhs, const vec3f & rhs) OPENVRML_NOTHROW; *************** *** 443,446 **** --- 424,428 ---- OPENVRML_NOTHROW; + OPENVRML_API std::istream & operator>>(std::istream & in, vec3f & v); OPENVRML_API std::ostream & operator<<(std::ostream & out, const vec3f & v); *************** *** 500,517 **** ! class vec3d; ! ! OPENVRML_API std::istream & operator>>(std::istream & in, vec3d & v); ! ! class OPENVRML_API vec3d { ! friend std::istream & operator>>(std::istream & in, vec3d & v); ! double vec[3]; - public: - vec3d() OPENVRML_NOTHROW; - explicit vec3d(const double (&vec)[3]) OPENVRML_NOTHROW; - vec3d(double x, double y, double z) OPENVRML_NOTHROW; - vec3d & operator*=(const vec3d & vec) OPENVRML_NOTHROW; vec3d & operator*=(const mat4f & mat) OPENVRML_NOTHROW; --- 482,488 ---- ! struct OPENVRML_API vec3d { double vec[3]; vec3d & operator*=(const vec3d & vec) OPENVRML_NOTHROW; vec3d & operator*=(const mat4f & mat) OPENVRML_NOTHROW; *************** *** 539,542 **** --- 510,519 ---- }; + OPENVRML_API const vec3d make_vec3d() OPENVRML_NOTHROW; + OPENVRML_API const vec3d make_vec3d(const double (&vec)[3]) + OPENVRML_NOTHROW; + OPENVRML_API const vec3d make_vec3d(double x, double y, double z) + OPENVRML_NOTHROW; + OPENVRML_API const vec3d operator*(const vec3d & lhs, const vec3d & rhs) OPENVRML_NOTHROW; *************** *** 560,563 **** --- 537,541 ---- OPENVRML_NOTHROW; + OPENVRML_API std::istream & operator>>(std::istream & in, vec3d & v); OPENVRML_API std::ostream & operator<<(std::ostream & out, const vec3d & v); *************** *** 619,634 **** class quatf; ! class OPENVRML_API rotation { float rot[4]; - public: - rotation() OPENVRML_NOTHROW; - explicit rotation(const float (&rot)[4]) OPENVRML_NOTHROW; - rotation(float x, float y, float z, float angle) OPENVRML_NOTHROW; - rotation(const vec3f & axis, float angle) OPENVRML_NOTHROW; - rotation(const vec3f & from_vec, const vec3f & to_vec) - OPENVRML_NOTHROW; - explicit rotation(const quatf & quat) OPENVRML_NOTHROW; - rotation & operator*=(const rotation & rot) OPENVRML_NOTHROW; --- 597,603 ---- class quatf; ! struct OPENVRML_API rotation { float rot[4]; rotation & operator*=(const rotation & rot) OPENVRML_NOTHROW; *************** *** 652,656 **** }; ! const rotation OPENVRML_API operator*(const rotation & lhs, const rotation & rhs) OPENVRML_NOTHROW; --- 621,641 ---- }; ! OPENVRML_API const rotation make_rotation() OPENVRML_NOTHROW; ! OPENVRML_API const rotation make_rotation(const float (&rot)[4]) ! OPENVRML_NOTHROW; ! OPENVRML_API const rotation make_rotation(float x, ! float y, ! float z, ! float angle) ! OPENVRML_NOTHROW; ! OPENVRML_API const rotation make_rotation(const vec3f & axis, float angle) ! OPENVRML_NOTHROW; ! OPENVRML_API const rotation make_rotation(const vec3f & from_vec, ! const vec3f & to_vec) ! OPENVRML_NOTHROW; ! OPENVRML_API const rotation make_rotation(const quatf & quat) ! OPENVRML_NOTHROW; ! ! OPENVRML_API const rotation operator*(const rotation & lhs, const rotation & rhs) OPENVRML_NOTHROW; *************** *** 687,691 **** inline const vec3f rotation::axis() const OPENVRML_NOTHROW { ! return vec3f(this->rot[0], this->rot[1], this->rot[2]); } --- 672,676 ---- inline const vec3f rotation::axis() const OPENVRML_NOTHROW { ! return make_vec3f(this->rot[0], this->rot[1], this->rot[2]); } *************** *** 701,730 **** ! class OPENVRML_API mat4f { float mat[4][4]; - public: - static const mat4f rotation(const openvrml::rotation & rot) - OPENVRML_NOTHROW; - static const mat4f rotation(const quatf & quat) OPENVRML_NOTHROW; - static const mat4f scale(float s) OPENVRML_NOTHROW; - static const mat4f scale(const vec3f & s) OPENVRML_NOTHROW; - static const mat4f translation(const vec3f & t) OPENVRML_NOTHROW; - static const mat4f transformation(const vec3f & t, - const openvrml::rotation & r, - const vec3f & s, - const openvrml::rotation & sr, - const vec3f & c) OPENVRML_NOTHROW; - - mat4f() OPENVRML_NOTHROW; - mat4f(float f11, float f12, float f13, float f14, - float f21, float f22, float f23, float f24, - float f31, float f32, float f33, float f34, - float f41, float f42, float f43, float f44) OPENVRML_NOTHROW; - explicit mat4f(const float mat[16]) OPENVRML_NOTHROW; - explicit mat4f(const float (&mat)[4][4]) OPENVRML_NOTHROW; - - // Use compiler-defined operator= and copy constructor. - mat4f & operator*=(float scalar) OPENVRML_NOTHROW; mat4f & operator*=(const mat4f & mat) OPENVRML_NOTHROW; --- 686,692 ---- ! struct OPENVRML_API mat4f { float mat[4][4]; mat4f & operator*=(float scalar) OPENVRML_NOTHROW; mat4f & operator*=(const mat4f & mat) OPENVRML_NOTHROW; *************** *** 733,739 **** const float (&operator[](const size_t index) const OPENVRML_NOTHROW)[4]; ! void transformation(vec3f & t, openvrml::rotation & r, vec3f & s) const OPENVRML_NOTHROW; ! void transformation(vec3f & t, openvrml::rotation & r, vec3f & s, vec3f & shear) const OPENVRML_NOTHROW; --- 695,701 ---- const float (&operator[](const size_t index) const OPENVRML_NOTHROW)[4]; ! void transformation(vec3f & t, rotation & r, vec3f & s) const OPENVRML_NOTHROW; ! void transformation(vec3f & t, rotation & r, vec3f & s, vec3f & shear) const OPENVRML_NOTHROW; *************** *** 744,747 **** --- 706,729 ---- }; + const mat4f make_mat4f() OPENVRML_NOTHROW; + const mat4f make_mat4f(float f11, float f12, float f13, float f14, + float f21, float f22, float f23, float f24, + float f31, float f32, float f33, float f34, + float f41, float f42, float f43, float f44) + OPENVRML_NOTHROW; + const mat4f make_mat4f(const float mat[16]) OPENVRML_NOTHROW; + const mat4f make_mat4f(const float (&mat)[4][4]) OPENVRML_NOTHROW; + + const mat4f make_rotation_mat4f(const rotation & rot) OPENVRML_NOTHROW; + const mat4f make_rotation_mat4f(const quatf & quat) OPENVRML_NOTHROW; + const mat4f make_scale_mat4f(float s) OPENVRML_NOTHROW; + const mat4f make_scale_mat4f(const vec3f & s) OPENVRML_NOTHROW; + const mat4f make_translation_mat4f(const vec3f & t) OPENVRML_NOTHROW; + const mat4f make_transformation_mat4f(const vec3f & t, + const rotation & r, + const vec3f & s, + const rotation & sr, + const vec3f & c) OPENVRML_NOTHROW; + OPENVRML_API bool operator==(const mat4f & lhs, const mat4f & rhs) OPENVRML_NOTHROW; *************** *** 772,791 **** ! OPENVRML_API std::istream & operator>>(std::istream & in, quatf & q); ! ! class OPENVRML_API quatf { ! friend std::istream & operator>>(std::istream & in, quatf & q); ! float quat[4]; - public: - quatf() OPENVRML_NOTHROW; - quatf(float x, float y, float z, float w) OPENVRML_NOTHROW; - explicit quatf(const float (&quat)[4]) OPENVRML_NOTHROW; - explicit quatf(const rotation & rot) OPENVRML_NOTHROW; - explicit quatf(const mat4f & mat) OPENVRML_NOTHROW; - - // use compiler-defined operator= and copy constructor. - quatf & operator*=(const quatf & quat) OPENVRML_NOTHROW; quatf & operator*=(float scalar) OPENVRML_NOTHROW; --- 754,760 ---- ! struct OPENVRML_API quatf { float quat[4]; quatf & operator*=(const quatf & quat) OPENVRML_NOTHROW; quatf & operator*=(float scalar) OPENVRML_NOTHROW; *************** *** 813,816 **** --- 782,791 ---- }; + const quatf make_quatf() OPENVRML_NOTHROW; + const quatf make_quatf(float x, float y, float z, float w) OPENVRML_NOTHROW; + const quatf make_quatf(const float (&quat)[4]) OPENVRML_NOTHROW; + const quatf make_quatf(const rotation & rot) OPENVRML_NOTHROW; + const quatf make_quatf(const mat4f & mat) OPENVRML_NOTHROW; + OPENVRML_API const quatf operator*(const quatf & lhs, const quatf & rhs) OPENVRML_NOTHROW; *************** *** 829,832 **** --- 804,808 ---- OPENVRML_API bool operator!=(const quatf & lhs, const quatf & rhs) OPENVRML_NOTHROW; + OPENVRML_API std::istream & operator>>(std::istream & in, quatf & q); OPENVRML_API std::ostream & operator<<(std::ostream & out, const quatf & quat); Index: x3d_grouping.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_grouping.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** x3d_grouping.cpp 16 Aug 2006 19:29:16 -0000 1.3 --- x3d_grouping.cpp 31 Aug 2006 06:45:34 -0000 1.4 *************** *** 412,416 **** abstract_node<self_t>(type, scope), grouping_node(type, scope), ! bbox_size_(vec3f(-1.0f, -1.0f, -1.0f)), viewerObject(0) {} --- 412,416 ---- abstract_node<self_t>(type, scope), grouping_node(type, scope), ! bbox_size_(make_vec3f(-1.0f, -1.0f, -1.0f)), viewerObject(0) {} Index: x3d_hanim.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_hanim.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** x3d_hanim.cpp 18 May 2006 04:11:31 -0000 1.3 --- x3d_hanim.cpp 31 Aug 2006 06:45:34 -0000 1.4 *************** *** 2003,2007 **** name_(*this), rotation_(*this), ! scale_(*this, vec3f(1,1,1)), scale_orientation_(*this), segments_(*this), --- 2003,2007 ---- name_(*this), rotation_(*this), ! scale_(*this, make_vec3f(1.0, 1.0, 1.0)), scale_orientation_(*this), segments_(*this), *************** *** 2014,2018 **** version_(*this), viewpoints_(*this), ! bbox_size_(vec3f(-1.0f, -1.0f, -1.0f)) {} --- 2014,2018 ---- version_(*this), viewpoints_(*this), ! bbox_size_(make_vec3f(-1.0f, -1.0f, -1.0f)) {} *************** *** 2203,2207 **** name_(*this), rotation_(*this), ! scale_(*this, vec3f(1,1,1)), scale_orientation_(*this), skin_coord_index_(*this), --- 2203,2207 ---- name_(*this), rotation_(*this), ! scale_(*this, make_vec3f(1.0, 1.0, 1.0)), scale_orientation_(*this), skin_coord_index_(*this), *************** *** 2210,2214 **** translation_(*this), ulimit_(*this), ! bbox_size_(vec3f(-1.0f, -1.0f, -1.0f)) {} --- 2210,2214 ---- translation_(*this), ulimit_(*this), ! bbox_size_(make_vec3f(-1.0f, -1.0f, -1.0f)) {} *************** *** 2357,2361 **** moments_of_inertia_(*this, vector<float>(9,0.0f)), name_(*this), ! bbox_size_(vec3f(-1.0f, -1.0f, -1.0f)) {} --- 2357,2361 ---- moments_of_inertia_(*this, vector<float>(9,0.0f)), name_(*this), ! bbox_size_(make_vec3f(-1.0f, -1.0f, -1.0f)) {} *************** *** 2501,2508 **** name_(*this), rotation_(*this), ! scale_(*this, vec3f(1,1,1)), scale_orientation_(*this), translation_(*this), ! bbox_size_(vec3f(-1.0f, -1.0f, -1.0f)) {} --- 2501,2508 ---- name_(*this), rotation_(*this), ! scale_(*this, make_vec3f(1.0, 1.0, 1.0)), scale_orientation_(*this), translation_(*this), ! bbox_size_(make_vec3f(-1.0f, -1.0f, -1.0f)) {} Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** vrml97node.cpp 17 Aug 2006 20:04:22 -0000 1.110 --- vrml97node.cpp 31 Aug 2006 06:45:31 -0000 1.111 *************** *** 1627,1631 **** abstract_node<Derived>(type, scope), ambient_intensity_(*this, 0.0), ! color_(*this, openvrml::color(1.0, 1.0, 1.0)), intensity_(*this, 1.0), on_(*this, true) --- 1627,1631 ---- abstract_node<Derived>(type, scope), ambient_intensity_(*this, 0.0), ! color_(*this, openvrml::make_color(1.0, 1.0, 1.0)), intensity_(*this, 1.0), on_(*this, true) *************** *** 2171,2175 **** grouping_node(type, scope), abstract_node<Derived>(type, scope), ! bbox_size_(vec3f(-1.0, -1.0, -1.0)), add_children_listener_(*this), remove_children_listener_(*this), --- 2171,2175 ---- grouping_node(type, scope), abstract_node<Derived>(type, scope), ! bbox_size_(make_vec3f(-1.0, -1.0, -1.0)), add_children_listener_(*this), remove_children_listener_(*this), *************** *** 4961,4968 **** using openvrml::color; static const float unlit_ambient_intensity(1); ! static const color unlit_diffuse_color(1, 1, 1); ! static const color unlit_emissive_color(1, 1, 1); static const float unlit_shininess(0); ! static const color unlit_specular_color(1, 1, 1); static const float unlit_transparency(0); v.set_material(unlit_ambient_intensity, --- 4961,4968 ---- using openvrml::color; static const float unlit_ambient_intensity(1); ! static const color unlit_diffuse_color = make_color(1, 1, 1); ! static const color unlit_emissive_color = make_color(1, 1, 1); static const float unlit_shininess(0); ! static const color unlit_specular_color = make_color(1, 1, 1); static const float unlit_transparency(0); v.set_material(unlit_ambient_intensity, *************** *** 4995,4999 **** size_t nTexComponents = texture ? texture->image().comp() : 0; if (nTexComponents == 2 || nTexComponents == 4) { trans = 0.0; } ! if (nTexComponents >= 3) { diffuse = color(1.0, 1.0, 1.0); } v.enable_lighting(true); // turn lighting on for this object --- 4995,4999 ---- size_t nTexComponents = texture ? texture->image().comp() : 0; if (nTexComponents == 2 || nTexComponents == 4) { trans = 0.0; } ! if (nTexComponents >= 3) { diffuse = make_color(1.0, 1.0, 1.0); } v.enable_lighting(true); // turn lighting on for this object *************** *** 5018,5025 **** texture_transform->render_texture_transform(v); } else { ! static const vec2f center(0.0, 0.0); static const float rotation = 0.0; ! static const vec2f scale(1.0, 1.0); ! static const vec2f translation(0.0, 0.0); v.set_texture_transform(center, rotation, scale, translation); } --- 5018,5025 ---- texture_transform->render_texture_transform(v); } else { ! static const vec2f center = make_vec2f(0.0, 0.0); static const float rotation = 0.0; ! static const vec2f scale = make_vec2f(1.0, 1.0); ! static const vec2f translation = make_vec2f(0.0, 0.0); v.set_texture_transform(center, rotation, scale, translation); } *************** *** 6645,6649 **** top_url_(*this), sky_angle_(*this), ! sky_color_(*this, std::vector<color>(1, color(0.0, 0.0, 0.0))), is_bound_emitter_(*this, this->is_bound_), bind_time_emitter_(*this, this->bind_time_), --- 6645,6649 ---- top_url_(*this), sky_angle_(*this), ! sky_color_(*this, std::vector<color>(1, make_color(0.0, 0.0, 0.0))), is_bound_emitter_(*this, this->is_bound_), bind_time_emitter_(*this, this->bind_time_), *************** *** 7722,7728 **** // Viewer position in local coordinate system ! const vec3f position = vec3f(inverse_modelview[3][0], ! inverse_modelview[3][1], ! inverse_modelview[3][2]).normalize(); // Viewer-alignment --- 7722,7728 ---- // Viewer position in local coordinate system ! const vec3f position = make_vec3f(inverse_modelview[3][0], ! inverse_modelview[3][1], ! inverse_modelview[3][2]).normalize(); // Viewer-alignment *************** *** 7733,7739 **** // Viewer's up vector // ! const vec3f up = vec3f(inverse_modelview[1][0], ! inverse_modelview[1][1], ! inverse_modelview[1][2]).normalize(); // get x-vector from the cross product of Viewer's --- 7733,7739 ---- // Viewer's up vector // ! const vec3f up = make_vec3f(inverse_modelview[1][0], ! inverse_modelview[1][1], ! inverse_modelview[1][2]).normalize(); // get x-vector from the cross product of Viewer's *************** *** 7778,7782 **** float angle = float(acos(nz[2])); if(nz[0] > 0) { angle = -angle; } ! result = mat4f::rotation(rotation(Y, angle)); } return result; --- 7778,7782 ---- float angle = float(acos(nz[2])); if(nz[0] > 0) { angle = -angle; } ! result = make_rotation_mat4f(make_rotation(Y, angle)); } return result; *************** *** 7797,7801 **** grouping_node(type, scope), grouping_node_base<billboard_node>(type, scope), ! axis_of_rotation_(*this, vec3f(0.0, 1.0, 0.0)), xformObject(0) {} --- 7797,7801 ---- grouping_node(type, scope), grouping_node_base<billboard_node>(type, scope), ! axis_of_rotation_(*this, make_vec3f(0.0, 1.0, 0.0)), xformObject(0) {} *************** *** 7981,7985 **** abstract_node<box_node>(type, scope), geometry_node(type, scope), ! size(vec3f(2.0, 2.0, 2.0)), solid_(true) { --- 7981,7985 ---- abstract_node<box_node>(type, scope), geometry_node(type, scope), ! size(make_vec3f(2.0, 2.0, 2.0)), solid_(true) { *************** *** 10140,10146 **** // set activation point in local coords ! vec3f v(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); this->activationMatrix = this->modelview.inverse(); v *= this->activationMatrix; --- 10140,10146 ---- // set activation point in local coords ! vec3f v = make_vec3f(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); this->activationMatrix = this->modelview.inverse(); v *= this->activationMatrix; *************** *** 10151,10155 **** v.z(this->activationMatrix[2][2]); const vec3f bearing = v.normalize(); ! const vec3f up(0.0, 1.0, 0.0); double ang = acos(bearing.dot(up)); if (ang > pi_2) { ang = pi - ang; } --- 10151,10155 ---- v.z(this->activationMatrix[2][2]); const vec3f bearing = v.normalize(); ! const vec3f up = make_vec3f(0.0, 1.0, 0.0); double ang = acos(bearing.dot(up)); if (ang > pi_2) { ang = pi - ang; } *************** *** 10176,10182 **** // get local coord for touch point ! vec3f Vec(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); Vec = Vec * this->activationMatrix; this->track_point_changed_.value(Vec); --- 10176,10182 ---- // get local coord for touch point ! vec3f Vec = make_vec3f(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); Vec = Vec * this->activationMatrix; this->track_point_changed_.value(Vec); *************** *** 10185,10196 **** vec3f tempv; float rot, radius; ! vec3f dir1(Vec[0], 0, Vec[2]); radius = this->disk ? 1.0f : dir1.length(); dir1 = dir1.normalize(); ! vec3f dir2(this->activationPoint.x(), ! 0, ! this->activationPoint.z()); dir2 = dir2.normalize(); tempv = dir2 * dir1; --- 10185,10196 ---- vec3f tempv; float rot, radius; ! vec3f dir1 = make_vec3f(Vec[0], 0, Vec[2]); radius = this->disk ? 1.0f : dir1.length(); dir1 = dir1.normalize(); ! vec3f dir2 = make_vec3f(this->activationPoint.x(), ! 0, ! this->activationPoint.z()); dir2 = dir2.normalize(); tempv = dir2 * dir1; *************** *** 10213,10217 **** this->rotation_val = rot; this->rotation_changed_.sfrotation::value( ! openvrml::rotation(0, 1, 0, rot)); node::emit_event(this->rotation_changed_emitter_, timestamp); --- 10213,10217 ---- this->rotation_val = rot; this->rotation_changed_.sfrotation::value( ! make_rotation(0, 1, 0, rot)); node::emit_event(this->rotation_changed_emitter_, timestamp); *************** *** 10442,10446 **** light_node(type, scope), abstract_light_node<directional_light_node>(type, scope), ! direction_(*this, vec3f(0.0, 0.0, -1.0)) {} --- 10442,10446 ---- light_node(type, scope), abstract_light_node<directional_light_node>(type, scope), ! direction_(*this, make_vec3f(0.0, 0.0, -1.0)) {} *************** *** 11514,11538 **** const openvrml::vec2f extrusionDefaultCrossSection_[] = { ! openvrml::vec2f(1.0, 1.0), ! openvrml::vec2f(1.0, -1.0), ! openvrml::vec2f(-1.0, -1.0), ! openvrml::vec2f(-1.0, 1.0), ! openvrml::vec2f(1.0, 1.0) }; const openvrml::vec2f extrusionDefaultScale_[] = { ! openvrml::vec2f(1.0, 1.0) }; const openvrml::rotation extrusionDefaultOrientation_[] = { ! openvrml::rotation(0.0, 0.0, 1.0, 0.0) }; const openvrml::vec3f extrusionDefaultSpine_[] = { ! openvrml::vec3f(0.0, 0.0, 0.0), ! openvrml::vec3f(0.0, 1.0, 0.0) }; --- 11514,11538 ---- const openvrml::vec2f extrusionDefaultCrossSection_[] = { ! openvrml::make_vec2f(1.0, 1.0), ! openvrml::make_vec2f(1.0, -1.0), ! openvrml::make_vec2f(-1.0, -1.0), ! openvrml::make_vec2f(-1.0, 1.0), ! openvrml::make_vec2f(1.0, 1.0) }; const openvrml::vec2f extrusionDefaultScale_[] = { ! openvrml::make_vec2f(1.0, 1.0) }; const openvrml::rotation extrusionDefaultOrientation_[] = { ! openvrml::make_rotation(0.0, 0.0, 1.0, 0.0) }; const openvrml::vec3f extrusionDefaultSpine_[] = { ! openvrml::make_vec3f(0.0, 0.0, 0.0), ! openvrml::make_vec3f(0.0, 1.0, 0.0) }; *************** *** 12010,12014 **** child_node(type, scope), set_bind_listener_(*this), ! color_(*this, openvrml::color(1.0, 1.0, 1.0)), fog_type_(*this, "LINEAR"), visibility_range_(*this, 0.0), --- 12010,12014 ---- child_node(type, scope), set_bind_listener_(*this), ! color_(*this, openvrml::make_color(1.0, 1.0, 1.0)), fog_type_(*this, "LINEAR"), visibility_range_(*this, 0.0), *************** *** 14813,14820 **** openvrml::material_node(type, scope), ambient_intensity_(*this, 0.2f), ! diffuse_color_(*this, color(0.8f, 0.8f, 0.8f)), ! emissive_color_(*this, color(0.0, 0.0, 0.0)), shininess_(*this, 0.2f), ! specular_color_(*this, color(0.0, 0.0, 0.0)), transparency_(*this, 0.0) {} --- 14813,14820 ---- openvrml::material_node(type, scope), ambient_intensity_(*this, 0.2f), ! diffuse_color_(*this, make_color(0.8f, 0.8f, 0.8f)), ! emissive_color_(*this, make_color(0.0, 0.0, 0.0)), shininess_(*this, 0.2f), ! specular_color_(*this, make_color(0.0, 0.0, 0.0)), transparency_(*this, 0.0) {} *************** *** 16937,16942 **** angle += float(2.0 * pi); } ! const rotation value(vec3f(x, y, z).normalize(), ! angle); node.value_changed_.value(value); break; --- 16937,16943 ---- angle += float(2.0 * pi); } ! const rotation value = ! make_rotation(make_vec3f(x, y, z).normalize(), ! angle); node.value_changed_.value(value); break; *************** *** 17550,17556 **** auto_offset_(*this, true), enabled_(*this, true), ! max_position_(*this, vec2f(-1.0, -1.0)), ! min_position_(*this, vec2f(0.0, 0.0)), ! offset_(*this, vec3f(0.0, 0.0, 0.0)), description_(*this), is_active_(false), --- 17551,17557 ---- auto_offset_(*this, true), enabled_(*this, true), ! max_position_(*this, make_vec2f(-1.0, -1.0)), ! min_position_(*this, make_vec2f(0.0, 0.0)), ! offset_(*this, make_vec3f(0.0, 0.0, 0.0)), description_(*this), is_active_(false), *************** *** 17612,17618 **** this->is_active_.value(active); ! vec3f V(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); this->activationMatrix = this->modelview.inverse(); V *= this->activationMatrix; --- 17613,17619 ---- this->is_active_.value(active); ! vec3f V = make_vec3f(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); this->activationMatrix = this->modelview.inverse(); V *= this->activationMatrix; *************** *** 17632,17638 **** } else if (active) { // Tracking ! vec3f V(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); V *= this->activationMatrix; this->track_point_changed_.value(V); --- 17633,17639 ---- } else if (active) { // Tracking ! vec3f V = make_vec3f(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); V *= this->activationMatrix; this->track_point_changed_.value(V); *************** *** 17640,17648 **** timestamp); ! vec3f t(V[0] - this->activationPoint.value().x() ! + this->offset_.sfvec3f::value().x(), ! V[1] - this->activationPoint.value().y() ! + this->offset_.sfvec3f::value().y(), ! 0.0); const vec2f & min_pos = this->min_position_.sfvec2f::value(); --- 17641,17649 ---- timestamp); ! vec3f t = make_vec3f(V[0] - this->activationPoint.value().x() ! + this->offset_.sfvec3f::value().x(), ! V[1] - this->activationPoint.value().y() ! + this->offset_.sfvec3f::value().y(), ! 0.0); const vec2f & min_pos = this->min_position_.sfvec2f::value(); *************** *** 17935,17940 **** abstract_light_node<point_light_node>(type, scope), scoped_light_node(type, scope), ! attenuation_(*this, vec3f(1.0, 0.0, 0.0)), ! location_(*this, vec3f(0.0, 0.0, 0.0)), radius_(*this, 100) {} --- 17936,17941 ---- abstract_light_node<point_light_node>(type, scope), scoped_light_node(type, scope), ! attenuation_(*this, make_vec3f(1.0, 0.0, 0.0)), ! location_(*this, make_vec3f(0.0, 0.0, 0.0)), radius_(*this, 100) {} *************** *** 18891,18897 **** abstract_node<proximity_sensor_node>(type, scope), child_node(type, scope), ! center_(*this, vec3f(0.0, 0.0, 0.0)), enabled_(*this, true), ! size_(*this, vec3f(0.0, 0.0, 0.0)), is_active_(false), is_active_emitter_(*this, this->is_active_), --- 18892,18898 ---- abstract_node<proximity_sensor_node>(type, scope), child_node(type, scope), ! center_(*this, make_vec3f(0.0, 0.0, 0.0)), enabled_(*this, true), ! size_(*this, make_vec3f(0.0, 0.0, 0.0)), is_active_(false), is_active_emitter_(*this, this->is_active_), *************** *** 18984,18989 **** // Check for movement within the box if (wasIn || inside) { ! if (this->position_changed_.value() != vec3f(x, y, z)) { ! this->position_changed_.value(vec3f(x, y, z)); node::emit_event(this->position_changed_emitter_, timeNow.value()); --- 18985,18990 ---- // Check for movement within the box if (wasIn || inside) { ! if (this->position_changed_.value() != make_vec3f(x, y, z)) { ! this->position_changed_.value(make_vec3f(x, y, z)); node::emit_event(this->position_changed_emitter_, timeNow.value()); *************** *** 19483,19487 **** appearance_(*this), geometry_(*this), ! bbox_size_(vec3f(-1,-1,-1)), viewerObject(0) {} --- 19484,19488 ---- appearance_(*this), geometry_(*this), ! bbox_size_(make_vec3f(-1,-1,-1)), viewerObject(0) {} *************** *** 19579,19583 **** // color. // ! color c(1.0, 1.0, 1.0); float transparency = 0.0; if (material) { --- 19580,19584 ---- // color. // ! color c = make_color(1.0, 1.0, 1.0); float transparency = 0.0; if (material) { *************** *** 19964,19968 **** abstract_node<sound_node>(type, scope), child_node(type, scope), ! direction_(*this, vec3f(0, 0, 1)), intensity_(*this, 1.0f), location_(*this), --- 19965,19969 ---- abstract_node<sound_node>(type, scope), child_node(type, scope), ! direction_(*this, make_vec3f(0, 0, 1)), intensity_(*this, 1.0f), location_(*this), *************** *** 20481,20485 **** auto_offset_(*this, true), enabled_(*this, true), ! offset_(*this, openvrml::rotation(0.0, 1.0, 0.0, 0.0)), description_(*this), is_active_(false), --- 20482,20486 ---- auto_offset_(*this, true), enabled_(*this, true), ! offset_(*this, openvrml::make_rotation(0.0, 1.0, 0.0, 0.0)), description_(*this), is_active_(false), *************** *** 20542,20548 **** // set activation point in world coords ! const vec3f floatVec(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); this->activationPoint.value(floatVec); --- 20543,20549 ---- // set activation point in world coords ! const vec3f floatVec = make_vec3f(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); this->activationPoint.value(floatVec); *************** *** 20575,20581 **** else if (active) { // get local coord for touch point ! vec3f V(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); mat4f M = this->modelview.inverse(); V = V * M; --- 20576,20582 ---- else if (active) { // get local coord for touch point ! vec3f V = make_vec3f(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); mat4f M = this->modelview.inverse(); V = V * M; *************** *** 20584,20590 **** timestamp); ! vec3f V2(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); vec3f tempv = V2 - this->centerPoint.value(); vec3f dir1(tempv); --- 20585,20591 ---- timestamp); ! vec3f V2 = make_vec3f(static_cast<float>(p[0]), ! static_cast<float>(p[1]), ! static_cast<float>(p[2])); vec3f tempv = V2 - this->centerPoint.value(); vec3f dir1(tempv); *************** *** 20605,20610 **** cx = cx.normalize(); ! openvrml::rotation newRot(cx, ! dist * float(acos(dir1.dot(dir2)))); if (this->auto_offset_.sfbool::value()) { newRot = newRot * this->offset_.sfrotation::value(); --- 20606,20611 ---- cx = cx.normalize(); ! openvrml::rotation newRot = ! make_rotation(cx, dist * float(acos(dir1.dot(dir2)))); if (this->auto_offset_.sfbool::value()) { newRot = newRot * this->offset_.sfrotation::value(); *************** *** 20950,20958 **** abstract_light_node<spot_light_node>(type, scope), scoped_light_node(type, scope), ! attenuation_(*this, vec3f(1.0, 0.0, 0.0)), beam_width_(*this, 1.570796f), cut_off_angle_(*this, 0.785398f), ! direction_(*this, vec3f(0.0, 0.0, -1.0)), ! location_(*this, vec3f(0.0, 0.0, 0.0)), radius_(*this, 100) {} --- 20951,20959 ---- abstract_light_node<spot_light_node>(type, scope), scoped_light_node(type, scope), ! attenuation_(*this, make_vec3f(1.0, 0.0, 0.0)), beam_width_(*this, 1.570796f), cut_off_angle_(*this, 0.785398f), ! direction_(*this, make_vec3f(0.0, 0.0, -1.0)), ! location_(*this, make_vec3f(0.0, 0.0, 0.0)), radius_(*this, 100) {} *************** *** 22953,22957 **** return FT_Err_Out_Of_Memory; } ! const vec2f vertex(to->x * c.scale, to->y * c.scale); c.contours.back().front() = vertex; return 0; --- 22954,22958 ---- return FT_Err_Out_Of_Memory; } ! const vec2f vertex = make_vec2f(to->x * c.scale, to->y * c.scale); c.contours.back().front() = vertex; return 0; *************** *** 22963,22967 **** assert(user); GlyphContours_ & c = *static_cast<GlyphContours_ *>(user); ! const openvrml::vec2f vertex(to->x * c.scale, to->y * c.scale); try { c.contours.back().push_back(vertex); --- 22964,22969 ---- assert(user); GlyphContours_ & c = *static_cast<GlyphContours_ *>(user); ! const openvrml::vec2f vertex = make_vec2f(to->x * c.scale, ! to->y * c.scale); try { c.contours.back().push_back(vertex); *************** *** 23042,23048 **** const size_t npoints = 3; vec2f buffer[npoints * npoints] = { ! vec2f(lastVertex[0], lastVertex[1]), ! vec2f(control->x * c.scale, control->y * c.scale), ! vec2f(to->x * c.scale, to->y * c.scale) }; --- 23044,23050 ---- const size_t npoints = 3; vec2f buffer[npoints * npoints] = { ! make_vec2f(lastVertex[0], lastVertex[1]), ! make_vec2f(control->x * c.scale, control->y * c.scale), ! make_vec2f(to->x * c.scale, to->y * c.scale) }; *************** *** 23079,23086 **** static const size_t npoints = 4; vec2f buffer[npoints * npoints] = { ! vec2f(lastVertex[0], lastVertex[1]), ! vec2f(control1->x * c.scale, control1->y * c.scale), ! vec2f(control2->x * c.scale, control2->y * c.scale), ! vec2f(to->x * c.scale, to->y * c.scale) }; --- 23081,23088 ---- static const size_t npoints = 4; vec2f buffer[npoints * npoints] = { ! make_vec2f(lastVertex[0], lastVertex[1]), ! make_vec2f(control1->x * c.scale, control1->y * c.scale), ! make_vec2f(control2->x * c.scale, control2->y * c.scale), ! make_vec2f(to->x * c.scale, to->y * c.scale) }; *************** *** 23228,23233 **** for (size_t i = 0; i < glyphGeometry->coord.size(); ++i) { const vec2f & glyphVertex = glyphGeometry->coord[i]; ! const vec2f textVertex(glyphVertex[0] + penPos[0], ! glyphVertex[1] + penPos[1]); lineGeometry.coord.push_back(textVertex); lineGeometry.xMin = (lineGeometry.xMin < textVertex[0]) --- 23230,23236 ---- for (size_t i = 0; i < glyphGeometry->coord.size(); ++i) { const vec2f & glyphVertex = glyphGeometry->coord[i]; ! const vec2f textVertex = ! make_vec2f(glyphVertex[0] + penPos[0], ! glyphVertex[1] + penPos[1]); lineGeometry.coord.push_back(textVertex); lineGeometry.xMin = (lineGeometry.xMin < textVertex[0]) *************** *** 23286,23291 **** for (size_t i = 0; i < lineGeometry.coord.size(); ++i) { const vec2f & vertex = lineGeometry.coord[i]; ! const vec2f scaledVertex(vertex[0] / currentLength * length, ! vertex[1]); lineGeometry.coord[i] = scaledVertex; } --- 23289,23295 ---- for (size_t i = 0; i < lineGeometry.coord.size(); ++i) { const vec2f & vertex = lineGeometry.coord[i]; ! const vec2f scaledVertex = ! make_vec2f(vertex[0] / currentLength * length, ! vertex[1]); lineGeometry.coord[i] = scaledVertex; } *************** *** 23319,23325 **** if (index > -1) { const vec2f & lineVertex = lineGeometry.coord[index]; ! const vec3f textVertex(lineVertex.x() + xOffset, ! lineVertex.y() + yOffset, ! 0.0f); newGeometry.coord.push_back(textVertex); newGeometry.coord_index --- 23323,23330 ---- if (index > -1) { const vec2f & lineVertex = lineGeometry.coord[index]; ! const vec3f textVertex = ! make_vec3f(lineVertex.x() + xOffset, ! lineVertex.y() + yOffset, ! 0.0f); newGeometry.coord.push_back(textVertex); newGeometry.coord_index *************** *** 23355,23363 **** for (size_t i = 0; i < newGeometry.coord.size(); ++i) { const vec3f & vertex = newGeometry.coord[i]; ! const vec3f scaledVertex( ! vertex.x() / currentMaxExtent * maxExtent, ! vertex.y(), ! vertex.z() ! ); newGeometry.coord[i] = scaledVertex; } --- 23360,23367 ---- for (size_t i = 0; i < newGeometry.coord.size(); ++i) { const vec3f & vertex = newGeometry.coord[i]; ! const vec3f scaledVertex = ! make_vec3f(vertex.x() / currentMaxExtent * maxExtent, ! vertex.y(), ! vertex.z()); newGeometry.coord[i] = scaledVertex; } *************** *** 23397,23403 **** for (size_t i = 0; i < newGeometry.coord.size(); ++i) { const vec3f & vertex = newGeometry.coord[i]; ! const vec3f adjustedVertex(vertex.x() + xOffset, ! vertex.y() + yOffset, ! vertex.z()); newGeometry.coord[i] = adjustedVertex; } --- 23401,23407 ---- for (size_t i = 0; i < newGeometry.coord.size(); ++i) { const vec3f & vertex = newGeometry.coord[i]; ! const vec3f adjustedVertex = make_vec3f(vertex.x() + xOffset, ! vertex.y() + yOffset, ! vertex.z()); newGeometry.coord[i] = adjustedVertex; } *************** *** 23408,23412 **** newGeometry.normal.resize(npolygons); // Throws std::bad_alloc. for (size_t i = 0; i < newGeometry.normal.size(); ++i) { ! static const vec3f normal(0.0, 0.0, 1.0); newGeometry.normal[i] = normal; } --- 23412,23416 ---- newGeometry.normal.resize(npolygons); // Throws std::bad_alloc. for (size_t i = 0; i < newGeometry.normal.size(); ++i) { ! static const vec3f normal = make_vec3f(0.0, 0.0, 1.0); newGeometry.normal[i] = normal; } *************** *** 23418,23422 **** for (size_t i = 0; i < newGeometry.tex_coord.size(); ++i) { const vec3f & vertex = newGeometry.coord[i]; ! newGeometry.tex_coord[i] = vec2f(vertex.x() / size, vertex.y() / size); } --- 23422,23427 ---- for (size_t i = 0; i < newGeometry.tex_coord.size(); ++i) { const vec3f & vertex = newGeometry.coord[i]; ! newGeometry.tex_coord[i] = make_vec2f(vertex.x() / size, ! vertex.y() / size); } *************** *** 23802,23809 **** abstract_node<texture_transform_node>(type, scope), openvrml::texture_transform_node(type, scope), ! center_(*this, vec2f(0.0, 0.0)), rotation_(*this, 0.0), ! scale_(*this, vec2f(1.0, 1.0)), ! translation_(*this, vec2f(0.0, 0.0)) {} --- 23807,23814 ---- abstract_node<texture_transform_node>(type, scope), openvrml::texture_transform_node(type, scope), ! center_(*this, make_vec2f(0.0, 0.0)), rotation_(*this, 0.0), ! scale_(*this, make_vec2f(1.0, 1.0)), ! translation_(*this, make_vec2f(0.0, 0.0)) {} *************** *** 25390,25394 **** openvrml::event_emitter(static_cast<const field_value &>(*this)), sfvec3f_listener(node), ! exposedfield<openvrml::sfvec3f>(node, vec3f(1.0f, 1.0f, 1.0f)) {} --- 25395,25399 ---- openvrml::event_emitter(static_cast<const field_value &>(*this)), sfvec3f_listener(node), ! exposedfield<openvrml::sfvec3f>(node, make_vec3f(1.0f, 1.0f, 1.0f)) {} *************** *** 25782,25786 **** if (this->transform_dirty) { this->transform_ = ! mat4f::transformation( this->translation_.sfvec3f::value(), this->rotation_.sfrotation::value(), --- 25787,25791 ---- if (this->transform_dirty) { this->transform_ = ! make_transformation_mat4f( this->translation_.sfvec3f::value(), this->rotation_.sfrotation::value(), *************** *** 26326,26330 **** openvrml::event_emitter(static_cast<const field_value &>(*this)), sfvec3f_listener(node), ! exposedfield<openvrml::sfvec3f>(node, vec3f(0.0f, 0.0f, 10.0f)) {} --- 26331,26335 ---- openvrml::event_emitter(static_cast<const field_value &>(*this)), sfvec3f_listener(node), ! exposedfield<openvrml::sfvec3f>(node, make_vec3f(0.0f, 0.0f, 10.0f)) {} *************** *** 26690,26702 **** { if (this->final_transformation_dirty) { ! static const vec3f scale(1.0, 1.0, 1.0); ! static const rotation scaleOrientation; ! static const vec3f center; const mat4f & t = ! mat4f::transformation(this->position_.sfvec3f::value(), ! this->orientation_.sfrotation::value(), ! scale, ! scaleOrientation, ! center); this->final_transformation = t * this->parent_transform; this->final_transformation_dirty = false; --- 26695,26707 ---- { if (this->final_transformation_dirty) { ! static const vec3f scale = make_vec3f(1.0, 1.0, 1.0); ! static const rotation scaleOrientation = make_rotation(); ! static const vec3f center = make_vec3f(); const mat4f & t = ! make_transformation_mat4f(this->position_.sfvec3f::value(), ! this->orientation_.sfrotation::value(), ! scale, ! scaleOrientation, ! center); this->final_transformation = t * this->parent_transform; this->final_transformation_dirty = false; *************** *** 26965,26971 **** abstract_node<visibility_sensor_node>(type, scope), child_node(type, scope), ! center_(*this, vec3f(0.0, 0.0, 0.0)), enabled_(*this, true), ! size_(*this, vec3f(0.0, 0.0, 0.0)), is_active_(false), is_active_emitter_(*this, this->is_active_), --- 26970,26976 ---- abstract_node<visibility_sensor_node>(type, scope), child_node(type, scope), ! center_(*this, make_vec3f(0.0, 0.0, 0.0)), enabled_(*this, true), ! size_(*this, make_vec3f(0.0, 0.0, 0.0)), is_active_(false), is_active_emitter_(*this, this->is_active_), Index: Vrml97Parser.g =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/Vrml97Parser.g,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** Vrml97Parser.g 2 Aug 2006 03:20:02 -0000 1.68 --- Vrml97Parser.g 31 Aug 2006 06:45:30 -0000 1.69 *************** *** 2057,2061 **** } : x=floatValue y=floatValue z=floatValue angle=floatValue { ! vec3f axis(x, y, z); const float axisLength = axis.length(); --- 2057,2061 ---- } : x=floatValue y=floatValue z=floatValue angle=floatValue { ! vec3f axis = make_vec3f(x, y, z); const float axisLength = axis.length(); *************** *** 2069,2073 **** } } ! r = rotation(axis, angle); } ; --- 2069,2073 ---- } } ! r = make_rotation(axis, angle); } ; Index: script.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/script.cpp,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** script.cpp 6 Aug 2006 06:45:24 -0000 1.77 --- script.cpp 31 Aug 2006 06:45:31 -0000 1.78 *************** *** 4780,4786 **** auto_ptr<openvrml::sfcolor> ! sfcolor(new openvrml::sfcolor(openvrml::color(rgb[0], ! rgb[1], ! rgb[2]))); auto_ptr<sfield::sfdata> sfdata(new sfield::sfdata(sfcolor.get())); sfcolor.release(); --- 4780,4786 ---- auto_ptr<openvrml::sfcolor> ! sfcolor(new openvrml::sfcolor(openvrml::make_color(rgb[0], ! rgb[1], ... [truncated message content] |