diff --git a/include/nif_math.h b/include/nif_math.h index 36044cc19a5a179c55b79f102498afa9aecf4b0e..2d253af98e020227b449985580c12c75c55f308e 100644 --- a/include/nif_math.h +++ b/include/nif_math.h @@ -197,6 +197,16 @@ struct NIFLIB_API Vector3 { */ Vector3 & operator*=( const float & rh ); + /* Multiplies a vector by a vector using the dot product + * \return The dot product of the two vectors. + */ + float operator*( const Vector3 & v ) const; + + /* Multiplies a vector by a vector using the cross product + * \return The cross product of the two vectors. + */ + Vector3 operator^( const Vector3 & v ) const; + /* Allows scaler division, that is dividing all components of the * vector, x, y and z, by the same number. * \return The result of the division. diff --git a/src/nif_math.cpp b/src/nif_math.cpp index 91023cf664cf71a4c7275389caf87a052887227e..7ee458b2fb9b5c4547fd8008943209952ef2e120 100644 --- a/src/nif_math.cpp +++ b/src/nif_math.cpp @@ -88,6 +88,14 @@ Vector3 & Vector3::operator*=( const float & rh) { return *this; } +float Vector3::operator*( const Vector3 & v ) const { + return DotProduct(v); +} + +Vector3 Vector3::operator^( const Vector3 & v ) const { + return CrossProduct(v); +} + Vector3 Vector3::operator/( const float & rh ) const { Vector3 v(*this); v /= rh; diff --git a/src/obj/NiTriBasedGeom.cpp b/src/obj/NiTriBasedGeom.cpp index e3116f68e48de4a5a4332f6d505236d05866bb11..6cbc30a9d92f5d1f349f6bf9aab4aa93306ce301 100644 --- a/src/obj/NiTriBasedGeom.cpp +++ b/src/obj/NiTriBasedGeom.cpp @@ -431,10 +431,6 @@ void NiTriBasedGeom::UpdateTangentSpace() { vector<Vector3> tangents( verts.size() ); vector<Vector3> binormals( verts.size() ); - int dups = 0; - - multimap<int, int> vmap; - for( int t = 0; t < (int)tris.size(); t++ ) { Triangle & tri = tris[t];