我正在尝试使用forxMotionTracker为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();
};
获得的错误是:
../../../附加元件/ ofxMotionTracker主/ SRC / ofCircleSlice.cpp ||在
function'void ofCircleSlice(float,float,float,float,float,bool, 布尔)”:|../../../附加元件/ ofxMotionTracker主/ SRC / ofCircleSlice.cpp | 6 |错误: 'bSetupCircle'未在此范围|
中声明../../../附加元件/ ofxMotionTracker主/ SRC / ofCircleSlice.cpp | 6 |错误: 'setupCircle'未在此范围|
中声明../../../附加元件/ ofxMotionTracker主/ SRC / ofCircleSlice.cpp | 9 |错误: 'bSmoothHinted'未在此范围声明|
../../../附加元件/ ofxMotionTracker主/ SRC / ofCircleSlice.cpp | 9 |错误: 'drawMode'未在此范围|
中声明../../../附加元件/ ofxMotionTracker主/ SRC / ofCircleSlice.cpp | 9 |错误: 未在此范围|
中声明'startSmoothing'../../../附加元件/ ofxMotionTracker主/ SRC / ofCircleSlice.cpp | 18 |错误: 'numCirclePts'未在此范围|
中声明../../../附加元件/ ofxMotionTracker主/ SRC / ofCircleSlice.cpp | 24 |错误: 'circlePtsScaled'未在此范围|
中声明../../../附加元件/ ofxMotionTracker主/ SRC / ofCircleSlice.cpp | 32 |错误: 'drawMode'未在此范围|
中声明../../../附加元件/ ofxMotionTracker主/ SRC / ofCircleSlice.cpp | 37 |错误: 'circlePtsScaled'未在此范围|
中声明../../../附加元件/ ofxMotionTracker主/ SRC / ofCircleSlice.cpp | 43 |错误: 'bSmoothHinted'未在此范围声明|
../../../附加元件/ ofxMotionTracker主/ SRC / ofCircleSlice.cpp | 43 |错误: 'endSmoothing'未在此范围中声明
|| ===构建完成:11个错误,0个警告=== |
我错过了一些非常明显的东西。 感谢
答案 0 :(得分:0)
用以下代码替换了CircleSlice函数
ofPath tArcPath;
tArcPath.setArcResolution(360);
tArcPath.arc(x, y, radius, radius, lowAngle, highAngle);
tArcPath.draw();
没有构建错误&amp;工作得很好