We might need to multiply for some non-transition matrix.
Change-Id: I5a8aa02ce8c1e68b623aea07d9e7540f7074368f
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
END_TEST;
}
+int UtcDaliMatrix3OperatorMultiply01P(void)
+{
+ Vector3 v1(2.0f, 5.0f, 4.0f);
+
+ Vector3 v2 = m1 * v1;
+ Vector3 r1(-37.2f, 118.8f, 13.2f);
+ DALI_TEST_EQUALS(v2, r1, 0.01f, TEST_LOCATION);
+ END_TEST;
+}
+
+int UtcDaliMatrix3OperatorMultiply02P(void)
+{
+ Vector3 v1(2.0f, 5.0f, 4.0f);
+
+ Vector3 v2 = m6 * v1;
+ Vector3 r1(88.668f, 35.2f, -340.65f);
+ DALI_TEST_EQUALS(v2, r1, 0.01f, TEST_LOCATION);
+ END_TEST;
+}
+
int UtcDaliMatrix3EqualityOperator(void)
{
Matrix3 m1(0.0f, 3.0f, 6.0f, 12.0f, 15.0f, 18.0f, 24.0f, 27.0f, 30.0f);
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
+Vector3 Matrix3::operator*(const Vector3& rhs) const
+{
+ return Vector3(rhs.x * mElements[S00] + rhs.y * mElements[S10] + rhs.z * mElements[S20],
+ rhs.x * mElements[S01] + rhs.y * mElements[S11] + rhs.z * mElements[S21],
+ rhs.x * mElements[S02] + rhs.y * mElements[S12] + rhs.z * mElements[S22]);
+}
+
bool Matrix3::operator==(const Matrix3& rhs) const
{
return (
#define DALI_MATRIX3_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
static void Multiply(Matrix3& result, const Matrix3& lhs, const Matrix3& rhs);
+ /**
+ * @brief The multiplication operator.
+ *
+ * Returned Vector = This Matrix * rhs
+ *
+ * @SINCE_2_1.34
+ * @param[in] rhs The Vector3 to multiply this by
+ * @return A Vector3 containing the result
+ */
+ Vector3 operator*(const Vector3& rhs) const;
+
private:
float mElements[9]; ///< The elements of the matrix
};