Inheritance diagram for RayTriangle:
Public Member Functions | |
int | read (FILE *fp, int *materialIndex, RayVertex *vList, int vSize) |
void | write (int indent, FILE *fp=stdout) |
double | intersect (Ray3D ray, struct RayIntersectionInfo &iInfo, double mx=-1) |
BoundingBox3D | setBoundingBox (void) |
void | setUpOpenGL (int cplx, int setCallList) |
int | drawOpenGL (int materialIndex) |
Public Attributes | |
RayVertex * | v [3] |
RayMaterial * | material |
|
This method calls the necessary OpenGL commands to render the primitive. Implements RayShape. |
|
This method computes the intersection of the shape with the ray. If the ray hits the shape and either mx is less than zero or the intersection occurs at a distance less than t along the ray the intersection information in iInfo is set and a value greater than 0 is returned. Otherwise, -1 is returned. (This is useful for shadow testing when you may want to ignore hits beyond a certain distance). Either way the isectCounter is incremented by one. Implements RayShape. |
|
This method reads in a RayTriangle from a .ray file. A pointer to the material associated to the triangle is set. The vertex positions are determined by reading in the vertex indices from the file and then looking them up in the vertex list vList |
|
This method sets and returns a bounding box containing the shape. Implements RayShape. |
|
This method sets up all the stuff that's necessary prior to OpenGL rendering. The value cplx represents the desired resolution of tessalation for objects such as spheres, cylinders, etc.. Implements RayShape. |
|
This method writes the RayShape out to a .ray file, indenting the output by the specified amount. If no file is specified, the information gets written to stdout. Implements RayShape. |
|
The material associated with the triangle |
|
The vertices of the triangle |