SphereObject Class Reference

#include <SphereObject.h>

Inherits Object.

Inheritance diagram for SphereObject:

Inheritance graph
[legend]
Collaboration diagram for SphereObject:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SphereObject ()
virtual ~SphereObject ()
virtual ObjectcreateCopy ()
virtual void setShader (Shader *sh)
virtual void setCastShadows (bool b)

Protected Member Functions

 SphereObject (const SphereObject &other)
virtual bool doIntersect (Ray &localRay) const
virtual void calcBounds ()
virtual void buildAccelStructure ()

Protected Attributes

SpheremSphere
 Sphere primitive.

Detailed Description

An object that only contain a Sphere in (0, 0, 0) and radius 0.5. No accelerating structure is used since there is only one Primitive.

Author:
Alex Busenius

Definition at line 14 of file SphereObject.h.


Constructor & Destructor Documentation

SphereObject::SphereObject (  ) 

Constructor

Definition at line 7 of file SphereObject.cpp.

References BALL_MASS, calcBounds(), LOG, PhysicalObject::mMass, and mSphere.

Referenced by createCopy().

SphereObject::~SphereObject (  )  [virtual]

Destructor

Definition at line 32 of file SphereObject.cpp.

References Object::mRefCounter, and mSphere.

SphereObject::SphereObject ( const SphereObject other  )  [protected]

Copy constructor that creates a cheap copy using reference counting. A copy constructor should be implemented in all subclasses

Parameters:
other Other object

Definition at line 23 of file SphereObject.cpp.


Member Function Documentation

virtual Object* SphereObject::createCopy (  )  [inline, virtual]

Creates a cheap copy of this object using reference counting. Both object will share the same primitives (and therefore shaders), but they can have different properties, (e.g. they can be transformed independently). Should be overwritten in all subclasses

Implements Object.

Definition at line 29 of file SphereObject.h.

References SphereObject().

virtual void SphereObject::setShader ( Shader sh  )  [inline, virtual]

Set a shader to all primitives of the object

Implements Object.

Definition at line 36 of file SphereObject.h.

References mSphere, and Primitive::setShader().

virtual void SphereObject::setCastShadows ( bool  b  )  [inline, virtual]

Set cast shadows property

Reimplemented from Object.

Definition at line 43 of file SphereObject.h.

References mSphere, Primitive::setCastShadows(), and Object::setCastShadows().

virtual bool SphereObject::doIntersect ( Ray localRay  )  const [inline, protected, virtual]

Do actual intersect with all primitives

Parameters:
localRay Ray to intersect with in local coordinates

Implements Object.

Definition at line 65 of file SphereObject.h.

References Sphere::intersect(), and mSphere.

virtual void SphereObject::calcBounds (  )  [inline, protected, virtual]

Calculate bounding box

Implements Object.

Definition at line 72 of file SphereObject.h.

References Primitive::bounds(), Object::mBoundingBox, and mSphere.

Referenced by buildAccelStructure(), and SphereObject().

virtual void SphereObject::buildAccelStructure (  )  [inline, protected, virtual]

Build acceleration structure to increase rendering performance

Implements Object.

Definition at line 79 of file SphereObject.h.

References calcBounds().


Member Data Documentation

Sphere* SphereObject::mSphere [protected]

Sphere primitive.

Definition at line 51 of file SphereObject.h.

Referenced by calcBounds(), doIntersect(), setCastShadows(), setShader(), SphereObject(), and ~SphereObject().


The documentation for this class was generated from the following files:
Generated on Fri Feb 1 00:02:30 2008 for Grayfall by  doxygen 1.5.1