Skip to content

Commit af36cb4

Browse files
authored
ofRectangle changes to avoid including ofVectorMath.h (#8265)
* ofRectangle changes to avoid including ofVectorMath.h * ofPolyline ofVectorMath.h removal * more changes
1 parent c94ef84 commit af36cb4

File tree

6 files changed

+98
-88
lines changed

6 files changed

+98
-88
lines changed

libs/openFrameworks/3d/of3dPrimitives.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "ofVboMesh.h"
1313
#include "ofTexture.h"
1414
#include "of3dUtils.h"
15+
#include "ofVectorMath.h"
1516

1617
using std::vector;
1718
using std::shared_ptr;
@@ -242,11 +243,11 @@ void of3dPrimitive::drawNormals(float length, bool bFaceNormals) const{
242243
if(bFaceNormals) {
243244
for(size_t i = 0; i < normals.size(); i++ ) {
244245
if(i % 3 == 0) {
245-
vert = (vertices[i]+vertices[i+1]+vertices[i+2]) / 3;
246+
vert = (vertices[i]+vertices[i+1]+vertices[i+2]) / 3.0f;
246247
} else if(i % 3 == 1) {
247-
vert = (vertices[i-1]+vertices[i]+vertices[i+1]) / 3;
248+
vert = (vertices[i-1]+vertices[i]+vertices[i+1]) / 3.0f;
248249
} else if ( i % 3 == 2) {
249-
vert = (vertices[i-2]+vertices[i-1]+vertices[i]) / 3;
250+
vert = (vertices[i-2]+vertices[i-1]+vertices[i]) / 3.0f;
250251
}
251252
normalsMesh.setVertex(i*2, vert);
252253
normal = glm::normalize(toGlm(normals[i]));

libs/openFrameworks/3d/ofMesh.inl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44

55
#include "ofAppRunner.h"
66
#include "ofGraphicsBaseTypes.h"
7+
// it can be removed if other PR is merged #8178
78
#include "ofVectorMath.h"
89
#include "ofLog.h"
910
#include "ofColor.h"
1011
#include "ofUtils.h" // ofTo
1112

13+
//#include <glm/gtx/vector_angle.hpp>
14+
1215
#include <unordered_map>
1316

1417
//--------------------------------------------------------------

libs/openFrameworks/3d/ofNode.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#define GLM_FORCE_CTOR_INIT
66
#define GLM_ENABLE_EXPERIMENTAL
77
#include <glm/mat4x4.hpp>
8+
#include "ofVectorMath.h"
89

910
//----------------------------------------
1011
ofNode::ofNode()

libs/openFrameworks/gl/ofVbo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "ofGLUtils.h"
1212
#include "ofMesh.h"
1313
#include "ofGLBaseTypes.h"
14+
#include "ofVec3f.h"
1415

1516
#ifdef TARGET_ANDROID
1617
#include "ofAppAndroidWindow.h"

0 commit comments

Comments
 (0)