Skip to content

Commit

Permalink
同じサブメッシュを結合する処理で、サブメッシュが欠ける場合があるのを修正 (#259)
Browse files Browse the repository at this point in the history
* 同じサブメッシュを結合する処理で、サブメッシュが欠ける場合があるのを修正

* github actions対応

* 同上
  • Loading branch information
linoal authored Oct 21, 2024
1 parent 01dca33 commit 7ae98f1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 34 deletions.
6 changes: 3 additions & 3 deletions .github/actions/upload-dll/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ runs:

- name: Upload DLL for Windows
if: runner.os == 'Windows'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: libplateau-windows
path: D:\a\output
Expand Down Expand Up @@ -78,14 +78,14 @@ runs:

- name: Upload DLL(so) for Ubuntu
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: libplateau-${{matrix.os}}
path: ${{env.HOME}}/output/

- name: Upload DLL(dylib) for MacOS
if: runner.os == 'MacOS'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: libplateau-${{matrix.os}}-${{matrix.arch}}
path: ${{env.HOME}}/output/
4 changes: 2 additions & 2 deletions .github/actions/upload-mobile-dlls/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ runs:

- name: Upload framework for Android
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: libplateau-android-dll
path: ${{github.workspace}}/out/build/x64-Release/src/libplateau.so

- name: Upload framework for iOS
if: runner.os == 'MacOS'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: libplateau-ios-dll
# path: ${{github.workspace}}/out/build/x64-Release/src/Release-iphoneos/plateau.framework/*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload-dlls-older-visual-studio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
cp ~/a/libplateau-macos-14-arm64/*.a ~/a/plateau-plugins/static-libs/macos/arm64
- name: upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: all-libraries
path: ~/a/plateau-plugins
4 changes: 2 additions & 2 deletions .github/workflows/upload-dlls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

steps:
- name: download-all-artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: ~/a

Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
cp ~/a/libplateau-macos-14-arm64/*.a ~/a/plateau-plugins/static-libs/macos/arm64
- name: upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: all-libraries
path: ~/a/plateau-plugins
Expand Down
2 changes: 2 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 2 additions & 26 deletions src/polygon_mesh/sub_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,37 +104,13 @@ namespace plateau::polygonMesh {

bool SubMesh::isAppearanceEqual(const plateau::polygonMesh::SubMesh& other) const {

// 留意: ここを編集するときは、SubMeshCompareByAppearance::operator() も対応するように編集してください。
if(getGameMaterialID() != other.getGameMaterialID()) return false;

// ゲームマテリアルIDがセットされているなら、他のすべてに優先してこれだけで比較します。
if(getGameMaterialID() >= 0){
return true;
}


if(getTexturePath() != other.getTexturePath()) return false;
const auto mat_s = getMaterial();
const auto mat_o = other.getMaterial();
if(mat_s.get() == mat_o.get()) return true;
if(!mat_s && mat_o) return false;
if(mat_s && !mat_o) return false;
if(mat_s->getDiffuse() != mat_o->getDiffuse()) return false;
if(mat_s->getEmissive() != mat_o->getEmissive()) return false;
if(mat_s->getSpecular() != mat_o->getSpecular()) return false;
if(mat_s->getAmbientIntensity() != mat_o->getAmbientIntensity()) return false;
if(mat_s->getShininess() != mat_o->getShininess()) return false;
if(mat_s->getTransparency() != mat_o->getTransparency()) return false;
if(mat_s->isSmooth() != mat_o->isSmooth()) return false;
return true;
SubMeshCompareByAppearance comp;
return comp(*this, other) == false && comp(other, *this) == false;
}

bool SubMeshCompareByAppearance::operator()(const plateau::polygonMesh::SubMesh& lhs,
const plateau::polygonMesh::SubMesh& rhs) const {

// 留意: ここを編集するときは、SubMesh::isAppearanceEqual も対応するように編集してください。
// lhsがrhsよりも小さい場合にtrueを返します。等しい場合はfalseです。

// gameMaterialの比較
if(lhs.getGameMaterialID() != rhs.getGameMaterialID()) return lhs.getGameMaterialID() < rhs.getGameMaterialID();

Expand Down

0 comments on commit 7ae98f1

Please sign in to comment.