added float *() operator to Vec{2,3,4} so we can pass Vec3's directly to

OpenGL glVertex?fv().
This commit is contained in:
Don BURNS
2001-10-16 03:59:37 +00:00
parent de924ca759
commit 747019d0b9
3 changed files with 6 additions and 0 deletions

View File

@@ -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] << " "

View File

@@ -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

View File

@@ -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] << " "