X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fvector.h;h=5a4ffb666c4cc5b3c778fa4358cd41317ce5e6c5;hp=25ebac1180c8fc1cc5dc531f0616e3eefe915589;hb=40e1eba6c489e11a4c9b8865ddcd3ec3d9f83818;hpb=705986ebcdd24573791aa58c7a8f2b7549c918a3 diff --git a/source/vector.h b/source/vector.h index 25ebac11..5a4ffb66 100644 --- a/source/vector.h +++ b/source/vector.h @@ -1,40 +1,13 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2009 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GL_VECTOR_H_ #define MSP_GL_VECTOR_H_ +#include + namespace Msp { namespace GL { -struct Vector4; - -struct Vector3 -{ - float x, y, z; - - Vector3(): x(0), y(0), z(0) { } - Vector3(float x_, float y_, float z_): x(x_), y(y_), z(z_) { } - Vector3(const Vector4 &); -}; - -struct Vector4 -{ - float x, y, z, w; - - Vector4(): x(0), y(0), z(0), w(1) { } - Vector4(float x_, float y_, float z_): x(x_), y(y_), z(z_), w(1) { } - Vector4(float x_, float y_, float z_, float w_): x(x_), y(y_), z(z_), w(w_) { } - Vector4(const Vector3 &v): x(v.x), y(v.y), z(v.z), w(1) { } -}; - -inline Vector3::Vector3(const Vector4 &v): - x(v.x/v.w), y(v.y/v.w), z(v.z/v.w) -{ } +typedef LinAl::Vector Vector3; +typedef LinAl::Vector Vector4; } // namespace GL } // namespace Msp