#include <eng_graph_draw.hh>

Public Member Functions | |
| VisitorComputeNormals (Graph &graph, NormalsNode &normalsNode, const LocalVertexs &localVertexs) | |
| ~VisitorComputeNormals () | |
| void | Begin (void) |
| void | End (void) |
Private Member Functions | |
| template<typename VIXS> | |
| void | ComputeAndTotalNormal (const Nix nix, const VIXS &vixs) |
| void | Visit (PolygonNode &node) |
Private Attributes | |
| const LocalVertexs & | mLocalVertexs |
| NormalVertexs & | mPolygonNormals |
| NormalVertexs & | mVertexNormals |
| eng::VisitorComputeNormals::VisitorComputeNormals | ( | Graph & | graph, | |
| NormalsNode & | normalsNode, | |||
| const LocalVertexs & | localVertexs | |||
| ) |
| eng::VisitorComputeNormals::~VisitorComputeNormals | ( | ) |
| void eng::VisitorComputeNormals::Begin | ( | void | ) | [inline] |
| void eng::VisitorComputeNormals::End | ( | void | ) | [virtual] |
Called at end of traversal. mVertexNormals now contains totals of vectors. The final step in averaging normal vectors is to normalize them. A mathematical property of vectors (OpenGL red book) is that adding vectors then normalizing the sum results in a normalized average. Normalize( v1 + v2 + v3 ) = Normalize( (v1 + v2 + v3) / 3.0 )
Reimplemented from eng::Visitor.
| void eng::VisitorComputeNormals::ComputeAndTotalNormal | ( | const Nix | nix, | |
| const VIXS & | vixs | |||
| ) | [inline, private] |
Compute normal vector on this polygon. Along the way, for the goal of averaging normal vectors of polygons adjacent to a vertex, add this normal vector to a total, to be later divided to produce an average.
A mathematical propery of vectors (OpenGL red book) is that adding vectors then normalizing the sum results in a normalized average. Normalize( v1 + v2 + v3 ) = Normalize( (v1 + v2 + v3) / 3.0 ) VisitorComputeNormals uses this property since it doesn't know how many vectors there will be (divisor unknown).
| void eng::VisitorComputeNormals::Visit | ( | PolygonNode & | node | ) | [inline, private, virtual] |
Reimplemented from eng::Visitor.
const LocalVertexs& eng::VisitorComputeNormals::mLocalVertexs [private] |
NormalVertexs& eng::VisitorComputeNormals::mPolygonNormals [private] |
NormalVertexs& eng::VisitorComputeNormals::mVertexNormals [private] |
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:21 2007