34 return CTexturedPlanePtr(
new CTexturedPlane(x_min, x_max, y_min, y_max) );
45 polygonUpToDate(false)
67 #if MRPT_HAS_OPENGL_GLUT 175 poly[0].x=poly[1].x=
m_xMin;
176 poly[2].x=poly[3].x=
m_xMax;
177 poly[0].y=poly[3].y=
m_yMin;
178 poly[1].y=poly[2].y=
m_yMax;
179 for (
size_t i=0;i<4;i++) poly[i].
z=0;
void assignImage(const mrpt::utils::CImage &img, const mrpt::utils::CImage &imgAlpha)
Assigns a texture and a transparency image, and enables transparency (If the images are not 2^N x 2^M...
void writeToStreamRender(utils::CStream &out) const
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
A base class for all OpenGL objects with loadable textures.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
bool BASE_IMPEXP traceRay(const std::vector< TPolygonWithPlane > &vec, const mrpt::poses::CPose3D &pose, double &dist)
Fast ray tracing method using polygons' properties.
virtual ~CTexturedPlane()
Private, virtual destructor: only can be deleted from smart pointers.
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
double z
X,Y,Z coordinates.
A 2D plane in the XY plane with a texture image.
mrpt::poses::CPose3D m_pose
6D pose wrt the parent coordinate reference. This class automatically holds the cached 3x3 rotation m...
virtual bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const MRPT_OVERRIDE
Simulation of ray-trace, given a pose.
virtual void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const MRPT_OVERRIDE
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
void composePoint(double lx, double ly, double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=NULL, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=NULL, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dse3=NULL, bool use_small_rot_approx=false) const
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
void render_texturedobj() const MRPT_OVERRIDE
Must be implemented by derived classes.
This base provides a set of functions for maths stuff.
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
bool m_enableTransparency
Of the texture using "m_textureImageAlpha".
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
void readFromStreamRender(mrpt::utils::CStream &in)
GLAPI void GLAPIENTRY glBegin(GLenum mode)
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
void writeToStreamTexturedObject(mrpt::utils::CStream &out) const
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
GLAPI void GLAPIENTRY glVertex3f(GLfloat x, GLfloat y, GLfloat z)
std::vector< mrpt::math::TPolygonWithPlane > tmpPoly
Used for ray-tracing.
int m_pad_y_bottom
The size of the fill in pixels in the textured image, w.r.t the image passed by the user...
static void checkOpenGLError()
Checks glGetError and throws an exception if an error situation is found.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
mrpt::utils::CImage m_textureImage
The namespace for 3D scene representation and rendering.
GLAPI void GLAPIENTRY glEnd(void)
int r_height
Size of the texture image, rounded up to next power of 2.
GLAPI void GLAPIENTRY glTexCoord2d(GLdouble s, GLdouble t)
CTexturedPlane(float x_min=-1, float x_max=1, float y_min=-1, float y_max=1)
Constructor.
GLAPI void GLAPIENTRY glDisable(GLenum cap)
3D polygon, inheriting from std::vector<TPoint3D>
mrpt::utils::CImage m_textureImageAlpha
void readFromStreamTexturedObject(mrpt::utils::CStream &in)