Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix on matrix multiplication #124

Open
wants to merge 1 commit into
base: infinitam_v3.5
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ORUtils/Matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ namespace ORUtils {
return r;
}

// scalar * mat4
_CPU_AND_GPU_CODE_ inline friend Matrix4 operator * (const T &scalar, const Matrix4 &rhs) {
return rhs * scalar;
}

_CPU_AND_GPU_CODE_ inline friend Matrix4 operator / (const Matrix4 &lhs, const T &rhs) {
Matrix4 r;
for (int i = 0; i < 16; i++) r.m[i] = lhs.m[i] / rhs;
Expand Down Expand Up @@ -297,6 +302,11 @@ namespace ORUtils {
return r;
}

// scalar * mat3
_CPU_AND_GPU_CODE_ inline friend Matrix3 operator * (const T &scalar, const Matrix3 &rhs) {
return rhs * scalar;
}

_CPU_AND_GPU_CODE_ inline friend Matrix3 operator + (const Matrix3 &lhs, const Matrix3 &rhs) {
Matrix3 res(lhs.m);
return res += rhs;
Expand Down