My Project
Public Member Functions | Public Attributes | List of all members
RayShape Class Referenceabstract

#include <rayShape.h>

Inheritance diagram for RayShape:
RayBox RayCone RayCylinder RayFileInstance RayGroup RaySphere RayTriangle ParametrizedRayGroup StaticRayGroup ParametrizedClosestRotationAndTranslation ParametrizedEulerAnglesAndTranslation ParametrizedMatrix4D ParametrizedQuaternionAndTranslation ParametrizedRotationLogarithmAndTranslation

Public Member Functions

virtual void write (int indent, FILE *fp=stdout)=0
 
virtual double intersect (Ray3D ray, struct RayIntersectionInfo &iInfo, double mx=-1)=0
 
virtual BoundingBox3D setBoundingBox (void)=0
 
virtual void setUpOpenGL (int cplx)=0
 
virtual int drawOpenGL (int materialIndex)=0
 
virtual int isStatic (void)
 

Public Attributes

BoundingBox3D bBox
 
int openGLComplexity
 

Detailed Description

This is the abstract class that all ray-traceable objects must implement.

Member Function Documentation

virtual int RayShape::drawOpenGL ( int  materialIndex)
pure virtual

This method calls the necessary OpenGL commands to render the primitive.

Implemented in RayGroup, RayTriangle, RayCone, RayBox, RayCylinder, RaySphere, and RayFileInstance.

virtual double RayShape::intersect ( Ray3D  ray,
struct RayIntersectionInfo iInfo,
double  mx = -1 
)
pure virtual

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 mx 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).

Implemented in RayGroup, RayTriangle, RayCone, RayBox, RayCylinder, RaySphere, and RayFileInstance.

virtual int RayShape::isStatic ( void  )
inlinevirtual

This method returns a value of 1 if the RayShape's geometry doesn't change.

Reimplemented in ParametrizedRayGroup, StaticRayGroup, and RayFileInstance.

virtual BoundingBox3D RayShape::setBoundingBox ( void  )
pure virtual

This method sets and returns a bounding box containing the shape.

Implemented in RayGroup, RayTriangle, RayCone, RayBox, RayCylinder, RaySphere, and RayFileInstance.

virtual void RayShape::setUpOpenGL ( int  cplx)
pure virtual

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..

Implemented in RayGroup, RayTriangle, RayCone, RayBox, RayCylinder, RaySphere, and RayFileInstance.

virtual void RayShape::write ( int  indent,
FILE *  fp = stdout 
)
pure virtual

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.

Implemented in RayGroup, RayTriangle, RayCone, RayBox, RayCylinder, RaySphere, and RayFileInstance.

Member Data Documentation

BoundingBox3D RayShape::bBox

The bounding box of the shape

int RayShape::openGLComplexity

The complexity for the rasterization of the shape


The documentation for this class was generated from the following file: