class mrpt::viz::CSphere

Overview

A solid or wire-frame sphere.

mrpt::viz::CSphere mrpt::viz::CSphere mrpt::viz::CSphere mrpt::viz::CSphere

See also:

opengl::Scene

#include <mrpt/viz/CSphere.h>

class CSphere: public mrpt::viz::CGeneralizedEllipsoidTemplate
{
public:
    // typedefs

    typedef mrpt::math::CMatrixFixed<float, DIM, 1> array_parameter_t;
    typedef mrpt::math::CMatrixFixed<float, DIM, 1> array_point_t;

    // construction

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

    // methods

    void setRadius(float r);
    float getRadius() const;
    void setNumberDivs(int N);
    virtual bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const;
    virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() const;
    uint32_t getNumberOfSegments() const;
};

Inherited Members

public:
    // structs

    struct OutdatedState;
    struct State;

    // methods

    void setLineWidth(float w);
    float getLineWidth() const;
    void enableAntiAliasing(bool enable = true);
    bool isAntiAliasingEnabled() const;

Construction

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

Constructor.

Methods

virtual bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const

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

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()