Class CSphere

Inheritance Relationships

Base Type

Class Documentation

class CSphere : public mrpt::viz::CGeneralizedEllipsoidTemplate<3>

A solid or wire-frame sphere.

../../output_staging/generated/doxygen/xml/preview_CSphere.png

See also

opengl::Scene

Public Functions

inline void setRadius(float r)
inline float getRadius() const
inline void setNumberDivs(int N)
virtual bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override

Simulation of ray-trace, given a pose. Returns true if the ray effectively collisions with the object (returning the distance to the origin of the ray in “dist”), or false in other case. “dist” variable yields undefined behaviour when false is returned

virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() const override

Must be implemented by derived classes to provide the updated bounding box in the object local frame of coordinates. This will be called only once after each time the derived class reports to notifyChange() that the object geometry changed.

See also

getBoundingBox(), getBoundingBoxLocal(), getBoundingBoxLocalf()

inline CSphere(float radius = 1.0f, int nDivs = 20)

Constructor

virtual ~CSphere() override = default

Protected Functions

inline void regenerateBaseParams()
inline void transformFromParameterSpace(const std::vector<BASE::array_parameter_t> &in_pts, std::vector<BASE::array_point_t> &out_pts) const override

Protected Attributes

float m_radius
int m_nDivs