Skip to content

Commit 4220c1e

Browse files
authored
Merge branch 'master' into android2025
2 parents 536c716 + a1c2943 commit 4220c1e

File tree

107 files changed

+830
-1093
lines changed

Some content is hidden

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

107 files changed

+830
-1093
lines changed

.github/workflows/of.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,11 @@ jobs:
331331
env:
332332
TARGET: ${{matrix.cfg.target}}
333333
steps:
334-
- name: Remove Old lib-unwind
335-
run: if [ "$TARGET" = "linux64" ]; then
336-
sudo apt-get remove libunwind-14 -y;
337-
fi
334+
# handled by the install script now
335+
# - name: Remove Old lib-unwind
336+
# run: if [ "$TARGET" = "linux64" ]; then
337+
# sudo apt-get remove libunwind-14 -y;
338+
# fi
338339
- name: Cache Packages
339340
uses: awalsh128/cache-apt-pkgs-action@latest
340341
with:

addons/ofxAssimp/src/Source/ofxAssimpSrcAnimKeyCollection.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
//
2-
// ofxAssimpSrcAnimKeyCollection.cpp
3-
// Created by Nick Hardeman on 11/1/23.
4-
//
5-
61
#include "ofxAssimpSrcAnimKeyCollection.h"
72
#include "ofxAssimpUtils.h"
83

9-
using namespace ofx::assimp;
4+
using namespace ofxAssimp;
105

