瀏覽代碼

[Raymath] Add matrix operators to raymath for C++ (#4409)

* Add matrix operators to raymath for C++

* Fix spaces
pull/4410/head
Jeffery Myers 6 月之前
committed by GitHub
父節點
當前提交
a2fcbc94fd
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: B5690EEEBB952194
共有 1 個檔案被更改,包括 34 行新增0 行删除
  1. +34
    -0
      src/raymath.h

+ 34
- 0
src/raymath.h 查看文件

@ -2895,6 +2895,40 @@ inline const Quaternion& operator *= (Quaternion& lhs, const Matrix& rhs)
lhs = QuaternionTransform(lhs, rhs); lhs = QuaternionTransform(lhs, rhs);
return lhs; return lhs;
} }
// Matrix operators
inline Matrix operator + (const Matrix& lhs, const Matrix& rhs)
{
return MatrixAdd(lhs, rhs);
}
inline const Matrix& operator += (Matrix& lhs, const Matrix& rhs)
{
lhs = MatrixAdd(lhs, rhs);
return lhs;
}
inline Matrix operator - (const Matrix& lhs, const Matrix& rhs)
{
return MatrixSubtract(lhs, rhs);
}
inline const Matrix& operator -= (Matrix& lhs, const Matrix& rhs)
{
lhs = MatrixSubtract(lhs, rhs);
return lhs;
}
inline Matrix operator * (const Matrix& lhs, const Matrix& rhs)
{
return MatrixMultiply(lhs, rhs);
}
inline const Matrix& operator *= (Matrix& lhs, const Matrix& rhs)
{
lhs = MatrixMultiply(lhs, rhs);
return lhs;
}
//------------------------------------------------------------------------------- //-------------------------------------------------------------------------------
#endif // C++ operators #endif // C++ operators

||||||
x
 
000:0
Loading…
取消
儲存