39 bool traceRay(const
mrpt::poses::CPose3D& o,
double& dist) const override;
122 const float baseRadius,
const float topRadius,
const float height = 1,
123 const int slices = 10)
174 : (Z <= m_height && Z >= 0);
float m_height
Cylinder's height.
uint32_t m_slices
Number of radial divisions.
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
float m_baseRadius
Cylinder's radii.
float getBottomRadius() const
Gets the bottom radius.
Renderizable generic renderer for objects using the triangles shader.
void setHasBases(bool top=true, bool bottom=true)
Configuration of the cylinder's bases display.
#define DEFINE_SCHEMA_SERIALIZABLE()
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
bool m_hasTopBase
Boolean parameters about including the bases in the object.
float d2f(const double d)
shortcut for static_cast<float>(double)
void setSlicesCount(uint32_t slices)
Number of radial divisions.
uint32_t getSlicesCount() const
Number of radial divisions.
CCylinder(const float baseRadius, const float topRadius, const float height=1, const int slices=10)
Complete constructor.
A cylinder or cone whose base lies in the XY plane.
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
bool hasTopBase() const
Check whether top base is displayed.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void setRadius(float radius)
Sets both radii to a single value, thus configuring the object as a cylinder.
bool hasBottomBase() const
Check whether bottom base is displayed.
bool reachesHeight(float Z) const
Checks whether the cylinder exists at some height.
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Simulation of ray-trace, given a pose.
float getHeight() const
Gets the cylinder's height.
The namespace for 3D scene representation and rendering.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
float getTopRadius() const
Gets the top radius.
~CCylinder() override=default
Destructor.
void setHeight(float height)
Chenges cylinder's height.
void setRadii(float bottom, float top)
Sets both radii independently.
void onUpdateBuffers_Triangles() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
bool reachesHeight(double Z) const
bool getRadius(float Z, float &r) const
Gets the radius of the circunference located at certain height, returning false if the cylinder doesn...