Skip to content

Commit 599705d

Browse files
srmainwaringiche033
authored andcommitted
Disable shadows when viewing point cloud markers (#720)
* Prevent point cloud markers from casting shadows * Build point cloud example on macOS - Allow the point cloud standalone example to build on macOS. --------- Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com> Co-authored-by: Ian Chen <ichen@openrobotics.org> (cherry picked from commit 308ceaf) Signed-off-by: Ian Chen <ichen@openrobotics.org> # Conflicts: # examples/standalone/point_cloud/CMakeLists.txt
1 parent 95261ea commit 599705d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

examples/standalone/point_cloud/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
22

33
project(gz-gui-point-cloud-example)
44

5-
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
5+
if((${CMAKE_SYSTEM_NAME} STREQUAL "Linux") OR
6+
(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin"))
67
find_package(gz-transport13 QUIET REQUIRED OPTIONAL_COMPONENTS log)
78
set(GZ_TRANSPORT_VER ${gz-transport13_VERSION_MAJOR})
89

src/plugins/point_cloud/PointCloud.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,11 @@ void PointCloudPrivate::PublishMarkers()
375375
marker.set_type(gz::msgs::Marker::POINTS);
376376
marker.set_visibility(gz::msgs::Marker::GUI);
377377

378+
// Set a default material - this will disable shadow casting when
379+
// the material is processed by the MarkerManager.
380+
gz::msgs::Material material;
381+
marker.mutable_material()->CopyFrom(material);
382+
378383
gz::msgs::Set(marker.mutable_scale(),
379384
gz::math::Vector3d::One * this->pointSize);
380385

0 commit comments

Comments
 (0)