coolray.org FAQ Contact Us
CoolRay Banner
CoolRay / Documentation
Main Page   Class Hierarchy   Compound List   Compound Members   Related Pages  

Primitive Class Reference

this is the basis class for all primitives. More...

#include <Primitive.h>

Inheritance diagram for Primitive

Inheritance graph
[legend]
Collaboration diagram for Primitive:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { PROPERTY_TEXTURE = 0x0200, PROPERTY_PRODUCE_CAUSTICS = 0x0201 }

Public Methods

 DECLARE_ABSTRACT_CLASS (Primitive,Object3D)
 Primitive ()
virtual ~Primitive ()
virtual void setProperty (int nProperty,const Variant &value)
virtual void getProperty (int nProperty,Variant &vValue)const
virtual void acceptOperation (Visitor *pVisitor)
void setTexture (Texture *new_texture)
TexturegetTexture ()
PhotonMap* getPhotonMap ()const
PhotonMap* createPhotonMap ()
virtual Color getColor (Intersection *intersection)
 Determines the color of the Object at the given Intersection point. More...

virtual TexturegetTexture (Intersection *intersection)
 Determines the texture at the instersection point. More...

virtual FinishgetFinish (Intersection *intersection)
 Determines the finish at the intersection point. More...

virtual Vector3 getNormalVector (Intersection *intersection)
 Calculate the normal vector of the primitive at the given Intersection point. More...

virtual Vector3 getBumpmappedNormalVector (Intersection *intersection)
 Calculate the normal vector of the primitive at the given Intersection point. More...

virtual bool intersect (Ray *pRay,IntersectionList *intersectionList)
 Intersect a Ray with the Primitive. More...

virtual bool getBounds (Bounds &bounds)const
 Query for the bounding box of the primitive. More...


Public Attributes

bool produce_caustics

Protected Attributes

<Texturetexture
PhotonMap* photons

Static Protected Attributes

const Color DefaultColor

Detailed Description

this is the basis class for all primitives.

Primitives are all visible objects. Primitive extends the Object3D by adding Textures.


Member Function Documentation

bool Primitive::getBounds ( Bounds & bounds ) const [virtual]
 

Query for the bounding box of the primitive.

Parameters:
bounds   : bounds object containing the bounding area (box)
Returns:
false - inifite primitive (without bounds) true - non-infite primitive (with bounds)

Vector3 Primitive::getBumpmappedNormalVector ( Intersection * intersection ) [virtual]
 

Calculate the normal vector of the primitive at the given Intersection point.

Parameters:
intersection   : abstraction of the intersection point
Returns:
Vector3 : the normal vector (in the parent's coordinate system)

Color Primitive::getColor ( Intersection * intersection ) [virtual]
 

Determines the color of the Object at the given Intersection point.

Parameters:
intersection   : abstraction of the intersection point
Returns:
Color : the resulting color of that point

Finish * Primitive::getFinish ( Intersection * intersection ) [virtual]
 

Determines the finish at the intersection point.

Parameters:
intersection   : abstraction of the intersection point
Returns:
Finish* reference to the finish at the intersection point or a defaultFinish of no finish is available

Vector3 Primitive::getNormalVector ( Intersection * intersection ) [virtual]
 

Calculate the normal vector of the primitive at the given Intersection point.

Parameters:
intersection   : abstraction of the intersection point
Returns:
Vector3 : the normal vector (in the parent's coordinate system)

Texture * Primitive::getTexture ( Intersection * intersection ) [virtual]
 

Determines the texture at the instersection point.

Parameters:
intersection   : abstraction of the intersection point
Returns:
Texture* : reference to the texture or NULL if no texture is available for the intersection point

bool Primitive::intersect ( Ray * ray,
IntersectionList * intersectionList ) [virtual]
 

Intersect a Ray with the Primitive.

All Intersections reachable from the Ray's start point in positive direction should be inserted into the IntersectionList.

RayArea: 0 <= distance < infinity

Parameters:
pRay   : the ray the intersection should made with
intersectionList   : the destination intersectionList
Returns:
true - intersection(s) exists (hit) false - no intersection exists (miss)


The documentation for this class was generated from the following file:
  • Primitive.h
You are visitor No.

counter

Copyright (c) 2001 Stefan Michel, All Rights Reserved.
Last modified: