Skip to content

Commit

Permalink
Merge pull request #349 from REGoth-project/player-controller-cleanup
Browse files Browse the repository at this point in the history
Player controller cleanup
  • Loading branch information
ataulien authored Jul 4, 2018
2 parents b3c4837 + ddceec9 commit 7c3888e
Show file tree
Hide file tree
Showing 12 changed files with 1,105 additions and 855 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@
[submodule "lib/libdmusic"]
path = lib/libdmusic
url = https://github.com/frabert/libdmusic.git
[submodule "lib/optional"]
path = lib/optional
url = https://github.com/TartanLlama/optional.git
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ else()
endif()

add_subdirectory(lib/adpcm)
include_directories(lib/optional)

add_subdirectory(src/target)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT REGoth)
Expand Down
1 change: 1 addition & 0 deletions lib/optional
Submodule optional added at effc94
9 changes: 9 additions & 0 deletions src/engine/WorldMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,12 @@ ZenLoad::zCMaterialData WorldMesh::getMatData(size_t triangleIdx) const
assert(m_WorldMeshData.triangles[triangleIdx].submeshIndex < m_WorldMeshData.subMeshes.size());
return m_WorldMeshData.subMeshes[m_WorldMeshData.triangles[triangleIdx].submeshIndex].material;
}

ZenLoad::MaterialGroup WorldMesh::getMaterialGroupOfTriangle(uint32_t triangleIdx)
{
Math::float3 v3[3];
uint8_t matgroup;
// Beware! If triangle index is given such that the triangle is a building triangle of a VOB, this function will return material of the underlying worldmesh!!!
getTriangle(triangleIdx, v3, matgroup);
return static_cast<ZenLoad::MaterialGroup>(matgroup);
}
5 changes: 5 additions & 0 deletions src/engine/WorldMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ namespace World
*/
void getTriangle(size_t triangleIdx, Math::float3* v3, uint8_t& matgroup);

/**
* Returns material group of give triangle index
*/
ZenLoad::MaterialGroup getMaterialGroupOfTriangle(uint32_t triangleIdx);

/**
* @return Boundingbox max/min
*/
Expand Down
Loading

0 comments on commit 7c3888e

Please sign in to comment.