5#ifndef S_3D_VERTEX_HPP_INCLUDED
6#define S_3D_VERTEX_HPP_INCLUDED
8#include <nirtcpp/core/engine/vector3d.hpp>
9#include <nirtcpp/core/engine/vector2d.hpp>
10#include <nirtcpp/core/engine/SColor.hpp>
73 bool operator==(
const S3DVertex& other)
const
79 bool operator!=(
const S3DVertex& other)
const
85 bool operator<(
const S3DVertex& other)
const
87 return ((
Pos < other.Pos) ||
88 ((
Pos == other.Pos) && (
Normal < other.Normal)) ||
89 ((
Pos == other.Pos) && (
Normal == other.Normal) && (
Color < other.Color)) ||
90 ((
Pos == other.Pos) && (
Normal == other.Normal) && (
Color == other.Color) && (
TCoords < other.TCoords)));
123 :
S3DVertex(x,y,z, 0.0f, 0.0f, 0.0f, c, tu,tv),
TCoords2(tu2,tv2) {}
136 S3DVertex2TCoords(
f32 x,
f32 y,
f32 z,
f32 nx,
f32 ny,
f32 nz,
SColor c,
f32 tu,
f32 tv,
f32 tu2,
f32 tv2)
137 :
S3DVertex(x,y,z, nx,ny,nz, c, tu,tv),
TCoords2(tu2,tv2) {}
141 :
S3DVertex(x,y,z, nx,ny,nz, c, tu,tv),
TCoords2(tu,tv) {}
172 return ((
static_cast<S3DVertex>(*
this) < other) ||
207 f32 tanx=0.0f,
f32 tany=0.0f,
f32 tanz=0.0f,
209 :
S3DVertex(x,y,z, nx,ny,nz, c, tu,tv),
Tangent(tanx,tany,tanz),
Binormal(bx,by,bz) { }
214 :
S3DVertex(pos, core::vector3df(), c, tcoords) { }
251 return ((
static_cast<S3DVertex>(*
this) < other) ||
280 return sizeof(video::S3DVertex2TCoords);
282 return sizeof(video::S3DVertexTangents);
284 return sizeof(video::S3DVertex);
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
vector2d< T > getInterpolated(const vector2d< T > &other, f64 d) const
Creates an interpolated vector between this vector and another vector.
Definition vector2d.hpp:312
vector3d< T > getInterpolated(const vector3d< T > &other, f64 d) const
Creates an interpolated vector between this vector and another vector.
Definition vector3d.hpp:287
Vertex with two texture coordinates.
Definition S3DVertex.hpp:116
bool operator!=(const S3DVertex2TCoords &other) const
Inequality operator.
Definition S3DVertex.hpp:164
S3DVertex2TCoords(f32 x, f32 y, f32 z, f32 nx, f32 ny, f32 nz, SColor c, f32 tu, f32 tv)
constructor with the same texture coords and normal
Definition S3DVertex.hpp:140
core::vector2d< f32 > TCoords2
Second set of texture coordinates.
Definition S3DVertex.hpp:153
S3DVertex2TCoords(f32 x, f32 y, f32 z, f32 nx, f32 ny, f32 nz, SColor c, f32 tu, f32 tv, f32 tu2, f32 tv2)
constructor with all values
Definition S3DVertex.hpp:136
S3DVertex2TCoords(const core::vector3df &pos, SColor color, const core::vector2d< f32 > &tcoords, const core::vector2d< f32 > &tcoords2)
constructor with two different texture coords, but no normal
Definition S3DVertex.hpp:126
S3DVertex2TCoords(const core::vector3df &pos, const core::vector3df &normal, SColor color, const core::vector2d< f32 > &tcoords)
constructor with the same texture coords and normal
Definition S3DVertex.hpp:144
S3DVertex2TCoords()
default constructor
Definition S3DVertex.hpp:119
S3DVertex2TCoords(f32 x, f32 y, f32 z, SColor c, f32 tu, f32 tv, f32 tu2, f32 tv2)
constructor with two different texture coords, but no normal
Definition S3DVertex.hpp:122
bool operator==(const S3DVertex2TCoords &other) const
Equality operator.
Definition S3DVertex.hpp:157
S3DVertex2TCoords(const S3DVertex &o)
constructor from S3DVertex
Definition S3DVertex.hpp:149
S3DVertex2TCoords(const core::vector3df &pos, const core::vector3df &normal, const SColor &color, const core::vector2d< f32 > &tcoords, const core::vector2d< f32 > &tcoords2)
constructor with all values
Definition S3DVertex.hpp:131
Vertex with a tangent and binormal vector.
Definition S3DVertex.hpp:199
S3DVertexTangents(const core::vector3df &pos, SColor c, const core::vector2df &tcoords)
constructor
Definition S3DVertex.hpp:212
core::vector3df Binormal
Binormal vector (tangent x normal)
Definition S3DVertex.hpp:232
S3DVertexTangents(const core::vector3df &pos, const core::vector3df &normal, SColor c, const core::vector2df &tcoords, const core::vector3df &tangent=core::vector3df(), const core::vector3df &binormal=core::vector3df())
constructor
Definition S3DVertex.hpp:217
core::vector3df Tangent
Tangent vector along the x-axis of the texture.
Definition S3DVertex.hpp:229
S3DVertexTangents(const S3DVertex &o)
constructor from S3DVertex
Definition S3DVertex.hpp:225
S3DVertexTangents(f32 x, f32 y, f32 z, f32 nx=0.0f, f32 ny=0.0f, f32 nz=0.0f, SColor c=0xFFFFFFFF, f32 tu=0.0f, f32 tv=0.0f, f32 tanx=0.0f, f32 tany=0.0f, f32 tanz=0.0f, f32 bx=0.0f, f32 by=0.0f, f32 bz=0.0f)
constructor
Definition S3DVertex.hpp:205
S3DVertexTangents()
default constructor
Definition S3DVertex.hpp:202
standard vertex used by the Nirtcpp engine.
Definition S3DVertex.hpp:45
core::vector3df Normal
Normal vector.
Definition S3DVertex.hpp:64
SColor Color
Color.
Definition S3DVertex.hpp:67
S3DVertex(f32 x, f32 y, f32 z, f32 nx, f32 ny, f32 nz, SColor c, f32 tu, f32 tv)
constructor
Definition S3DVertex.hpp:51
static E_VERTEX_TYPE getType()
Get type of the class.
Definition S3DVertex.hpp:94
S3DVertex(const core::vector3df &pos, const core::vector3df &normal, SColor color, const core::vector2d< f32 > &tcoords)
constructor
Definition S3DVertex.hpp:55
S3DVertex()
default constructor
Definition S3DVertex.hpp:48
core::vector2d< f32 > TCoords
Texture coordinates.
Definition S3DVertex.hpp:70
core::vector3df Pos
Position.
Definition S3DVertex.hpp:61
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
SColor getInterpolated(const SColor &other, f32 d) const
Interpolates the color with a f32 value to another color.
Definition SColor.hpp:455
const T clamp(const T &value, const T &low, const T &high)
clamps a value between low and high
Definition irrMath.hpp:164
const char *const sBuiltInVertexTypeNames[]
Array holding the built in vertex type names.
Definition S3DVertex.hpp:35
E_VERTEX_TYPE
Enumeration for all vertex types there are.
Definition S3DVertex.hpp:19
@ EVT_2TCOORDS
Vertex with two texture coordinates, video::S3DVertex2TCoords.
Definition S3DVertex.hpp:25
@ EVT_STANDARD
Standard vertex type used by the Nirtcpp engine, video::S3DVertex.
Definition S3DVertex.hpp:21
@ EVT_TANGENTS
Vertex with a tangent and binormal vector, video::S3DVertexTangents.
Definition S3DVertex.hpp:31
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64
float f32
32 bit floating point variable.
Definition irrTypes.hpp:110