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

MATH: Change Vector argument in [un]project to const reference #3482

Merged
merged 1 commit into from Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion math/glmath.cpp
Expand Up @@ -25,7 +25,7 @@
namespace Math {

// function based on gluUnProject from Mesa 5.0 glu GPLv2+ licensed sources
bool gluMathUnProject(Vector3d win, const Matrix4 &mvpMatrix, const Common::Rect &viewport, Vector3d &obj) {
bool gluMathUnProject(const Vector3d &win, const Matrix4 &mvpMatrix, const Common::Rect &viewport, Vector3d &obj) {
Matrix4 A;
Vector4d in, out;

Expand Down
4 changes: 2 additions & 2 deletions math/glmath.h
Expand Up @@ -32,7 +32,7 @@ namespace Math {

// function based on gluProject from Mesa 5.0 glu GPLv2+ licensed sources
template<typename T, typename S>
bool gluMathProject(Vector3d obj, const T model[16], const T proj[16], const S viewport[4], Vector3d &win) {
bool gluMathProject(const Vector3d &obj, const T model[16], const T proj[16], const S viewport[4], Vector3d &win) {
Vector4d in, out;
Matrix4 modelMatrix, projMatrix;

Expand Down Expand Up @@ -65,7 +65,7 @@ bool gluMathProject(Vector3d obj, const T model[16], const T proj[16], const S v
return true;
}

bool gluMathUnProject(Vector3d win, const Matrix4 &mvpMatrix, const Common::Rect &viewport, Vector3d &obj);
bool gluMathUnProject(const Vector3d &win, const Matrix4 &mvpMatrix, const Common::Rect &viewport, Vector3d &obj);

Matrix4 makePerspectiveMatrix(double fovy, double aspect, double zNear, double zFar);
Matrix4 makeFrustumMatrix(double left, double right, double bottom, double top, double zNear, double zFar);
Expand Down