11 #ifndef CAFU_MATSYS_MESH_HPP_INCLUDED
12 #define CAFU_MATSYS_MESH_HPP_INCLUDED
14 #include "Templates/Array.hpp"
15 #include "Math3D/Vector3.hpp"
49 enum TypeT { Points, Lines, LineStrip, LineLoop, Triangles, TriangleStrip, TriangleFan, Quads, QuadStrip, Polygon };
50 enum WindingT { CW, CCW };
57 float TextureCoord[2];
58 float LightMapCoord[2];
70 void SetOrigin(
double x=0.0,
double y=0.0,
double z=0.0,
double w=1.0) { Origin[0]=x; Origin[1]=y; Origin[2]=z; Origin[3]=w; }
71 void SetOrigin(
const Vector3fT& Pos,
float w=1.0) { Origin[0]=Pos.
x; Origin[1]=Pos.
y; Origin[2]=Pos.
z; Origin[3]=w; }
72 void SetColor(
float r,
float g,
float b,
float a=1.0) { Color[0]=r; Color[1]=g; Color[2]=b; Color[3]=a; }
73 void SetTextureCoord(
float s,
float t) { TextureCoord[0]=s; TextureCoord[1]=t; }
74 void SetLightMapCoord(
float s,
float t) { LightMapCoord[0]=s; LightMapCoord[1]=t; }
75 void SetSHLMapCoord(
float s,
float t) { SHLMapCoord[0]=s; SHLMapCoord[1]=t; }
76 void SetNormal(
float x,
float y,
float z) { Normal[0]=x; Normal[1]=y; Normal[2]=z; }
77 void SetNormal(
const Vector3T<float>& N) { Normal[0]=N.
x; Normal[1]=N.
y; Normal[2]=N.
z; }
78 void SetTangent(
float x,
float y,
float z) { Tangent[0]=x; Tangent[1]=y; Tangent[2]=z; }
79 void SetTangent(
const Vector3T<float>& T) { Tangent[0]=T.
x; Tangent[1]=T.
y; Tangent[2]=T.
z; }
80 void SetBiNormal(
float x,
float y,
float z) { BiNormal[0]=x; BiNormal[1]=y; BiNormal[2]=z; }
81 void SetBiNormal(
const Vector3T<float>& B) { BiNormal[0]=B.
x; BiNormal[1]=B.
y; BiNormal[2]=B.
z; }
WindingT Winding
The orientation (cw or ccw) of front faces.
Definition: Mesh.hpp:85
T y
The y-component of this vector.
Definition: Vector3.hpp:41
T z
The z-component of this vector.
Definition: Vector3.hpp:42
T x
The x-component of this vector.
Definition: Vector3.hpp:40
Definition: Renderer.hpp:16
This class represents a polygonal mesh.
Definition: Mesh.hpp:45
MeshT(TypeT T=Points, WindingT W=CW)
Constructor.
Definition: Mesh.hpp:90