Go to the documentation of this file.
56 for (
size_t i = 0; i < 3; i++)
60 pp.r = pp.g = pp.b = 0xff;
90 const float&
x(
size_t i)
const {
return vertices[i].xyzrgba.pt.x; }
91 const float&
y(
size_t i)
const {
return vertices[i].xyzrgba.pt.y; }
92 const float&
z(
size_t i)
const {
return vertices[i].xyzrgba.pt.z; }
93 const uint8_t&
r(
size_t i)
const {
return vertices[i].xyzrgba.r; }
94 const uint8_t&
g(
size_t i)
const {
return vertices[i].xyzrgba.g; }
95 const uint8_t&
b(
size_t i)
const {
return vertices[i].xyzrgba.b; }
96 const uint8_t&
a(
size_t i)
const {
return vertices[i].xyzrgba.a; }
97 const float&
u(
size_t i)
const {
return vertices[i].uv.x; }
98 const float&
v(
size_t i)
const {
return vertices[i].uv.y; }
99 float&
x(
size_t i) {
return vertices[i].xyzrgba.pt.x; }
118 for (
size_t i = 0; i < 3; i++)
void setColor(const mrpt::img::TColor &c)
const mrpt::math::TPoint3Df & vertex(size_t i) const
const uint8_t & r(size_t i) const
TTriangle(const mrpt::math::TPolygon3D &p)
void readFrom(mrpt::serialization::CArchive &i)
#define ASSERT_EQUAL_(__A, __B)
Assert comparing two values, reporting their actual values upon failure.
Base template for TPoint2D and TPoint2Df.
uint8_t f2u8(const float f)
converts a float [0,1] into an uint8_t [0,255] (without checking for out of bounds)
mrpt::math::TVector2Df uv
texture coordinates (0,0)-(1,1)
mrpt::math::TVector3Df normal
Must not be normalized.
const float & u(size_t i) const
TTriangle(const mrpt::math::TPoint3Df &p1, const mrpt::math::TPoint3Df &p2, const mrpt::math::TPoint3Df &p3, const mrpt::math::TVector3Df &n1, const mrpt::math::TVector3Df &n2, const mrpt::math::TVector3Df &n3)
Constructor from 3 points and its 3 normals.
Virtual base class for "archives": classes abstracting I/O streams.
const uint8_t & b(size_t i) const
An RGBA color - floats in the range [0,1].
const float & x(size_t i) const
XYZ point (float) + RGBA(u8)
3D polygon, inheriting from std::vector<TPoint3D>
TTriangle(const mrpt::math::TPoint3Df &p1, const mrpt::math::TPoint3Df &p2, const mrpt::math::TPoint3Df &p3)
Constructor from 3 points (default normals are computed)
mrpt::math::TPoint3Df & vertex(size_t i)
mrpt::math::TPointXYZfRGBAu8 xyzrgba
void setColor(const mrpt::img::TColor &c)
Sets the color of all vertices.
A triangle (float coordinates) with RGBA colors (u8) and UV (texture coordinates) for each vertex.
const float & y(size_t i) const
const float & z(size_t i) const
std::array< Vertex, 3 > vertices
void setColor(const mrpt::img::TColorf &c)
const uint8_t & a(size_t i) const
const uint8_t & g(size_t i) const
void computeNormals()
Compute the three normals from the cross-product of "v01 x v02".
const float & v(size_t i) const
The namespace for 3D scene representation and rendering.
void writeTo(mrpt::serialization::CArchive &o) const
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sat Jun 27 14:00:59 UTC 2020 | |