[Scummvm-git-logs] scummvm master -> dcce1f670d18a880eae639ecb2ea0387b1e92a02

aquadran noreply at scummvm.org
Sun Dec 26 17:44:55 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
dcce1f670d MATH: Implement vector3d and matrix3 multiplication


Commit: dcce1f670d18a880eae639ecb2ea0387b1e92a02
    https://github.com/scummvm/scummvm/commit/dcce1f670d18a880eae639ecb2ea0387b1e92a02
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2021-12-26T18:44:49+01:00

Commit Message:
MATH: Implement vector3d and matrix3 multiplication

Changed paths:
    math/vector3d.h


diff --git a/math/vector3d.h b/math/vector3d.h
index ca9cf889fb..9ca7453dff 100644
--- a/math/vector3d.h
+++ b/math/vector3d.h
@@ -63,6 +63,18 @@ public:
 	 */
 	Angle unitCircleAngle() const;
 
+	/**
+	 * Multiply vector XYZ with Matrix 3x3
+	 *
+	 * @return	The result of multiplication
+	 */
+	inline Vector3d operator*(const MatrixType<3, 3> &m) const {
+		const float *d = m.getData();
+		return Vector3d(x() * d[0] + y() * d[3] + z() * d[6],
+				x() * d[1] + y() * d[4] + z() * d[7],
+				x() * d[2] + y() * d[5] + z() * d[8]);
+	}
+
 	/**
 	 * Find the cross product between two vectors
 	 * @param v1	The first vector




More information about the Scummvm-git-logs mailing list