Procházet zdrojové kódy

Add matrix3x3 ctor from individual elements

Daniele Bartolini před 10 roky
rodič
revize
a1b0dee204
1 změnil soubory, kde provedl 18 přidání a 0 odebrání
  1. 18 0
      src/core/math/matrix3x3.h

+ 18 - 0
src/core/math/matrix3x3.h

@@ -13,6 +13,24 @@ namespace crown
 /// @addtogroup Math
 /// @addtogroup Math
 /// @{
 /// @{
 
 
+/// Returns a new matrix from individual elements.
+inline Matrix3x3 matrix3x3(f32 xx, f32 xy, f32 xz, f32 yx, f32 yy, f32 yz, f32 zx, f32 zy, f32 zz)
+{
+	Matrix3x3 m;
+	m.x.x = xx;
+	m.x.y = xy;
+	m.x.z = xz;
+
+	m.y.x = yx;
+	m.y.y = yy;
+	m.y.z = yz;
+
+	m.z.x = zx;
+	m.z.y = zy;
+	m.z.z = zz;
+	return m;
+}
+
 /// Returns a new matrix from axes @a x, @a y and @a z.
 /// Returns a new matrix from axes @a x, @a y and @a z.
 inline Matrix3x3 matrix3x3(const Vector3& x, const Vector3& y, const Vector3& z)
 inline Matrix3x3 matrix3x3(const Vector3& x, const Vector3& y, const Vector3& z)
 {
 {