Skip to content

Commit

Permalink
more minor improvements
Browse files Browse the repository at this point in the history
Signed-off-by: frederik <[email protected]>
  • Loading branch information
frede791 committed Jan 12, 2024
1 parent d5322d2 commit 1571a65
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions graphics/src/ColladaLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,8 @@ void ColladaLoader::Implementation::LoadPositions(const std::string &_id,
auto values = toDoubleVec(valueStr, totCount);

gz::math::Vector3d vec;
std::shared_ptr<gz::math::Vector3d> prev_vec = std::make_shared<gz::math::Vector3d>(gz::math::Vector3d::Zero);
std::shared_ptr<gz::math::Vector3d> prev_vec =
std::make_shared<gz::math::Vector3d>(gz::math::Vector3d::Zero);
if (!_values)
_values = std::make_shared<std::vector<gz::math::Vector3d>>();
if (!_duplicates)
Expand Down Expand Up @@ -1726,7 +1727,8 @@ void ColladaLoader::Implementation::LoadNormals(const std::string &_id,
auto values = toDoubleVec(valueStr, totCount);

gz::math::Vector3d vec;
std::shared_ptr<gz::math::Vector3d> prev_vec = std::make_shared<gz::math::Vector3d>(gz::math::Vector3d::Zero);
std::shared_ptr<gz::math::Vector3d> prev_vec =
std::make_shared<gz::math::Vector3d>(gz::math::Vector3d::Zero);
if (!_values)
_values = std::make_shared<std::vector<gz::math::Vector3d>>();
if (!_duplicates)
Expand Down Expand Up @@ -1914,7 +1916,8 @@ void ColladaLoader::Implementation::LoadTexCoords(const std::string &_id,
auto values = toDoubleVec(valueStr, totCount);

gz::math::Vector2d vec;
std::shared_ptr<gz::math::Vector2d> prev_vec = std::make_shared<gz::math::Vector2d>(gz::math::Vector2d::Zero);
std::shared_ptr<gz::math::Vector2d> prev_vec =
std::make_shared<gz::math::Vector2d>(gz::math::Vector2d::Zero);
if (!_values)
_values = std::make_shared<std::vector<gz::math::Vector2d>>();
if (!_duplicates)
Expand Down Expand Up @@ -2293,7 +2296,7 @@ void ColladaLoader::Implementation::LoadPolylist(

// vertexIndexMap is a map of collada vertex index to Gazebo submesh vertex
// indices, used for identifying vertices that can be shared.
std::map<unsigned int, std::vector<GeometryIndices> > vertexIndexMap;
std::unordered_map<unsigned int, std::vector<GeometryIndices>> vertexIndexMap;
unsigned int *values = new unsigned int[inputSize];
memset(values, 0, inputSize);

Expand Down Expand Up @@ -2678,7 +2681,7 @@ void ColladaLoader::Implementation::LoadTriangles(

// vertexIndexMap is a map of collada vertex index to Gazebo submesh vertex
// indices, used for identifying vertices that can be shared.
std::map<unsigned int, std::vector<GeometryIndices> > vertexIndexMap;
std::unordered_map<unsigned int, std::vector<GeometryIndices>> vertexIndexMap;

std::vector<unsigned int> values(offsetSize);
std::vector<std::string> strs = split(pStr, " \t\r\n");
Expand Down

0 comments on commit 1571a65

Please sign in to comment.