Implements an object which is a group of polygons (Triangles). More...
#include <polyhedron.h>
Inherits rtl_groupobj.
A polyhedron is defined as a mesh of polygons. This class implements
such a mesh. It is important though that you use it correctly. If you
build a polyhedron from a stream containing the appropriate information
everything is correct however if you specify the mesh programmatically
using addvertex and compute normals you should follow these steps:
Note: if you construct a polyhedron programmatically it is important to ensure that all vertices are added before any of the triangles are constructed. Polygons are added as Triangles through the
Builds a polyhedron with room for the given number of vertices.
v_cnt The number of vertices in this polyhedron
Builds a polyhedron that references another.
Adds a vertex to the polyhedron. This function should not be called
if the polyhedron was built from a stream.
x y z object space corrdinate for this vertex.
u v texture space coordinate for this vertex.
Sets the normal for the ith vertex. Using this function will usurp automatic normal calculation for the vertex.
Computes the vertex normals. This function should not be called if the polyhedron was built from a stream. Also this function should be called after the last call to addvertex.
Returns the material which is the tri-linear combination of the materials of the vertices of the last triangle hit. If there has not been a triangle struck then the base class material is returned.
Reimplemented from rtl_subobject.
Scale the model so that it fits inside -1..1 in the widest dimension.
Returns the ith vertex for you to play with.
Returns the number of vertices there are in the model.
Reimplemented from rtl_object.
[protected]
Reimplemented from rtl_subobject.
[protected]
Reimplemented from rtl_subobject.
[protected]
Reimplemented from rtl_object.
[protected] [protected]Number of vertices in the model.
[protected]Table of vertices.
[protected]rtl_material for triangles to compute the interpolated material into.
[protected]Specifies the vertex order used to compute normals.