Skip to content

Commit

Permalink
--reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jturner65 committed Jan 17, 2024
1 parent 5678add commit 385fd13
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/utils/datatool/Datatool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ using esp::assets::SceneLoader;
using esp::nav::NavMeshSettings;
using esp::nav::PathFinder;
using esp::scene::SemanticScene;
using Magnum::Math::Literals::operator""_degf;

int createNavMesh(const std::string& meshFile, const std::string& navmeshFile) {
SceneLoader loader;
Expand Down Expand Up @@ -96,8 +97,8 @@ int createGibsonSemanticMesh(const std::string& objFile,
f << "end_header" << std::endl;

// We need to rotate to match .glb where -Z is gravity
const Mn::Quaternion transform = esp::core::quatRotFromTwoVectors(
Mn::Vector3::yAxis(), Mn::Vector3::zAxis());
const Mn::Quaternion transform =
Mn::Quaternion::rotation(90.0_degf, Mn::Vector3::xAxis());
for (size_t i = 0; i < numVerts; ++i) {
unsigned char gray[] = {0x80, 0x80, 0x80};
float* components = &attrib.vertices[i * 3];
Expand Down
4 changes: 2 additions & 2 deletions src/utils/datatool/Mp3dInstanceMeshData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ bool Mp3dInstanceMeshData::saveSemMeshPLY(

for (int iVertex = 0; iVertex < nVertex; ++iVertex) {
const Mn::Vector3& xyz = cpu_vbo_[iVertex];
const Mn::Vector3ui& rgb = cpu_cbo_[iVertex];
const Mn::Vector3ub& rgb = cpu_cbo_[iVertex];
f.write(reinterpret_cast<const char*>(xyz.data()), 3 * sizeof(float));
f.write(reinterpret_cast<const char*>(rgb.data()), 3 * sizeof(uint8_t));
}

for (int iFace = 0; iFace < perFaceIdxs_.size(); ++iFace) {
const uint8_t nIndices = 3;
const Mn::Vector3i& indices = perFaceIdxs_[iFace];
const Mn::Vector3ui& indices = perFaceIdxs_[iFace];
// The materialId corresponds to the segmentId from the .house file
const int32_t segmentId = materialIds_[iFace];
int32_t objectId = ID_UNDEFINED;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/datatool/Mp3dInstanceMeshData.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class Mp3dInstanceMeshData {

protected:
std::vector<Magnum::Vector3> cpu_vbo_;
std::vector<Magnum::Vector3ui> cpu_cbo_;
std::vector<Magnum::Vector3i> perFaceIdxs_;
std::vector<Magnum::Vector3ub> cpu_cbo_;
std::vector<Magnum::Vector3ui> perFaceIdxs_;
std::vector<int> materialIds_;
std::vector<int> segmentIds_;
std::vector<int> categoryIds_;
Expand Down

0 comments on commit 385fd13

Please sign in to comment.