X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flinal%2Fvector3.h;h=4a623cafef1443cd194c38efd30351c0ac055c40;hb=6ff13022b53830d35283905d562c2ef3af198cc1;hp=90a5ff5fc468a77ea439b7b5d3e52667ac75ef98;hpb=839a88cd2b9a2f054323627c4e76cdcefc652c63;p=libs%2Fmath.git diff --git a/source/linal/vector3.h b/source/linal/vector3.h index 90a5ff5..4a623ca 100644 --- a/source/linal/vector3.h +++ b/source/linal/vector3.h @@ -14,17 +14,12 @@ class Vector3: public Vector { public: Vector3() { } - Vector3(const T *); + Vector3(const T *d): Vector(d) { } Vector3(T, T, T); template - Vector3(const Vector &); + Vector3(const Vector &v): Vector(v) { } }; -template -inline Vector3::Vector3(const T *d): - Vector(d) -{ } - template inline Vector3::Vector3(T x, T y, T z) { @@ -34,24 +29,18 @@ inline Vector3::Vector3(T x, T y, T z) } template -template -inline Vector3::Vector3(const Vector &v): - Vector(v) -{ } - -template -inline T dot(const Vector3 &v1, const Vector3 &v2) +inline T dot(const Vector &v1, const Vector &v2) { return inner_product(v1, v2); } template -inline Vector3 cross(const Vector3 &v1, const Vector3 &v2) +inline Vector cross(const Vector &v1, const Vector &v2) { - return Vector3(v1[1]*v2[2]-v1[2]*v2[1], v1[2]*v2[0]-v1[0]*v2[2], v1[0]*v2[1]-v1[1]*v2[0]); + return Vector(v1[1]*v2[2]-v1[2]*v2[1], v1[2]*v2[0]-v1[0]*v2[2], v1[0]*v2[1]-v1[1]*v2[0]); } } // namespace LinAl -} // namespace LinAl +} // namespace Msp #endif