Skip to content
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