116
//--------------------------------------------------------------
127
void SrcAnimKeyCollection::setup( aiNodeAnim* aNodeAnim, float aDurationInTicks ) {
@@ -21,7 +16,7 @@ bool SrcAnimKeyCollection::hasKeys() {
2116

2217

2318
//--------------------------------------------------------------
24-
glm::vec3 SrcAnimKeyCollection::getVec3ForTime( const float& atime, const std::vector<ofx::assimp::AnimVectorKey>& akeys ) {
19+
glm::vec3 SrcAnimKeyCollection::getVec3ForTime( const float& atime, const std::vector<ofxAssimp::AnimVectorKey>& akeys ) {
2520
size_t numKeys = akeys.size();
2621
for( size_t i = 0; i < numKeys; i++ ) {
2722
if( akeys[i].time == atime ) {
@@ -108,7 +103,7 @@ std::vector<AnimVectorKey> SrcAnimKeyCollection::getAnimVectorKeysForTime(const
108103
if(aNumKeys == 1) {
109104
AnimVectorKey vkey;
110105
vkey.time = aStartTime;
111-
vkey.value = aiVecToOfVec(aAiKeys[0].mValue);
106+
vkey.value = ofxAssimp::Utils::aiVecToOfVec(aAiKeys[0].mValue);
112107
vkey.valueAi = aAiKeys[0].mValue;
113108
rkeys.push_back( vkey );
114109
return rkeys;
@@ -117,7 +112,7 @@ std::vector<AnimVectorKey> SrcAnimKeyCollection::getAnimVectorKeysForTime(const
117112
double currTime = aStartTime;
118113
for( unsigned int i = 0; i < aNumKeys; i++ ) {
119114
auto& key1 = aAiKeys[i];
120-
auto v1 = aiVecToOfVec(key1.mValue);
115+
auto v1 = ofxAssimp::Utils::aiVecToOfVec(key1.mValue);
121116
AnimVectorKey vkey;
122117
vkey.time = key1.mTime;
123118
vkey.value = v1;
@@ -138,15 +133,15 @@ std::vector<AnimRotationKey> SrcAnimKeyCollection::getAnimRotationKeysForTime(co
138133
if(aNumKeys == 1) {
139134
AnimRotationKey vkey;
140135
vkey.time = aStartTime;
141-
vkey.value = aiQuatToOfQuat(aAiKeys[0].mValue);
136+
vkey.value = ofxAssimp::Utils::aiQuatToOfQuat(aAiKeys[0].mValue);
142137
vkey.valueAi = aAiKeys[0].mValue;
143138
rkeys.push_back( vkey );
144139
return rkeys;
145140
}
146141
double currTime = aStartTime;
147142
for( unsigned int i = 0; i < aNumKeys; i++ ) {
148143
auto& key1 = aAiKeys[i];
149-
auto v1 = aiQuatToOfQuat(key1.mValue);
144+
auto v1 = ofxAssimp::Utils::aiQuatToOfQuat(key1.mValue);
150145
AnimRotationKey vkey;
151146
vkey.time = key1.mTime;
152147
vkey.value = v1;

addons/ofxAssimp/src/Source/ofxAssimpSrcAnimKeyCollection.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "ofNode.h"
99

1010

11-
namespace ofx::assimp {
11+
namespace ofxAssimp {
1212

1313
struct AnimVectorKey {
1414
float time = 0.0;
@@ -26,9 +26,9 @@ class SrcAnimKeyCollection {
2626
public:
2727
unsigned int uId = 0;
2828
std::string name = "";
29-
std::vector<ofx::assimp::AnimVectorKey> positionKeys;
30-
std::vector<ofx::assimp::AnimRotationKey> rotationKeys;
31-
std::vector<ofx::assimp::AnimVectorKey> scaleKeys;
29+
std::vector<ofxAssimp::AnimVectorKey> positionKeys;
30+
std::vector<ofxAssimp::AnimRotationKey> rotationKeys;
31+
std::vector<ofxAssimp::AnimVectorKey> scaleKeys;
3232

3333
void clear() {
3434
positionKeys.clear();
@@ -39,7 +39,7 @@ class SrcAnimKeyCollection {
3939
void setup( aiNodeAnim* aNodeAnim, float aDurationInTicks );
4040
bool hasKeys();
4141

42-
glm::vec3 getVec3ForTime( const float& atime, const std::vector<ofx::assimp::AnimVectorKey>& akeys );
42+
glm::vec3 getVec3ForTime( const float& atime, const std::vector<ofxAssimp::AnimVectorKey>& akeys );
4343

4444
glm::vec3 getPosition( const float& atime );
4545
glm::vec3 getScale( const float& atime );

addons/ofxAssimp/src/Source/ofxAssimpSrcBone.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "of3dUtils.h"
55
#include "ofxAssimpUtils.h"
66

7-
using namespace ofx::assimp;
7+
using namespace ofxAssimp;
88

99
//--------------------------------------------------------------
1010
void SrcBone::setAiBone(aiBone* aAiBone, aiNode* aAiNode) {
@@ -118,8 +118,8 @@ void SrcBone::setAiBone(aiBone* aAiBone, aiNode* aAiNode) {
118118
//}
119119

120120
//--------------------------------------------------------------
121-
std::shared_ptr<ofx::assimp::SrcBone> SrcBone::getBone( aiNode* aAiNode ) {
122-
std::shared_ptr<ofx::assimp::SrcBone> tbone;
121+
std::shared_ptr<ofxAssimp::SrcBone> SrcBone::getBone( aiNode* aAiNode ) {
122+
std::shared_ptr<ofxAssimp::SrcBone> tbone;
123123
findBoneRecursive( aAiNode, tbone );
124124
if( tbone ) {
125125
return tbone;

addons/ofxAssimp/src/Source/ofxAssimpSrcBone.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
#pragma once
77
#include "ofxAssimpSrcNode.h"
88

9-
namespace ofx::assimp {
10-
class SrcBone : public ofx::assimp::SrcNode {
9+
namespace ofxAssimp {
10+
class SrcBone : public ofxAssimp::SrcNode {
1111
public:
1212
virtual NodeType getType() override { return OFX_ASSIMP_BONE; }
1313

1414
void setAiBone(aiBone* aAiBone, aiNode* aAiNode);
1515
// void update();
1616

17-
std::shared_ptr<ofx::assimp::SrcBone> getBone( aiNode* aAiNode );
17+
std::shared_ptr<ofxAssimp::SrcBone> getBone( aiNode* aAiNode );
1818
void findBoneRecursive( aiNode* aAiNode, std::shared_ptr<SrcBone>& returnBone );
1919

2020
std::string getAsString( unsigned int aLevel=0 );
@@ -29,7 +29,7 @@ class SrcBone : public ofx::assimp::SrcNode {
2929
// aiMatrix4x4& getAiMatrixGlobal() { return mAiMatrixGlobal; }
3030
aiMatrix4x4& getAiOffsetMatrix() { return mOffsetMatrix;}
3131

32-
std::vector< std::shared_ptr<ofx::assimp::SrcBone> > childBones;
32+
std::vector< std::shared_ptr<ofxAssimp::SrcBone> > childBones;
3333

3434
protected:
3535
aiBone* mAiBone = nullptr;

addons/ofxAssimp/src/Source/ofxAssimpSrcMesh.cpp

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// ofxAssimpSrcMesh.cpp
3-
// ofxAssimpExample
4-
//
5-
// Created by Nick Hardeman on 10/24/23.
6-
//
7-
81
#include "ofxAssimpSrcMesh.h"
92
#include "ofxAssimpUtils.h"
103
#include "of3dGraphics.h"
@@ -13,23 +6,23 @@
136
using std::make_shared;
147
using std::shared_ptr;
158

16-
using namespace ofx::assimp;
9+
using namespace ofxAssimp;
1710

1811
static unsigned int sUniqueMeshCounter = 0;
1912
ofTexture SrcMesh::sDummyTex;
2013

2114
//-------------------------------------------
22-
void SrcMesh::addTexture( std::shared_ptr<ofx::assimp::Texture> aAssimpTex){
15+
void SrcMesh::addTexture( std::shared_ptr<ofxAssimp::Texture> aAssimpTex){
2316

2417
if(!material) {
2518
material = std::make_shared<ofMaterial>();
2619
}
2720

2821
auto tAiType = aAssimpTex->getAiTextureType();
29-
auto tofType = ofx::assimp::Texture::ofTextureTypeForAiType(tAiType);
22+
auto tofType = ofxAssimp::Texture::ofTextureTypeForAiType(tAiType);
3023

3124
if(tofType == OF_MATERIAL_TEXTURE_NONE ) {
32-
ofLogError("ofx::assimp::Mesh::addTexture") << aAssimpTex->getAiTextureTypeAsString();
25+
ofLogError("ofxAssimp::Mesh::addTexture") << aAssimpTex->getAiTextureTypeAsString();
3326
return;
3427
}
3528

@@ -70,7 +63,7 @@ bool SrcMesh::hasTexture(aiTextureType aTexType){
7063

7164
//-------------------------------------------
7265
bool SrcMesh::hasTexture(ofMaterialTextureType aType){
73-
return hasTexture( ofx::assimp::Texture::aiTextureTypeForOfType(aType));
66+
return hasTexture( ofxAssimp::Texture::aiTextureTypeForOfType(aType));
7467
}
7568

7669
//-------------------------------------------
@@ -80,13 +73,13 @@ std::size_t SrcMesh::getNumTextures() {
8073

8174
//-------------------------------------------
8275
ofTexture& SrcMesh::getTexture() {
83-
for( auto iter = ofx::assimp::Texture::sAiTexTypeToOfTexTypeMap.begin(); iter != ofx::assimp::Texture::sAiTexTypeToOfTexTypeMap.end(); iter++ ) {
76+
for( auto iter = ofxAssimp::Texture::sAiTexTypeToOfTexTypeMap.begin(); iter != ofxAssimp::Texture::sAiTexTypeToOfTexTypeMap.end(); iter++ ) {
8477
if( hasTexture((aiTextureType)iter->first) ) {
8578
return getTexture((aiTextureType)iter->first);
8679
}
8780
}
8881

89-
ofLogWarning("ofx::assimp::Mesh::getTexture") << " unable to find any allocated texture";
82+
ofLogWarning("ofxAssimp::Mesh::getTexture") << " unable to find any allocated texture";
9083
return sDummyTex;
9184
}
9285

@@ -97,13 +90,13 @@ ofTexture& SrcMesh::getTexture(aiTextureType aTexType){
9790
return tex->getTextureRef();
9891
}
9992
}
100-
ofLogWarning("ofx::assimp::SrcMesh::getTexture : unable to find texture ref for ") << aTexType;
93+
ofLogWarning("ofxAssimp::SrcMesh::getTexture : unable to find texture ref for ") << aTexType;
10194
return sDummyTex;
10295
}
10396

10497
//-------------------------------------------
10598
ofTexture& SrcMesh::getTexture(ofMaterialTextureType aType){
106-
return getTexture( ofx::assimp::Texture::aiTextureTypeForOfType(aType) );
99+
return getTexture( ofxAssimp::Texture::aiTextureTypeForOfType(aType) );
107100
}
108101

109102
//-------------------------------------------
@@ -132,9 +125,9 @@ void SrcMesh::setAiMesh( aiMesh* amesh, aiNode* aAiNode ) {
132125
void SrcMesh::setupVbo( std::shared_ptr<ofVbo> avbo ) {
133126
ofMesh tempMesh;
134127
if( hasTexture() ) {
135-
aiMeshToOfMesh(mAiMesh, tempMesh, !bConvertedToLeftHand, &getTexture() );
128+
ofxAssimp::Utils::aiMeshToOfMesh(mAiMesh, tempMesh, !bConvertedToLeftHand, &getTexture() );
136129
} else {
137-
aiMeshToOfMesh(mAiMesh, tempMesh, !bConvertedToLeftHand, nullptr);
130+
ofxAssimp::Utils::aiMeshToOfMesh(mAiMesh, tempMesh, !bConvertedToLeftHand, nullptr);
138131
}
139132

140133
avbo->setVertexData(&mAiMesh->mVertices[0].x,3,mAiMesh->mNumVertices,usage,sizeof(aiVector3D));
@@ -164,9 +157,9 @@ void SrcMesh::setupVbo( std::shared_ptr<ofVbo> avbo ) {
164157
void SrcMesh::setMeshFromAiMesh( ofMesh& amesh ) {
165158
if( mAiMesh != NULL && amesh.getNumVertices() < 1 ) {
166159
if( hasTexture() ) {
167-
aiMeshToOfMesh(mAiMesh, amesh, !bConvertedToLeftHand, &getTexture());
160+
ofxAssimp::Utils::aiMeshToOfMesh(mAiMesh, amesh, !bConvertedToLeftHand, &getTexture());
168161
} else {
169-
aiMeshToOfMesh(mAiMesh, amesh, !bConvertedToLeftHand, nullptr);
162+
ofxAssimp::Utils::aiMeshToOfMesh(mAiMesh, amesh, !bConvertedToLeftHand, nullptr);
170163
}
171164
}
172165
}

addons/ofxAssimp/src/Source/ofxAssimpSrcMesh.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//
22
// ofxAssimpSrcMesh.h
3-
// ofxAssimpExample
43
//
54
// Created by Nick Hardeman on 10/24/23.
65
//
@@ -12,13 +11,13 @@
1211
#include "ofVbo.h"
1312
#include "ofxAssimpBounds.h"
1413

15-
namespace ofx::assimp {
16-
class SrcMesh : public ofx::assimp::SrcNode {
14+
namespace ofxAssimp {
15+
class SrcMesh : public ofxAssimp::SrcNode {
1716
public:
1817
static ofTexture sDummyTex;
1918
virtual NodeType getType() override { return OFX_ASSIMP_MESH; }
2019

21-
void addTexture(std::shared_ptr<ofx::assimp::Texture> aAssimpTex);
20+
void addTexture(std::shared_ptr<ofxAssimp::Texture> aAssimpTex);
2221
bool hasTexture();
2322
bool hasTexture(aiTextureType aTexType);
2423
bool hasTexture( ofMaterialTextureType aType );
@@ -27,7 +26,7 @@ class SrcMesh : public ofx::assimp::SrcNode {
2726
ofTexture& getTexture();
2827
ofTexture& getTexture(aiTextureType aTexType);
2928
ofTexture& getTexture(ofMaterialTextureType aType);
30-
std::vector<std::shared_ptr<ofx::assimp::Texture>> & getAllMeshTextures(){ return meshTextures; }
29+
std::vector<std::shared_ptr<ofxAssimp::Texture>> & getAllMeshTextures(){ return meshTextures; }
3130

3231
void setAiMesh(aiMesh* amesh, aiNode* aAiNode);
3332
aiMesh* getAiMesh() { return mAiMesh; }
@@ -51,6 +50,6 @@ class SrcMesh : public ofx::assimp::SrcNode {
5150
protected:
5251
aiMesh* mAiMesh = nullptr; // pointer to the aiMesh we represent.
5352
Bounds mLocalBounds;
54-
std::vector<std::shared_ptr<ofx::assimp::Texture>> meshTextures;
53+
std::vector<std::shared_ptr<ofxAssimp::Texture>> meshTextures;
5554
};
5655
}

addons/ofxAssimp/src/Source/ofxAssimpSrcNode.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
static unsigned int sUniqueIdCounter = 0;
44

5-
using namespace ofx::assimp;
5+
using namespace ofxAssimp;
66

77
//--------------------------------------------------------------
88
std::string SrcNode::sGetNodeTypeAsString( const NodeType& atype ) {
@@ -12,8 +12,8 @@ std::string SrcNode::sGetNodeTypeAsString( const NodeType& atype ) {
1212
return "OFX_ASSIMP_BONE";
1313
} else if(atype == OFX_ASSIMP_SKELETON ) {
1414
return "OFX_ASSIMP_SKELETON";
15-
} else if(atype == OFX_ASSIMP_MODEL ) {
16-
return "OFX_ASSIMP_MODEL";
15+
} else if(atype == OFX_ASSIMP_SCENE ) {
16+
return "OFX_ASSIMP_SCENE";
1717
}
1818
return "OFX_ASSIMP_NODE";
1919
}
@@ -26,8 +26,8 @@ std::string SrcNode::sGetNodeTypeShortAsString( const NodeType& atype ) {
2626
return "BONE";
2727
} else if(atype == OFX_ASSIMP_SKELETON ) {
2828
return "SKELETON";
29-
} else if(atype == OFX_ASSIMP_MODEL ) {
30-
return "MODEL";
29+
} else if(atype == OFX_ASSIMP_SCENE ) {
30+
return "SCENE";
3131
}
3232
return "NODE";
3333
}
@@ -53,8 +53,8 @@ std::string SrcNode::getName() {
5353
}
5454

5555
//----------------------------------------
56-
std::shared_ptr<ofx::assimp::SrcNode> SrcNode::getNode( aiNode* aAiNode ) {
57-
std::shared_ptr<ofx::assimp::SrcNode> tnode;
56+
std::shared_ptr<ofxAssimp::SrcNode> SrcNode::getNode( aiNode* aAiNode ) {
57+
std::shared_ptr<ofxAssimp::SrcNode> tnode;
5858
findNodeRecursive( aAiNode, tnode );
5959
return tnode;
6060
}
@@ -73,8 +73,8 @@ void SrcNode::findNodeRecursive( aiNode* aAiNode, std::shared_ptr<SrcNode>& aRet
7373
}
7474

7575
//----------------------------------------
76-
std::shared_ptr<ofx::assimp::SrcNode> SrcNode::getNode( const std::string& aAiNodeName ) {
77-
std::shared_ptr<ofx::assimp::SrcNode> tnode;
76+
std::shared_ptr<ofxAssimp::SrcNode> SrcNode::getNode( const std::string& aAiNodeName ) {
77+
std::shared_ptr<ofxAssimp::SrcNode> tnode;
7878
findNodeRecursive( aAiNodeName, tnode );
7979
return tnode;
8080
}
@@ -151,7 +151,7 @@ std::string SrcNode::getAsString( int aLevel ) {
151151

152152
// animation functions
153153
//--------------------------------------------------------------
154-
ofx::assimp::SrcAnimKeyCollection& SrcNode::getKeyCollection(unsigned int aAnimUId){
154+
ofxAssimp::SrcAnimKeyCollection& SrcNode::getKeyCollection(unsigned int aAnimUId){
155155
if( mKeyCollections.count(aAnimUId) < 1 ) {
156156
SrcAnimKeyCollection temp;
157157
temp.uId = aAnimUId;

0 commit comments

Comments
 (0)