From 747019d0b94741c7015dbb475b196da099ea90b0 Mon Sep 17 00:00:00 2001 From: Don BURNS Date: Tue, 16 Oct 2001 03:59:37 +0000 Subject: [PATCH] added float *() operator to Vec{2,3,4} so we can pass Vec3's directly to OpenGL glVertex?fv(). --- include/osg/Vec2 | 2 ++ include/osg/Vec3 | 2 ++ include/osg/Vec4 | 2 ++ 3 files changed, 6 insertions(+) diff --git a/include/osg/Vec2 b/include/osg/Vec2 index adf1c9638..894dabede 100644 --- a/include/osg/Vec2 +++ b/include/osg/Vec2 @@ -148,6 +148,8 @@ class Vec2 return( norm ); } + inline operator float * (void) { return _v; } + friend inline ostream& operator << (ostream& output, const Vec2& vec) { output << vec._v[0] << " " diff --git a/include/osg/Vec3 b/include/osg/Vec3 index c08f053ce..5c6edaea3 100644 --- a/include/osg/Vec3 +++ b/include/osg/Vec3 @@ -167,6 +167,8 @@ class Vec3 return( norm ); } + inline operator float * (void) { return _v; } + friend inline ostream& operator << (ostream& output, const Vec3& vec); }; // end of class Vec3 diff --git a/include/osg/Vec4 b/include/osg/Vec4 index 2bd0b4735..a26bfe8fc 100644 --- a/include/osg/Vec4 +++ b/include/osg/Vec4 @@ -178,6 +178,8 @@ class Vec4 return( norm ); } + inline operator float * (void) { return _v; } + friend inline ostream& operator << (ostream& output, const Vec4& vec) { output << vec._v[0] << " "