-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
glm transition - deprecations implicit conversions, remove implicit conversions from the core. #5594
base: master
Are you sure you want to change the base?
glm transition - deprecations implicit conversions, remove implicit conversions from the core. #5594
Changes from 2 commits
e6a9049
6e0a305
a2119d4
7cab04f
7429244
b0b88c6
95f7639
4fc3947
a5587a6
f9780d3
6947da8
ffef601
e12e051
a5401f3
a6adf47
9ac4452
4523394
af6f0c6
a179a80
392bcf9
95d31be
c26e868
39fdbba
e3202a4
be2c3bb
3c4d8c5
3ae16bc
a84b697
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,9 +132,9 @@ void ofNode::setParent(ofNode& parent, bool bMaintainGlobalTransform) { | |
clearParent(bMaintainGlobalTransform); | ||
} | ||
if(bMaintainGlobalTransform) { | ||
auto postParentPosition = position - parent.getGlobalPosition(); | ||
auto postParentPosition = position.get() - parent.getGlobalPosition(); | ||
auto postParentOrientation = orientation.get() * glm::inverse(parent.getGlobalOrientation()); | ||
auto postParentScale = scale / parent.getGlobalScale(); | ||
auto postParentScale = scale.get() / parent.getGlobalScale(); | ||
parent.addListener(*this); | ||
setOrientation(postParentOrientation); | ||
setPosition(postParentPosition); | ||
|
@@ -597,7 +597,7 @@ void ofNode::orbitDeg(float longitude, float latitude, float radius, const glm:: | |
p = q * p; // rotate p on unit sphere based on quaternion | ||
p = p * radius; // scale p by radius from its position on unit sphere | ||
|
||
setGlobalPosition(centerPoint + p); | ||
setGlobalPosition(centerPoint + p.xyz()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this, an intermediate ofVec3f conversion was being used. |
||
setOrientation(q); | ||
|
||
onOrientationChanged(); | ||
|
@@ -620,7 +620,7 @@ void ofNode::orbitRad(float longitude, float latitude, float radius, const glm:: | |
p = q * p; // rotate p on unit sphere based on quaternion | ||
p = p * radius; // scale p by radius from its position on unit sphere | ||
|
||
setGlobalPosition(centerPoint + p); | ||
setGlobalPosition(centerPoint + p.xyz()); | ||
setOrientation(q); | ||
|
||
onOrientationChanged(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -756,7 +756,7 @@ void ofAppGLFWWindow::setFullscreen(bool fullscreen){ | |
GLFWmonitor** monitors = glfwGetMonitors(&monitorCount); | ||
|
||
int currentMonitor = getCurrentMonitor(); | ||
ofVec3f screenSize = getScreenSize(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leftover ofVec. |
||
auto screenSize = getScreenSize(); | ||
|
||
if( orientation == OF_ORIENTATION_90_LEFT || orientation == OF_ORIENTATION_90_RIGHT ){ | ||
std::swap(screenSize.x, screenSize.y); | ||
|
@@ -811,8 +811,7 @@ void ofAppGLFWWindow::setFullscreen(bool fullscreen){ | |
|
||
// make sure to save current pos if not specified in settings | ||
if( settings.isPositionSet() ) { | ||
ofVec3f pos = getWindowPosition(); | ||
settings.setPosition(ofVec2f(pos.x, pos.y)); | ||
settings.setPosition(getWindowPosition()); | ||
} | ||
|
||
//make sure the window is getting the mouse/key events | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1138,14 +1138,14 @@ void ofVertices( const vector <glm::vec2> & polyPoints ){ | |
//---------------------------------------------------------- | ||
void ofVertices( const vector <ofVec3f> & polyPoints ){ | ||
for( const auto & p: polyPoints ){ | ||
ofGetCurrentRenderer()->getPath().lineTo(p); | ||
ofGetCurrentRenderer()->getPath().lineTo(glm::vec3(p.x, p.y, p.z)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use explicit conversions throughout. |
||
} | ||
} | ||
|
||
//---------------------------------------------------------- | ||
void ofVertices( const vector <ofVec2f> & polyPoints ){ | ||
for( const auto & p: polyPoints ){ | ||
ofGetCurrentRenderer()->getPath().lineTo(p); | ||
ofGetCurrentRenderer()->getPath().lineTo(glm::vec3(p.x, p.y, 0.0)); | ||
} | ||
} | ||
|
||
|
@@ -1176,14 +1176,14 @@ void ofCurveVertices( const vector <glm::vec2> & curvePoints){ | |
//---------------------------------------------------------- | ||
void ofCurveVertices( const vector <ofVec3f> & curvePoints){ | ||
for( const auto & p: curvePoints ){ | ||
ofGetCurrentRenderer()->getPath().curveTo(p); | ||
ofGetCurrentRenderer()->getPath().curveTo(glm::vec3(p.x, p.y, p.z)); | ||
} | ||
} | ||
|
||
//---------------------------------------------------------- | ||
void ofCurveVertices( const vector <ofVec2f> & curvePoints){ | ||
for( const auto & p: curvePoints ){ | ||
ofGetCurrentRenderer()->getPath().curveTo(p); | ||
ofGetCurrentRenderer()->getPath().curveTo(glm::vec3(p.x, p.y, 0.0)); | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,11 +42,11 @@ class ofMatrix3x3 { | |
float _g=0.0, float _h=0.0, float _i=0.0 ); | ||
|
||
|
||
ofMatrix3x3( const glm::mat3 & mat) { | ||
OF_DEPRECATED_MSG("Use glm::mat3.", ofMatrix3x3( const glm::mat3 & mat)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Encourage the use of glm::* without breaking things. |
||
*this = reinterpret_cast<const ofMatrix3x3&>(mat); | ||
} | ||
|
||
operator glm::mat3(){ | ||
OF_DEPRECATED_MSG("Use glm::mat3.", operator glm::mat3()) { | ||
return *reinterpret_cast<glm::mat3*>(this); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,88 +243,88 @@ namespace glm { | |
|
||
//-------------------------------------------------------------- | ||
inline glm::vec3 operator+(const glm::vec3 & v1, const ofVec3f & v2){ | ||
return v1 + glm::vec3(v2); | ||
return v1 + glm::vec3(v2.x, v2.y, v2.z); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove implicit conversions. |
||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec3 operator-(const glm::vec3 & v1, const ofVec3f & v2){ | ||
return v1 - glm::vec3(v2); | ||
return v1 - glm::vec3(v2.x, v2.y, v2.z); | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec3 operator*(const glm::vec3 & v1, const ofVec3f & v2){ | ||
return v1 * glm::vec3(v2); | ||
return v1 * glm::vec3(v2.x, v2.y, v2.z); | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec3 operator/(const glm::vec3 & v1, const ofVec3f & v2){ | ||
return v1 / glm::vec3(v2); | ||
return v1 / glm::vec3(v2.x, v2.y, v2.z); | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec3 & operator+=(glm::vec3 & v1, const ofVec3f & v2){ | ||
v1 += glm::vec3(v2); | ||
v1 += glm::vec3(v2.x, v2.y, v2.z); | ||
return v1; | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec3 & operator-=(glm::vec3 & v1, const ofVec3f & v2){ | ||
v1 -= glm::vec3(v2); | ||
v1 -= glm::vec3(v2.x, v2.y, v2.z); | ||
return v1; | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec3 & operator*=(glm::vec3 & v1, const ofVec3f & v2){ | ||
v1 *= glm::vec3(v2); | ||
v1 *= glm::vec3(v2.x, v2.y, v2.z); | ||
return v1; | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec3 & operator/=(glm::vec3 & v1, const ofVec3f & v2){ | ||
v1 /= glm::vec3(v2); | ||
v1 /= glm::vec3(v2.x, v2.y, v2.z); | ||
return v1; | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec2 operator+(const glm::vec2 & v1, const ofVec2f & v2){ | ||
return v1 + glm::vec2(v2); | ||
return v1 + glm::vec2(v2.x, v2.y); | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec2 operator-(const glm::vec2 & v1, const ofVec2f & v2){ | ||
return v1 - glm::vec2(v2); | ||
return v1 - glm::vec2(v2.x, v2.y); | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec2 operator*(const glm::vec2 & v1, const ofVec2f & v2){ | ||
return v1 * glm::vec2(v2); | ||
return v1 * glm::vec2(v2.x, v2.y); | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec2 operator/(const glm::vec2 & v1, const ofVec2f & v2){ | ||
return v1 / glm::vec2(v2); | ||
return v1 / glm::vec2(v2.x, v2.y); | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec2 & operator+=(glm::vec2 & v1, const ofVec2f & v2){ | ||
v1 += glm::vec2(v2); | ||
v1 += glm::vec2(v2.x, v2.y); | ||
return v1; | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec2 & operator-=(glm::vec2 & v1, const ofVec2f & v2){ | ||
v1 -= glm::vec2(v2); | ||
v1 -= glm::vec2(v2.x, v2.y); | ||
return v1; | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec2 & operator*=(glm::vec2 & v1, const ofVec2f & v2){ | ||
v1 *= glm::vec2(v2); | ||
v1 *= glm::vec2(v2.x, v2.y); | ||
return v1; | ||
} | ||
|
||
//-------------------------------------------------------------- | ||
inline glm::vec2 & operator/=(glm::vec2 & v1, const ofVec2f & v2){ | ||
v1 /= glm::vec2(v2); | ||
v1 /= glm::vec2(v2.x, v2.y); | ||
return v1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this, an intermediate ofVec3f conversion was being used.