diff --git a/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h b/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h index 0070ffb38..673925643 100644 --- a/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h +++ b/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h @@ -43,7 +43,7 @@ template <> inline CPlaneBasis PSBinOpModulate(const CPlaneBasis &p1, const CPlaneBasis &p2) { // we compute p1 * p2 - NLMISC::CVector z = p1.X ^ p1.Y; + NLMISC::CVector z = CVector(p1.X) ^ CVector(p1.Y); CPlaneBasis r; r.X.x = p2.X.x * p1.X.x + p2.X.y * p1.Y.x + p2.X.z * z.x; r.X.y = p2.X.x * p1.X.y + p2.X.y * p1.Y.y + p2.X.z * z.y; diff --git a/code/nel/include/nel/3d/ps_plane_basis.h b/code/nel/include/nel/3d/ps_plane_basis.h index 41882e148..2c8fd07c4 100644 --- a/code/nel/include/nel/3d/ps_plane_basis.h +++ b/code/nel/include/nel/3d/ps_plane_basis.h @@ -37,8 +37,8 @@ namespace NL3D { struct CPlaneBasis { - NLMISC::CVector X ; - NLMISC::CVector Y ; + NLMISC::CVectorPacked X ; + NLMISC::CVectorPacked Y ; // default ctor @@ -62,7 +62,7 @@ struct CPlaneBasis /// compute the normal of the plane basis NLMISC::CVector getNormal(void) const { - return X ^ Y ; + return CVector(X) ^ CVector(Y) ; } diff --git a/code/nel/include/nel/misc/vector.h b/code/nel/include/nel/misc/vector.h index f9667e1c7..1d4ef3fe4 100644 --- a/code/nel/include/nel/misc/vector.h +++ b/code/nel/include/nel/misc/vector.h @@ -212,6 +212,34 @@ public: { return CVector(*this) - v; } + + bool operator==(const CVectorPacked &v) const + { + return x==v.x && y==v.y && z==v.z; + } + bool operator!=(const CVectorPacked &v) const + { + return !(*this==v); + } + bool operator<(const CVectorPacked &v) const + { + if(x!=v.x) + return xX * CPSUtil::getCos((sint32) *ptCurrAngle) + ptBasis->Y * CPSUtil::getSin((sint32) *ptCurrAngle) - , ptBasis->X * CPSUtil::getCos((sint32) *ptCurrAngle + 64) + ptBasis->Y * CPSUtil::getSin((sint32) *ptCurrAngle + 64) + mat.setRot( CVector(ptBasis->X) * CPSUtil::getCos((sint32) *ptCurrAngle) + CVector(ptBasis->Y) * CPSUtil::getSin((sint32) *ptCurrAngle) + , CVector(ptBasis->X) * CPSUtil::getCos((sint32) *ptCurrAngle + 64) + CVector(ptBasis->Y) * CPSUtil::getSin((sint32) *ptCurrAngle + 64) , ptBasis->X ^ ptBasis->Y );