Skip to content

Commit c21d6c1

Browse files
authored
Merge branch 'master' into hs8
2 parents 38dbef0 + 07590eb commit c21d6c1

File tree

114 files changed

+909
-787
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+909
-787
lines changed

.github/workflows/build-msys2.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ jobs:
4141
- uses: msys2/setup-msys2@v2
4242
with:
4343
cache: true
44+
release: true
4445
update: false
4546
msystem: ${{matrix.msystem}}
46-
pacboy: assimp:p cairo:p curl:p freeglut:p FreeImage:p gcc:p gdb:p glew:p glfw:p glm:p harfbuzz:p libsndfile:p libusb:p libxml2:p mpg123:p nlohmann-json:p ntldd-git:p openal:p opencv:p pkgconf:p pugixml:p rtaudio:p uriparser:p utf8cpp:p zlib:p poco:p
47+
pacboy: gcc:p assimp:p cairo:p curl:p freeglut:p FreeImage:p glew:p glfw:p glm:p libsndfile:p libusb:p libxml2:p mpg123:p nlohmann-json:p openal:p opencv:p pugixml:p rtaudio:p uriparser:p utf8cpp:p
48+
install: >-
49+
unzip
50+
make
51+
# gcc:p gdb:p zlib:p poco:p pkgconf:p harfbuzz:p ntldd-git:p
4752
# boost:p tools:p
4853
# install: >-
4954
# unzip
@@ -60,3 +65,4 @@ jobs:
6065
- name: Run tests
6166
run: ./scripts/ci/msys2/run_tests.sh
6267

68+

addons/ofxAccelerometer/src/ofxAccelerometer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ class ofxAccelerometerHandler {
140140
if(!orientDirty) return;
141141
orientDirty = false;
142142

143-
orientation.x = atan2(accelOrientation.y, -accelOrientation.z) * RAD_TO_DEG;
144-
orientation.y = atan2(accelOrientation.x, -accelOrientation.z) * RAD_TO_DEG;
143+
orientation.x = glm::degrees( atan2(accelOrientation.y, -accelOrientation.z) );
144+
orientation.y = glm::degrees( atan2(accelOrientation.x, -accelOrientation.z) );
145145
orientation.z = 0;
146146
}
147147

