class mrpt::opengl::CSetOfTexturedTriangles

A set of textured triangles.

This class can be used to draw any solid, arbitrarily complex object with textures.

See also:

opengl::COpenGLScene

#include <mrpt/opengl/CSetOfTexturedTriangles.h>

class CSetOfTexturedTriangles: public mrpt::opengl::CRenderizableShaderTexturedTriangles
{
public:
    // typedefs

    typedef mrpt::opengl::TTriangle::Vertex TVertex;
    typedef mrpt::opengl::TTriangle TTriangle;

    //
methods

    virtual void onUpdateBuffers_TexturedTriangles();
    virtual mrpt::math::TBoundingBox getBoundingBox() const;
    void clearTriangles();
    size_t getTrianglesCount() const;
    const TTriangle& getTriangle(size_t idx) const;

    void getTriangle(
        size_t idx,
        TTriangle& t
        ) const;

    void insertTriangle(const TTriangle& t);
    virtual bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const;
};

Inherited Members

public:
    // structs

    struct RenderContext;
    struct texture_name_unit_t;

    //
methods

    virtual void render(const RenderContext& rc) const = 0;
    virtual void renderUpdateBuffers() const = 0;
    virtual shader_list_t requiredShaders() const;
    virtual auto getBoundingBox() const = 0;
    virtual void freeOpenGLResources() = 0;
    virtual shader_list_t requiredShaders() const;
    virtual void render(const RenderContext& rc) const;
    virtual void renderUpdateBuffers() const;
    virtual void onUpdateBuffers_TexturedTriangles() = 0;
    virtual void freeOpenGLResources();
    void assignImage(const mrpt::img::CImage& img);

Methods

virtual void onUpdateBuffers_TexturedTriangles()

Must be implemented in derived classes to update the geometric entities to be drawn in “m_*_buffer” fields.

virtual mrpt::math::TBoundingBox getBoundingBox() const

Evaluates the bounding box of this object (including possible children) in the coordinate frame of the object parent.

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