Skip to content

Commit

Permalink
Update spherical coords from renderutils
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya <aditya050995@gmail.com>
  • Loading branch information
adityapande-1995 committed Jul 19, 2022
1 parent 94f781a commit d3e2200
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
24 changes: 12 additions & 12 deletions src/rendering/RenderUtil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,18 @@ void RenderUtil::UpdateFromECM(const UpdateInfo &_info,
this->dataPtr->FindInertialLinks(_ecm);
this->dataPtr->FindJointModels(_ecm);
this->dataPtr->FindCollisionLinks(_ecm);

// Get the SphericalCoordinate object from the world
// and supply it to the SceneManager
auto worldEntity = _ecm.EntityByComponents(components::World());
auto sphericalCoordinatesComponent =
_ecm.Component<components::SphericalCoordinates>(
worldEntity);
if (sphericalCoordinatesComponent)
{
this->dataPtr->sceneManager.SetSphericalCoordinates(
sphericalCoordinatesComponent->Data());
}
}

//////////////////////////////////////////////////
Expand Down Expand Up @@ -1609,18 +1621,6 @@ void RenderUtilPrivate::CreateRenderingEntities(
if (!this->initialized)
{
this->CreateEntitiesFirstUpdate(_ecm, _info);
// Get the SphericalCoordinate object from the world
// and supply it to the SceneManager
auto worldEntity = _ecm.EntityByComponents(components::World());
auto sphericalCoordinatesComponent =
_ecm.Component<components::SphericalCoordinates>(
worldEntity);
if (sphericalCoordinatesComponent)
{
this->sceneManager.SetSphericalCoordinates(
sphericalCoordinatesComponent->Data());
}

this->initialized = true;
}
else
Expand Down
1 change: 0 additions & 1 deletion src/rendering/SceneManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,6 @@ rendering::GeometryPtr SceneManager::LoadGeometry(const sdf::Geometry &_geom,
{
auto dem = std::make_shared<common::Dem>();
dem->SetSphericalCoordinates(this->dataPtr->sphericalCoordinates);
std::cout << "dbg: " << this->dataPtr->sphericalCoordinates.Surface() << std::endl;
if (dem->Load(fullPath) < 0)
{
gzerr << "Failed to load heightmap dem data from ["
Expand Down

0 comments on commit d3e2200

Please sign in to comment.