17 #ifndef GZ_RENDERING_BASELIDARVISUAL_HH_
18 #define GZ_RENDERING_BASELIDARVISUAL_HH_
31 inline namespace GZ_RENDERING_VERSION_NAMESPACE {
45 public:
virtual void PreRender()
override;
48 public:
virtual void Destroy()
override;
51 public:
virtual void ClearPoints()
override;
54 public:
virtual void SetPoints(
63 public:
virtual void Update()
override;
66 public:
virtual void Init()
override;
69 public:
virtual void SetMinVerticalAngle(
70 double _minVerticalAngle)
override;
73 public:
virtual double MinVerticalAngle()
const override;
76 public:
virtual void SetMaxVerticalAngle(
77 double _maxVerticalAngle)
override;
80 public:
virtual double MaxVerticalAngle()
const override;
83 public:
virtual void SetMinHorizontalAngle(
84 double _minHorizontalAngle)
override;
87 public:
virtual double MinHorizontalAngle()
const override;
90 public:
virtual void SetMaxHorizontalAngle(
91 double _maxHorizontalAngle)
override;
94 public:
virtual double MaxHorizontalAngle()
const override;
97 public:
virtual void SetVerticalRayCount(
98 unsigned int _verticalRayCount)
override;
101 public:
virtual unsigned int VerticalRayCount()
const override;
104 public:
virtual void SetHorizontalRayCount(
105 unsigned int _horizontalRayCount)
override;
108 public:
virtual unsigned int HorizontalRayCount()
const override;
111 public:
virtual void SetMinRange(
double _minRange)
override;
114 public:
virtual double MinRange()
const override;
117 public:
virtual void SetMaxRange(
double _maxRange)
override;
120 public:
virtual double MaxRange()
const override;
123 public:
virtual void SetOffset(
130 public:
virtual unsigned int PointCount()
const override;
142 public:
virtual void SetSize(
double _size)
override;
145 public:
virtual double Size()
const override;
148 public:
virtual void CreateMaterials();
151 public:
virtual void SetDisplayNonHitting(
bool _display)
override;
154 public:
virtual bool DisplayNonHitting()
const override;
157 protected:
double minVerticalAngle = 0;
160 protected:
double maxVerticalAngle = 0;
163 protected:
unsigned int verticalCount = 1u;
166 protected:
double verticalAngleStep = 0;
169 protected:
double minHorizontalAngle = 0;
172 protected:
double maxHorizontalAngle = 0;
175 protected:
unsigned int horizontalCount = 1u;
178 protected:
double horizontalAngleStep = 0;
181 protected:
double minRange = 0;
184 protected:
double maxRange = 0;
187 protected:
bool displayNonHitting =
true;
197 protected:
double size = 1.0;
277 this->CreateMaterials();
283 double _minVerticalAngle)
285 this->minVerticalAngle = _minVerticalAngle;
292 return this->minVerticalAngle;
298 double _maxVerticalAngle)
300 this->maxVerticalAngle = _maxVerticalAngle;
307 return this->maxVerticalAngle;
313 unsigned int _verticalRayCount)
315 if (_verticalRayCount == 0)
317 gzwarn <<
"Cannot have zero vertical rays. Setting value to 1."
319 this->verticalCount = 1;
323 this->verticalCount = _verticalRayCount;
331 return this->verticalCount;
337 double _minHorizontalAngle)
339 this->minHorizontalAngle = _minHorizontalAngle;
346 return this->minHorizontalAngle;
352 double _maxHorizontalAngle)
354 this->maxHorizontalAngle = _maxHorizontalAngle;
361 return this->maxHorizontalAngle;
367 unsigned int _horizontalRayCount)
369 if (_horizontalRayCount == 0)
371 gzwarn <<
"Cannot have zero horizontal rays. Setting value to 1."
373 this->horizontalCount = 1u;
377 this->horizontalCount = _horizontalRayCount;
385 return this->horizontalCount;
392 this->minRange = _minRange;
399 return this->minRange;
406 this->maxRange = _maxRange;
413 return this->maxRange;
420 this->offset = _offset;
434 this->lidarVisualType = _type;
441 return this->lidarVisualType;
462 this->displayNonHitting = _display;
469 return this->displayNonHitting;
478 if (!this->
Scene()->MaterialRegistered(
"Lidar/BlueStrips"))
481 mtl->SetAmbient(0.0, 0.0, 1.0);
482 mtl->SetDiffuse(0.0, 0.0, 1.0);
483 mtl->SetEmissive(0.0, 0.0, 1.0);
484 mtl->SetTransparency(0.4);
485 mtl->SetCastShadows(
false);
486 mtl->SetReceiveShadows(
false);
487 mtl->SetLightingEnabled(
false);
488 mtl->SetMetalness(0.0f);
489 mtl->SetReflectivity(0.0);
492 if (!this->
Scene()->MaterialRegistered(
"Lidar/LightBlueStrips"))
495 mtl->SetAmbient(0.0, 0.0, 1.0);
496 mtl->SetDiffuse(0.0, 0.0, 1.0);
497 mtl->SetEmissive(0.0, 0.0, 1.0);
498 mtl->SetTransparency(0.8);
499 mtl->SetCastShadows(
false);
500 mtl->SetReceiveShadows(
false);
501 mtl->SetLightingEnabled(
false);
502 mtl->SetMetalness(0.0f);
503 mtl->SetReflectivity(0.0);
506 if (!this->
Scene()->MaterialRegistered(
"Lidar/TransBlack"))
509 mtl->SetAmbient(0.0, 0.0, 0.0);
510 mtl->SetDiffuse(0.0, 0.0, 0.0);
511 mtl->SetEmissive(0.0, 0.0, 0.0);
512 mtl->SetTransparency(0.4);
513 mtl->SetCastShadows(
false);
514 mtl->SetReceiveShadows(
false);
515 mtl->SetLightingEnabled(
false);
516 mtl->SetMetalness(0.5f);
517 mtl->SetReflectivity(0.2);
520 if (!this->
Scene()->MaterialRegistered(
"Lidar/BlueRay"))
523 mtl->SetAmbient(0.0, 0.0, 1.0);
524 mtl->SetDiffuse(0.0, 0.0, 1.0);
525 mtl->SetEmissive(0.0, 0.0, 1.0);
526 mtl->SetSpecular(0.0, 0.0, 1.0);
527 mtl->SetTransparency(0.0);
528 mtl->SetCastShadows(
false);
529 mtl->SetReceiveShadows(
false);
530 mtl->SetLightingEnabled(
false);
531 mtl->SetMetalness(0.1f);
532 mtl->SetReflectivity(0.2);