-
-template<typename T>
-struct SGVec3Storage {
- /// Readonly raw storage interface
- const T (&data(void) const)[3]
- { return _data; }
- /// Readonly raw storage interface
- T (&data(void))[3]
- { return _data; }
-
- void osg() const
- { }
-
-private:
- T _data[3];
-};
-
-template<>
-struct SGVec3Storage<float> : public osg::Vec3f {
- /// Access raw data by index, the index is unchecked
- const float (&data(void) const)[3]
- { return osg::Vec3f::_v; }
- /// Access raw data by index, the index is unchecked
- float (&data(void))[3]
- { return osg::Vec3f::_v; }
-
- const osg::Vec3f& osg() const
- { return *this; }
- osg::Vec3f& osg()
- { return *this; }
-};
-
-template<>
-struct SGVec3Storage<double> : public osg::Vec3d {
- /// Access raw data by index, the index is unchecked
- const double (&data(void) const)[3]
- { return osg::Vec3d::_v; }
- /// Access raw data by index, the index is unchecked
- double (&data(void))[3]
- { return osg::Vec3d::_v; }
-
- const osg::Vec3d& osg() const
- { return *this; }
- osg::Vec3d& osg()
- { return *this; }
-};