addons/ofxAssimpModelLoader/src/ofxAssimpAnimation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void ofxAssimpAnimation::update() {
5656
position = 1.0;
5757
stop();
5858
} else if(position > 1.0 && loopType == OF_LOOP_NORMAL) {
59-
position = fmod(position, 1.0f);
59+
position = std::fmod(position, 1.0f);
6060
} else if(position > 1.0 && loopType == OF_LOOP_PALINDROME) {
6161
speedFactor *= -1;
6262
} else if(position < 0.0 && loopType == OF_LOOP_PALINDROME) {

addons/ofxAssimpModelLoader/src/ofxAssimpModelLoader.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void ofxAssimpModelLoader::calculateDimensions(){
219219
normalizedScale = scene_max.x-scene_min.x;
220220
normalizedScale = std::max(double(scene_max.y - scene_min.y), normalizedScale);
221221
normalizedScale = std::max(double(scene_max.z - scene_min.z), normalizedScale);
222-
if (fabs(normalizedScale) < std::numeric_limits<float>::epsilon()){
222+
if (std::abs(normalizedScale) < std::numeric_limits<float>::epsilon()){
223223
ofLogWarning("ofxAssimpModelLoader") << "Error calculating normalized scale of scene" << std::endl;
224224
normalizedScale = 1.0;
225225
} else {
@@ -749,6 +749,12 @@ void ofxAssimpModelLoader::setPositionForAllAnimations(float position) {
749749
}
750750
}
751751

752+
void ofxAssimpModelLoader::setSpeedForAllAnimations(float speed) {
753+
for (auto & a : animations) {
754+
a.setSpeed(speed);
755+
}
756+
}
757+
752758
// DEPRECATED.
753759
void ofxAssimpModelLoader::setAnimation(int animationIndex) {
754760
if(!hasAnimations()) {

addons/ofxAssimpModelLoader/src/ofxAssimpModelLoader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ class ofxAssimpModelLoader{
7676
void setPausedForAllAnimations(bool pause);
7777
void setLoopStateForAllAnimations(ofLoopType state);
7878
void setPositionForAllAnimations(float position);
79+
void setSpeedForAllAnimations(float speed);
80+
7981
[[deprecated("Use ofxAssimpAnimation")]]
8082
void setAnimation(int animationIndex);
8183
[[deprecated("Use ofxAssimpAnimation")]]

addons/ofxGui/src/ofxColorPicker.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ PolCord getPolarCoordinate(const glm::vec2 & p, float radius){
2323

2424
float px = p.x - radius; // point x from center.
2525
float py = p.y - radius; // point x from center.
26-
float pl = sqrt(px * px + py * py); // point length from center.
27-
float pa = atan2(px, py); // point angle around center.
26+
float pl = std::sqrt(px * px + py * py); // point length from center.
27+
float pa = std::atan2(px, py); // point angle around center.
2828

29-
pa *= RAD_TO_DEG;
29+
pa = glm::degrees(pa);
3030
pa -= 90;
3131
pl /= radius;
3232

@@ -39,8 +39,8 @@ PolCord getPolarCoordinate(const glm::vec2 & p, float radius){
3939

4040
glm::vec2 getPoint(float a, float r){
4141
glm::vec2 p;
42-
p.x = r * cos(-a * DEG_TO_RAD);
43-
p.y = r * sin(-a * DEG_TO_RAD);
42+
p.x = r * std::cos(glm::radians(-a));
43+
p.y = r * std::sin(glm::radians(-a));
4444

4545
return p;
4646
}
@@ -248,9 +248,9 @@ ofMesh ofxColorPicker_<ColorType>::getColorWheel() {
248248

249249
int j = i % COLOR_WHEEL_RES;
250250
float p = j / (float)COLOR_WHEEL_RES;
251-
float a = p * TWO_PI;
251+
float a = p * glm::two_pi<float>();
252252

253-
ofFloatColor c0 = getCircularColor<float>(a * RAD_TO_DEG, 1.0, colorScale);
253+
ofFloatColor c0 = getCircularColor<float>(glm::degrees(a), 1.0, colorScale);
254254
meshColorWheel.addColor(ofFloatColor::white);
255255
meshColorWheel.addColor(c0);
256256
meshColorWheel.addColor(c0);

addons/ofxKinect/src/ofxKinect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ void ofxKinect::update() {
384384
if( videoPixels.getHeight() == videoPixelsIntra.getHeight() ){
385385
std::swap(videoPixels,videoPixelsIntra);
386386
}else{
387-
int minimumSize = MIN(videoPixels.size(), videoPixelsIntra.size());
387+
int minimumSize = std::min(videoPixels.size(), videoPixelsIntra.size());
388388
memcpy(videoPixels.getData(), videoPixelsIntra.getData(), minimumSize);
389389
}
390390
bNeedsUpdateVideo = false;

addons/ofxOpenCv/src/ofxCvImage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,8 @@ void ofxCvImage::transform( float angle, float centerX, float centerY,
620620
return;
621621
}
622622

623-
float sina = sin(angle * DEG_TO_RAD);
624-
float cosa = cos(angle * DEG_TO_RAD);
623+
float sina = std::sin(glm::radians(angle));
624+
float cosa = std::cos(glm::radians(angle));
625625
CvMat* transmat = cvCreateMat( 2,3, CV_32F );
626626
cvmSet( transmat, 0,0, scaleX*cosa );
627627
cvmSet( transmat, 0,1, scaleY*sina );

addons/ofxSvg/src/ofxSvg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void ofxSvg::fixSvgString(std::string & xmlstring) {
9898
for (ofXml & element : strokeWidthElements) {
9999
//cout << element.toString() << endl;
100100
float strokewidth = element.getAttribute("stroke-width").getFloatValue();
101-
strokewidth = MAX(1, round(strokewidth));
101+
strokewidth = std::fmax(1.0, std::round(strokewidth));
102102
element.getAttribute("stroke-width").set(strokewidth);
103103
}
104104
}

addons/ofxiOS/src/core/ofxiOSGLKViewController.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ - (float)rotationForOrientation:(UIInterfaceOrientation)interfaceOrientation {
195195
if (interfaceOrientation == UIInterfaceOrientationPortrait) {
196196
return 0; // 0 degrees.
197197
} else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
198-
return M_PI * 0.5; // 90 degrees.
198+
return glm::half_pi<float>(); // 90 degrees.
199199
} else if (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
200-
return M_PI; // 180 degrees.
200+
return glm::pi<float>(); // 180 degrees.
201201
} else if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
202-
return M_PI * 1.5; // 270 degrees.
202+
return glm::pi<float>() + glm::half_pi<float>(); // 270 degrees.
203203
} else {
204204
return 0;
205205
}

0 commit comments

Comments
 (0)