Skip to content

Commit

Permalink
Fixed rotation quanterion loaders
Browse files Browse the repository at this point in the history
  • Loading branch information
favreau committed Nov 22, 2023
1 parent 8aad13e commit 00fd777
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bioexplorer/backend/science/atlas/AtlasLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ ModelDescriptorPtr AtlasLoader::importFromStorage(const std::string& storage, co
const auto position = props.getProperty<std::array<double, 3>>(LOADER_PROPERTY_POSITION.name);
const Vector3d pos = core::Vector3d(position[0], position[1], position[2]);
const auto rotation = props.getProperty<std::array<double, 4>>(LOADER_PROPERTY_ROTATION.name);
const Quaterniond rot = core::Quaterniond(rotation[0], rotation[1], rotation[2], rotation[3]);
const Quaterniond rot = core::Quaterniond(rotation[3], rotation[0], rotation[1], rotation[2]);
const auto scale = props.getProperty<std::array<double, 3>>(LOADER_PROPERTY_SCALE.name);
Atlas atlas(_scene, details, pos, rot, callback);
return std::move(atlas.getModelDescriptor());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ModelDescriptorPtr WhiteMatterLoader::importFromStorage(const std::string& stora
const auto position = props.getProperty<std::array<double, 3>>(LOADER_PROPERTY_POSITION.name);
const Vector3d pos = core::Vector3d(position[0], position[1], position[2]);
const auto rotation = props.getProperty<std::array<double, 4>>(LOADER_PROPERTY_ROTATION.name);
const Quaterniond rot = core::Quaterniond(rotation[0], rotation[1], rotation[2], rotation[3]);
const Quaterniond rot = core::Quaterniond(rotation[3], rotation[0], rotation[1], rotation[2]);
const auto scale = props.getProperty<std::array<double, 3>>(LOADER_PROPERTY_SCALE.name);
WhiteMatter whiteMatter(_scene, details, pos, rot, callback);
return std::move(whiteMatter.getModelDescriptor());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ ModelDescriptorPtr AstrocytesLoader::importFromStorage(const std::string& storag
const auto position = props.getProperty<std::array<double, 3>>(LOADER_PROPERTY_POSITION.name);
const Vector3d pos = core::Vector3d(position[0], position[1], position[2]);
const auto rotation = props.getProperty<std::array<double, 4>>(LOADER_PROPERTY_ROTATION.name);
const Quaterniond rot = core::Quaterniond(rotation[0], rotation[1], rotation[2], rotation[3]);
const Quaterniond rot = core::Quaterniond(rotation[3], rotation[0], rotation[1], rotation[2]);
const auto scale = props.getProperty<std::array<double, 3>>(LOADER_PROPERTY_SCALE.name);
details.scale = {scale[0], scale[1], scale[2]};
Astrocytes astrocytes(_scene, details, pos, rot, callback);
Expand Down
2 changes: 1 addition & 1 deletion bioexplorer/backend/science/morphologies/NeuronsLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ ModelDescriptorPtr NeuronsLoader::importFromStorage(const std::string& storage,
const auto position = props.getProperty<std::array<double, 3>>(LOADER_PROPERTY_POSITION.name);
const Vector3d pos = core::Vector3d(position[0], position[1], position[2]);
const auto rotation = props.getProperty<std::array<double, 4>>(LOADER_PROPERTY_ROTATION.name);
const Quaterniond rot = core::Quaterniond(rotation[0], rotation[1], rotation[2], rotation[3]);
const Quaterniond rot = core::Quaterniond(rotation[3], rotation[0], rotation[1], rotation[2]);
const auto scale = props.getProperty<std::array<double, 3>>(LOADER_PROPERTY_SCALE.name);
details.scale = {scale[0], scale[1], scale[2]};
Neurons Neurons(_scene, details, pos, rot, callback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ ModelDescriptorPtr VasculatureLoader::importFromStorage(const std::string& stora
const auto position = props.getProperty<std::array<double, 3>>(LOADER_PROPERTY_POSITION.name);
const Vector3d pos = core::Vector3d(position[0], position[1], position[2]);
const auto rotation = props.getProperty<std::array<double, 4>>(LOADER_PROPERTY_ROTATION.name);
const Quaterniond rot = core::Quaterniond(rotation[0], rotation[1], rotation[2], rotation[3]);
const Quaterniond rot = core::Quaterniond(rotation[3], rotation[0], rotation[1], rotation[2]);
const auto scale = props.getProperty<std::array<double, 3>>(LOADER_PROPERTY_SCALE.name);
details.scale = {scale[0], scale[1], scale[2]};
Vasculature vasculature(_scene, details, pos, rot, callback);
Expand Down

0 comments on commit 00fd777

Please sign in to comment.