ofxmotiontracker ofxaddon 的编译错误
compiling errors of ofxmotiontracker ofxaddon
我正在尝试将 ofxMotionTracker 插件用于 openframeworks。
我正在 linux 64 架构的代码块中构建它。
构建时我在 ofCircleSlice.cpp
中遇到编译错误
void ofCircleSlice(float x,float y, float radius, float lowAngle, float highAngle, bool closed, bool radians){
if (!bSetupCircle) setupCircle();
// use smoothness, if requested:
if (bSmoothHinted && drawMode == OF_OUTLINE) startSmoothing();
bool angleWrap = (lowAngle > highAngle); // are we doing the 0/360 wrap?
if(!radians){
lowAngle = ofDegToRad(lowAngle);
highAngle = ofDegToRad(highAngle);
}
int res = numCirclePts;
float angle = lowAngle;
float angleRange = ((!angleWrap)?(highAngle - lowAngle):(M_TWO_PI - lowAngle + highAngle));
float angleAdder = angleRange / (float)res;
int k = 0;
for (int i = 0; i < numCirclePts; i++){
circlePtsScaled[k] = x + cos(angle) * radius;
circlePtsScaled[k+1] = y - sin(angle) * radius;
angle += angleAdder;
k+=2;
}
// we draw the circle points ourself (vs. glDrawArrays) because it allows us to draw the center point, and have the triangles fan around it
k = 0;
glBegin((drawMode == OF_FILLED) ? GL_TRIANGLE_FAN : (closed?GL_LINE_LOOP:GL_LINE_STRIP));
glVertex2f(x, y); // center vertex
// now all the points around the circumference
for (int i = 0; i < numCirclePts; i++){
glVertex2f(circlePtsScaled[k], circlePtsScaled[k+1]);
k+=2;
}
glEnd();
// back to normal, if smoothness is on
if (bSmoothHinted && drawMode == OF_OUTLINE) endSmoothing();
};
获得的错误是:
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp||In
function ‘void ofCircleSlice(float, float, float, float, float, bool,
bool)’:|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|6|error:
‘bSetupCircle’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|6|error:
‘setupCircle’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|9|error:
‘bSmoothHinted’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|9|error:
‘drawMode’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|9|error:
‘startSmoothing’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|18|error:
‘numCirclePts’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|24|error:
‘circlePtsScaled’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|32|error:
‘drawMode’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|37|error:
‘circlePtsScaled’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|43|error:
‘bSmoothHinted’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|43|error:
‘endSmoothing’ was not declared in this scope|
||=== Build finished: 11 errors, 0 warnings ===|
我是不是漏掉了一些非常明显的东西。
谢谢
用以下代码替换了 ofCircleSlice 函数
ofPath tArcPath;
tArcPath.setArcResolution(360);
tArcPath.arc(x, y, radius, radius, lowAngle, highAngle);
tArcPath.draw();
没有构建错误并且工作正常
我正在尝试将 ofxMotionTracker 插件用于 openframeworks。 我正在 linux 64 架构的代码块中构建它。
构建时我在 ofCircleSlice.cpp
中遇到编译错误void ofCircleSlice(float x,float y, float radius, float lowAngle, float highAngle, bool closed, bool radians){
if (!bSetupCircle) setupCircle();
// use smoothness, if requested:
if (bSmoothHinted && drawMode == OF_OUTLINE) startSmoothing();
bool angleWrap = (lowAngle > highAngle); // are we doing the 0/360 wrap?
if(!radians){
lowAngle = ofDegToRad(lowAngle);
highAngle = ofDegToRad(highAngle);
}
int res = numCirclePts;
float angle = lowAngle;
float angleRange = ((!angleWrap)?(highAngle - lowAngle):(M_TWO_PI - lowAngle + highAngle));
float angleAdder = angleRange / (float)res;
int k = 0;
for (int i = 0; i < numCirclePts; i++){
circlePtsScaled[k] = x + cos(angle) * radius;
circlePtsScaled[k+1] = y - sin(angle) * radius;
angle += angleAdder;
k+=2;
}
// we draw the circle points ourself (vs. glDrawArrays) because it allows us to draw the center point, and have the triangles fan around it
k = 0;
glBegin((drawMode == OF_FILLED) ? GL_TRIANGLE_FAN : (closed?GL_LINE_LOOP:GL_LINE_STRIP));
glVertex2f(x, y); // center vertex
// now all the points around the circumference
for (int i = 0; i < numCirclePts; i++){
glVertex2f(circlePtsScaled[k], circlePtsScaled[k+1]);
k+=2;
}
glEnd();
// back to normal, if smoothness is on
if (bSmoothHinted && drawMode == OF_OUTLINE) endSmoothing();
};
获得的错误是:
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp||In
function ‘void ofCircleSlice(float, float, float, float, float, bool, bool)’:|../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|6|error: ‘bSetupCircle’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|6|error: ‘setupCircle’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|9|error: ‘bSmoothHinted’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|9|error: ‘drawMode’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|9|error: ‘startSmoothing’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|18|error: ‘numCirclePts’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|24|error: ‘circlePtsScaled’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|32|error: ‘drawMode’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|37|error: ‘circlePtsScaled’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|43|error: ‘bSmoothHinted’ was not declared in this scope|
../../../addons/ofxMotionTracker-master/src/ofCircleSlice.cpp|43|error: ‘endSmoothing’ was not declared in this scope|
||=== Build finished: 11 errors, 0 warnings ===|
我是不是漏掉了一些非常明显的东西。 谢谢
用以下代码替换了 ofCircleSlice 函数
ofPath tArcPath;
tArcPath.setArcResolution(360);
tArcPath.arc(x, y, radius, radius, lowAngle, highAngle);
tArcPath.draw();
没有构建错误并且工作正常