7 #ifndef CAFU_MATH_BEZIERPATCH_HPP_INCLUDED
8 #define CAFU_MATH_BEZIERPATCH_HPP_INCLUDED
10 #include "Math3D/Vector3.hpp"
11 #include "Templates/Array.hpp"
83 void Subdivide(T MaxError, T MaxLength,
bool OptimizeFlat=
true);
89 void Subdivide(
unsigned long SubDivsHorz,
unsigned long SubDivsVert,
bool OptimizeFlat=
true);
130 void SetMeshSize(
unsigned long NewWidth,
unsigned long NewHeight);
131 VertexT SampleSinglePatchPoint(
const VertexT SubPatch[3][3],
const T u,
const T v)
const;
132 void SampleSinglePatch(
const VertexT SubPatch[3][3],
unsigned long baseCol,
unsigned long baseRow,
unsigned long TargetWidth,
unsigned long SubDivsHorz,
unsigned long SubDivsVert,
ArrayT<VertexT>& TargetMesh)
const;
134 void OptimizeFlatRowAndColumnStrips();
135 bool ComputeTangentSpaceInSubPatch(
unsigned long sp_i,
unsigned long sp_j,
const T s,
const T t,
Vector3T<T> Axes[3])
const;
Vector3T< T > Normal
Vertex normal.
Definition: BezierPatch.hpp:49
Vector3T< T > Coord
Vertex coordinate.
Definition: BezierPatch.hpp:47
bool WrapsHorz() const
Returns whether the left and right borders are identical.
Definition: BezierPatch.cpp:888
Vector3T< T > TangentS
DOCTODO.
Definition: BezierPatch.hpp:50
void Subdivide(T MaxError, T MaxLength, bool OptimizeFlat=true)
This method subdivides the patch "automatically", that is, by the given maximal error and length boun...
Definition: BezierPatch.cpp:356
T GetSurfaceAreaAtVertex(unsigned long i, unsigned long j) const
Returns the area of the Bezier patch surface around vertex (i, j).
Definition: BezierPatch.cpp:657
Represents a single vertex.
Definition: BezierPatch.hpp:45
This class represents a polymorphic 3-dimensional vector.
Definition: Misc.hpp:11
BezierPatchT()
Constructor for creating an empty Bezier patch.
Definition: BezierPatch.cpp:66
const VertexT & GetVertex(unsigned long i, unsigned long j) const
Returns the const mesh vertex at (i, j).
Definition: BezierPatch.hpp:110
VertexT & GetVertex(unsigned long i, unsigned long j)
Returns the (non-const) mesh vertex at (i, j).
Definition: BezierPatch.hpp:113
unsigned long Width
Number of vertices in width direction.
Definition: BezierPatch.hpp:122
void ForceLinearMaxLength(T MaxLength)
Intended to be called after one of the Subdivide() methods has been called, this methods linearly sub...
Definition: BezierPatch.cpp:585
ArrayT< VertexT > Mesh
Array of Width*Heights vertices that build up the bezier patch.
Definition: BezierPatch.hpp:124
unsigned long Height
Number of vertices in height direction.
Definition: BezierPatch.hpp:123
void Average(const VertexT &A, const VertexT &B)
Computes the values of this vertex as the average of the given vertices A and B.
Definition: BezierPatch.cpp:54
void ComputeTangentSpace_Obsolete()
(Re-)computes the tangent space vectors (normal and tangents) for each vertex of the mesh...
Definition: BezierPatch.cpp:192
Vector3T< T > TexCoord
Vertex texture coordinates.
Definition: BezierPatch.hpp:48
bool WrapsVert() const
Returns whether the top and bottom borders are identical.
Definition: BezierPatch.cpp:899
Definition: Renderer.hpp:16
void ComputeTangentSpace()
(Re-)computes the tangent space vectors (normal and tangents) for each vertex of the mesh...
Definition: BezierPatch.cpp:100
This class represents a mesh that approximates a Bezier patch.
Definition: BezierPatch.hpp:40
Vector3T< T > TangentT
DOCTODO.
Definition: BezierPatch.hpp:51