added float *() operator to Vec{2,3,4} so we can pass Vec3's directly to
OpenGL glVertex?fv().
This commit is contained in:
@@ -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] << " "
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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] << " "
|
||||
|
||||
Reference in New Issue
Block a user