My Project
Public Member Functions | Public Attributes | List of all members
RayCylinder Class Reference

#include <rayCylinder.h>

Inheritance diagram for RayCylinder:

Public Member Functions

int read (FILE *fp, int *materialIndex)
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 drawOpenGL (int materialIndex)
- Public Member Functions inherited from RayShape
virtual int isStatic (void)

Public Attributes

Point3D center
double height
double radius
class RayMaterialmaterial
- Public Attributes inherited from RayShape
BoundingBox3D bBox
int openGLComplexity

Detailed Description

This class represents a cylinder whose central axis is parallel to the y-axis, and is defined by the center of the cylinder, the height from the top cap to the bottom cap, and the radius of the cylinder.

Member Function Documentation

int RayCylinder::drawOpenGL ( int  materialIndex)

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

Implements RayShape.

double RayCylinder::intersect ( Ray3D  ray,
struct RayIntersectionInfo iInfo,
double  mx = -1 

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

Implements RayShape.

int RayCylinder::read ( FILE *  fp,
int *  materialIndex 

This method reads in a RayCylinder from a .ray file. A pointer to the material associated to the triangle is set.

BoundingBox3D RayCylinder::setBoundingBox ( void  )

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

Implements RayShape.

void RayCylinder::setUpOpenGL ( int  cplx)

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.

void RayCylinder::write ( int  indent,
FILE *  fp = stdout 

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.

Member Data Documentation

Point3D RayCylinder::center

The center of the cylinder

double RayCylinder::height

The hieght of the cylinder

class RayMaterial* RayCylinder::material

The material associated with the cylinder

double RayCylinder::radius

The radius of the cylinder

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