#include <SphereObject.h>
Inherits Object.
Inheritance diagram for SphereObject:
Public Member Functions | |
SphereObject () | |
virtual | ~SphereObject () |
virtual Object * | createCopy () |
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 | |
Sphere * | mSphere |
Sphere primitive. |
Definition at line 14 of file SphereObject.h.
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
other | Other object |
Definition at line 23 of file SphereObject.cpp.
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
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().
Sphere* SphereObject::mSphere [protected] |
Sphere primitive.
Definition at line 51 of file SphereObject.h.
Referenced by calcBounds(), doIntersect(), setCastShadows(), setShader(), SphereObject(), and ~SphereObject().