Ver a proveniência

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

* Add matrix operators to raymath for C++

* Fix spaces
pull/4410/head
Jeffery Myers há 7 meses
committed by GitHub
ascendente
cometimento
a2fcbc94fd
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: B5690EEEBB952194
1 ficheiros alterados com 34 adições e 0 eliminações
  1. +34
    -0
      src/raymath.h

+ 34
- 0
src/raymath.h Ver ficheiro

@ -2895,6 +2895,40 @@ inline const Quaternion& operator *= (Quaternion& lhs, const Matrix& rhs)
lhs = QuaternionTransform(lhs, rhs);
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

Carregando…
Cancelar
Guardar