Class CTexturedPlane
Defined in File CTexturedPlane.h
Inheritance Relationships
Base Types
public mrpt::viz::CVisualObject(Class CVisualObject)public mrpt::viz::VisualObjectParams_Triangles(Class VisualObjectParams_Triangles)public mrpt::viz::VisualObjectParams_TexturedTriangles(Class VisualObjectParams_TexturedTriangles)
Class Documentation
-
class CTexturedPlane : public virtual mrpt::viz::CVisualObject, public mrpt::viz::VisualObjectParams_Triangles, public mrpt::viz::VisualObjectParams_TexturedTriangles
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
opengl::Scene
Public Functions
-
CTexturedPlane(float x_min = -1, float x_max = 1, float y_min = -1, float y_max = 1)
-
inline 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.
-
inline 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.
-
inline void setTextureRepeat(float repeatX, float repeatY)
Set the number of times the texture repeats in each direction. Default is (1,1), i.e. the texture spans the entire plane once.
-
inline void enableLighting(bool enable = true)
-
virtual void updateBuffers() const override
Called by the rendering system to update internal geometry buffers.
Derived classes should override this to populate their data buffers (triangles, points, lines) when the object geometry changes.
This is called automatically when hasToUpdateBuffers() returns true, which happens after notifyChange() was called.
The base implementation does nothing; derived classes should override.
Note
Thread safety: implementations should lock the appropriate mutexes when writing to shared buffers.
-
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
Protected Functions
-
void updatePoly() const
-
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()
-
CTexturedPlane(float x_min = -1, float x_max = 1, float y_min = -1, float y_max = 1)