28 float x_min,
float x_max,
float y_min,
float y_max)
47 #if MRPT_HAS_OPENGL_GLUT 52 m_tex_x_max = 1.0f - ((float)m_pad_x_right) / r_width;
54 m_tex_y_max = 1.0f - ((float)m_pad_y_bottom) / r_height;
81 writeToStreamRender(out);
83 out << m_xMin << m_xMax;
84 out << m_yMin << m_yMax;
86 writeToStreamTexturedObject(out);
96 readFromStreamRender(
in);
97 in >> m_textureImage >> m_textureImageAlpha;
98 in >> m_xMin >> m_xMax;
99 in >> m_yMin >> m_yMax;
101 assignImage(m_textureImage, m_textureImageAlpha);
107 readFromStreamRender(
in);
109 in >> m_xMin >> m_xMax;
110 in >> m_yMin >> m_yMax;
114 readFromStreamTexturedObject(
in);
140 if (!polygonUpToDate) updatePoly();
147 poly[0].x = poly[1].x = m_xMin;
148 poly[2].x = poly[3].x = m_xMax;
149 poly[0].y = poly[3].y = m_yMin;
150 poly[1].y = poly[2].y = m_yMax;
151 for (
size_t i = 0; i < 4; i++) poly[i].
z = 0;
154 polygonUpToDate =
true;
164 bb_max.x = std::max(m_xMin, m_xMax);
165 bb_max.y = std::max(m_yMin, m_yMax);
void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
A base class for all OpenGL objects with loadable textures.
bool traceRay(const std::vector< TPolygonWithPlane > &vec, const mrpt::math::TPose3D &pose, double &dist)
Fast ray tracing method using polygons' properties.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Simulation of ray-trace, given a pose.
A 2D plane in the XY plane with a texture image.
void render_texturedobj() const override
Must be implemented by derived classes.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This base provides a set of functions for maths stuff.
bool m_enableTransparency
Of the texture using "m_textureImageAlpha".
~CTexturedPlane() override
Private, virtual destructor: only can be deleted from smart pointers.
GLAPI void GLAPIENTRY glBegin(GLenum mode)
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
GLAPI void GLAPIENTRY glVertex3f(GLfloat x, GLfloat y, GLfloat z)
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
mrpt::img::CImage m_textureImage
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
void checkOpenGLError()
Checks glGetError and throws an exception if an error situation is found.
The namespace for 3D scene representation and rendering.
GLAPI void GLAPIENTRY glEnd(void)
mrpt::img::CImage m_textureImageAlpha
GLAPI void GLAPIENTRY glTexCoord2d(GLdouble s, GLdouble t)
GLAPI void GLAPIENTRY glDisable(GLenum cap)
static math::TPolygon3D tmpPoly(3)
3D polygon, inheriting from std::vector<TPoint3D>