Skip to content

ofRectangle changes to avoid including ofVectorMath.h #8265

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

Merged
merged 3 commits into from
Feb 25, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions libs/openFrameworks/3d/of3dPrimitives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "ofVboMesh.h"
#include "ofTexture.h"
#include "of3dUtils.h"
#include "ofVectorMath.h"

using std::vector;
using std::shared_ptr;
Expand Down Expand Up @@ -242,11 +243,11 @@ void of3dPrimitive::drawNormals(float length, bool bFaceNormals) const{
if(bFaceNormals) {
for(size_t i = 0; i < normals.size(); i++ ) {
if(i % 3 == 0) {
vert = (vertices[i]+vertices[i+1]+vertices[i+2]) / 3;
vert = (vertices[i]+vertices[i+1]+vertices[i+2]) / 3.0f;
} else if(i % 3 == 1) {
vert = (vertices[i-1]+vertices[i]+vertices[i+1]) / 3;
vert = (vertices[i-1]+vertices[i]+vertices[i+1]) / 3.0f;
} else if ( i % 3 == 2) {
vert = (vertices[i-2]+vertices[i-1]+vertices[i]) / 3;
vert = (vertices[i-2]+vertices[i-1]+vertices[i]) / 3.0f;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah good idea to force the float!

}
normalsMesh.setVertex(i*2, vert);
normal = glm::normalize(toGlm(normals[i]));
Expand Down
3 changes: 3 additions & 0 deletions libs/openFrameworks/3d/ofMesh.inl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

#include "ofAppRunner.h"
#include "ofGraphicsBaseTypes.h"
// it can be removed if other PR is merged #8178
#include "ofVectorMath.h"
#include "ofLog.h"
#include "ofColor.h"
#include "ofUtils.h" // ofTo

//#include <glm/gtx/vector_angle.hpp>

#include <unordered_map>

//--------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions libs/openFrameworks/3d/ofNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#define GLM_FORCE_CTOR_INIT
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/mat4x4.hpp>
#include "ofVectorMath.h"

//----------------------------------------
ofNode::ofNode()
Expand Down
1 change: 1 addition & 0 deletions libs/openFrameworks/gl/ofVbo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "ofGLUtils.h"
#include "ofMesh.h"
#include "ofGLBaseTypes.h"
#include "ofVec3f.h"

#ifdef TARGET_ANDROID
#include "ofAppAndroidWindow.h"
Expand Down
Loading