class mrpt::viz::CTexturedPlane
Overview
A 2D plane in the XY plane with a texture image.
Lighting is disabled by default in this class, so the plane color or texture will be independent of its orientation or shadows cast on it. This can be changed calling enableLighting(true)
See also:
#include <mrpt/viz/CTexturedPlane.h> class CTexturedPlane: public mrpt::viz::CVisualObject, public mrpt::viz::VisualObjectParams_Triangles, public mrpt::viz::VisualObjectParams_TexturedTriangles { public: // construction CTexturedPlane( float x_min = -1, float x_max = 1, float y_min = -1, float y_max = 1 ); // methods void setPlaneCorners(float xMin, float xMax, float yMin, float yMax); void getPlaneCorners(float& xMin, float& xMax, float& yMin, float& yMax) const; void enableLighting(bool enable = true); virtual bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const; virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() const; };
Inherited Members
public: // typedefs typedef std::shared_ptr<CObject> Ptr; typedef std::shared_ptr<const CObject> ConstPtr; typedef std::unique_ptr<CObject> UniquePtr; typedef std::unique_ptr<const CObject> ConstUniquePtr; // structs struct OutdatedState; struct State; // methods const auto& shaderTrianglesBuffer() const; auto& shaderTrianglesBufferMutex() const; virtual CVisualObject& setColor_u8(const mrpt::img::TColor& c); bool isLightEnabled() const; void enableLight(bool enable = true); TCullFace cullFaces() const; void notifyBBoxChange() const; auto getBoundingBoxLocalf() const; static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); const auto& shaderTexturedTrianglesBuffer() const; auto& shaderTexturedTrianglesBufferMutex() const; bool isLightEnabled() const; void enableLight(bool enable = true); TCullFace cullFaces() const; const mrpt::img::CImage& getTextureImage() const; const mrpt::img::CImage& getTextureAlphaImage() const; bool textureImageHasBeenAssigned() const; bool textureLinearInterpolation() const; void enableTextureMipMap(bool enable); bool textureMipMap() const;
Methods
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()