class mrpt::opengl::CTexturedPlane
A 2D plane in the XY plane with a texture image.
Lighting is disabled in this class, so the plane color or texture will be independent of its orientation.
See also:
#include <mrpt/opengl/CTexturedPlane.h> class CTexturedPlane: public mrpt::opengl::CRenderizableShaderTexturedTriangles, public mrpt::opengl::CRenderizableShaderTriangles { public: // construction CTexturedPlane( float x_min = -1, float x_max = 1, float y_min = -1, float y_max = 1 ); // methods const auto& shaderTexturedTrianglesBuffer() const; auto& shaderTexturedTrianglesBufferMutex() const; virtual void render(const RenderContext& rc) const; virtual void renderUpdateBuffers() const; virtual void onUpdateBuffers_TexturedTriangles(); virtual void onUpdateBuffers_Triangles(); virtual shader_list_t requiredShaders() const; virtual void freeOpenGLResources(); void cullFaces(const TCullFace& cf); TCullFace cullFaces() const; void setPlaneCorners(float xMin, float xMax, float yMin, float yMax); void getPlaneCorners(float& xMin, float& xMax, float& yMin, float& yMax) const; virtual bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const; virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() const; bool isLightEnabled() const; void enableLight(bool enable = true); const mrpt::img::CImage& getTextureImage() const; const mrpt::img::CImage& getTextureAlphaImage() const; bool textureImageHasBeenAssigned() const; };
Inherited Members
public: // structs struct RenderContext; struct State; 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 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); virtual void onUpdateBuffers_Triangles() = 0;
Methods
virtual void render(const RenderContext& rc) const
Implements the rendering of 3D objects in each class derived from CRenderizable.
This can be called more than once (one per required shader program) if the object registered several shaders.
See also:
virtual void renderUpdateBuffers() const
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.
before they are sent for rendering in render()
virtual void onUpdateBuffers_TexturedTriangles()
Must be implemented in derived classes to update the geometric entities to be drawn in “m_*_buffer” fields.
virtual void onUpdateBuffers_Triangles()
Must be implemented in derived classes to update the geometric entities to be drawn in “m_*_buffer” fields.
virtual shader_list_t requiredShaders() const
Returns the ID of the OpenGL shader program required to render this class.
See also:
virtual void freeOpenGLResources()
Free opengl buffers.
void cullFaces(const TCullFace& cf)
Control whether to render the FRONT, BACK, or BOTH (default) set of faces.
Refer to docs for glCullFace()
void setPlaneCorners(float xMin, float xMax, float yMin, float yMax)
Set the coordinates of the four corners that define the plane on the XY plane.
void getPlaneCorners(float& xMin, float& xMax, float& yMin, float& yMax) const
Get the coordinates of the four corners that define the plane on the XY plane.
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()