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