This class defines the interface that must be implemented by shadow casters. More...
#include <OgreShadowCaster.h>
Public Types | |
typedef vector < ShadowRenderable * >::type | ShadowRenderableList |
typedef VectorIterator < ShadowRenderableList > | ShadowRenderableListIterator |
Public Member Functions | |
virtual | ~ShadowCaster () |
virtual bool | getCastShadows (void) const =0 |
Returns whether or not this object currently casts a shadow. | |
virtual EdgeData * | getEdgeList (void)=0 |
Returns details of the edges which might be used to determine a silhouette. | |
virtual bool | hasEdgeList (void)=0 |
Returns whether the object has a valid edge list. | |
virtual const AxisAlignedBox & | getWorldBoundingBox (bool derive=false) const =0 |
Get the world bounding box of the caster. | |
virtual const AxisAlignedBox & | getLightCapBounds (void) const =0 |
Gets the world space bounding box of the light cap. | |
virtual const AxisAlignedBox & | getDarkCapBounds (const Light &light, Real dirLightExtrusionDist) const =0 |
Gets the world space bounding box of the dark cap, as extruded using the light provided. | |
virtual ShadowRenderableListIterator | getShadowVolumeRenderableIterator (ShadowTechnique shadowTechnique, const Light *light, HardwareIndexBufferSharedPtr *indexBuffer, bool extrudeVertices, Real extrusionDistance, unsigned long flags=0)=0 |
Gets an iterator over the renderables required to render the shadow volume. | |
virtual Real | getPointExtrusionDistance (const Light *l) const =0 |
Get the distance to extrude for a point/spot light. | |
Static Public Member Functions | |
static void | extrudeVertices (const HardwareVertexBufferSharedPtr &vertexBuffer, size_t originalVertexCount, const Vector4 &lightPos, Real extrudeDist) |
Utility method for extruding vertices based on a light. | |
Protected Member Functions | |
Real | getExtrusionDistance (const Vector3 &objectPos, const Light *light) const |
Helper method for calculating extrusion distance. | |
virtual void | updateEdgeListLightFacing (EdgeData *edgeData, const Vector4 &lightPos) |
Tells the caster to perform the tasks necessary to update the edge data's light listing. | |
virtual void | generateShadowVolume (EdgeData *edgeData, const HardwareIndexBufferSharedPtr &indexBuffer, const Light *light, ShadowRenderableList &shadowRenderables, unsigned long flags) |
Generates the indexes required to render a shadow volume into the index buffer which is passed in, and updates shadow renderables to use it. | |
virtual void | extrudeBounds (AxisAlignedBox &box, const Vector4 &lightPos, Real extrudeDist) const |
Utility method for extruding a bounding box. |
This class defines the interface that must be implemented by shadow casters.
Definition at line 116 of file OgreShadowCaster.h.
typedef vector<ShadowRenderable*>::type Ogre::ShadowCaster::ShadowRenderableList |
Definition at line 135 of file OgreShadowCaster.h.
Definition at line 136 of file OgreShadowCaster.h.
virtual Ogre::ShadowCaster::~ShadowCaster | ( | ) | [virtual] |
Definition at line 119 of file OgreShadowCaster.h.
virtual void Ogre::ShadowCaster::extrudeBounds | ( | AxisAlignedBox & | box, | |
const Vector4 & | lightPos, | |||
Real | extrudeDist | |||
) | const [protected, virtual] |
Utility method for extruding a bounding box.
box | Original bounding box, will be updated in-place | |
lightPos | 4D light position in object space, when w=0.0f this represents a directional light | |
extrudeDist | The distance to extrude |
static void Ogre::ShadowCaster::extrudeVertices | ( | const HardwareVertexBufferSharedPtr & | vertexBuffer, | |
size_t | originalVertexCount, | |||
const Vector4 & | lightPos, | |||
Real | extrudeDist | |||
) | [static] |
Utility method for extruding vertices based on a light.
vertexBuffer | The vertex buffer containing ONLY xyz position values, which must be originalVertexCount * 2 * 3 floats long. | |
originalVertexCount | The count of the original number of vertices, i.e. the number in the mesh, not counting the doubling which has already been done (by VertexData::prepareForShadowVolume) to provide the extruded area of the buffer. | |
lightPos | 4D light position in object space, when w=0.0f this represents a directional light | |
extrudeDist | The distance to extrude |
virtual void Ogre::ShadowCaster::generateShadowVolume | ( | EdgeData * | edgeData, | |
const HardwareIndexBufferSharedPtr & | indexBuffer, | |||
const Light * | light, | |||
ShadowRenderableList & | shadowRenderables, | |||
unsigned long | flags | |||
) | [protected, virtual] |
Generates the indexes required to render a shadow volume into the index buffer which is passed in, and updates shadow renderables to use it.
edgeData | The edge information to use | |
indexBuffer | The buffer into which to write data into; current contents are assumed to be discardable. | |
light | The light, mainly for type info as silhouette calculations should already have been done in updateEdgeListLightFacing | |
shadowRenderables | A list of shadow renderables which has already been constructed but will need populating with details of the index ranges to be used. | |
flags | Additional controller flags, see ShadowRenderableFlags |
virtual bool Ogre::ShadowCaster::getCastShadows | ( | void | ) | const [pure virtual] |
Returns whether or not this object currently casts a shadow.
Implemented in Ogre::MovableObject, and Ogre::TerrainQuadTreeNode::Movable.
virtual const AxisAlignedBox& Ogre::ShadowCaster::getDarkCapBounds | ( | const Light & | light, | |
Real | dirLightExtrusionDist | |||
) | const [pure virtual] |
Gets the world space bounding box of the dark cap, as extruded using the light provided.
Implemented in Ogre::MovableObject.
virtual EdgeData* Ogre::ShadowCaster::getEdgeList | ( | void | ) | [pure virtual] |
Returns details of the edges which might be used to determine a silhouette.
Implemented in Ogre::Entity, Ogre::ManualObject, Ogre::MovableObject, and Ogre::StaticGeometry::Region.
Real Ogre::ShadowCaster::getExtrusionDistance | ( | const Vector3 & | objectPos, | |
const Light * | light | |||
) | const [protected] |
Helper method for calculating extrusion distance.
virtual const AxisAlignedBox& Ogre::ShadowCaster::getLightCapBounds | ( | void | ) | const [pure virtual] |
Gets the world space bounding box of the light cap.
Implemented in Ogre::MovableObject.
Get the distance to extrude for a point/spot light.
Implemented in Ogre::MovableObject.
virtual ShadowRenderableListIterator Ogre::ShadowCaster::getShadowVolumeRenderableIterator | ( | ShadowTechnique | shadowTechnique, | |
const Light * | light, | |||
HardwareIndexBufferSharedPtr * | indexBuffer, | |||
bool | extrudeVertices, | |||
Real | extrusionDistance, | |||
unsigned long | flags = 0 | |||
) | [pure virtual] |
Gets an iterator over the renderables required to render the shadow volume.
shadowTechnique | The technique being used to generate the shadow | |
light | The light to generate the shadow from | |
indexBuffer | The index buffer to build the renderables into, the current contents are assumed to be disposable. | |
extrudeVertices | If true, this means this class should extrude the vertices of the back of the volume in software. If false, it will not be done (a vertex program is assumed). | |
extrusionDistance | The distance to extrude the shadow volume | |
flags | Technique-specific flags, see ShadowRenderableFlags |
Implemented in Ogre::Entity, Ogre::ManualObject, Ogre::MovableObject, and Ogre::StaticGeometry::Region.
virtual const AxisAlignedBox& Ogre::ShadowCaster::getWorldBoundingBox | ( | bool | derive = false |
) | const [pure virtual] |
Get the world bounding box of the caster.
Implemented in Ogre::Entity, and Ogre::MovableObject.
virtual bool Ogre::ShadowCaster::hasEdgeList | ( | void | ) | [pure virtual] |
Returns whether the object has a valid edge list.
Implemented in Ogre::Entity, Ogre::ManualObject, Ogre::MovableObject, and Ogre::StaticGeometry::Region.
virtual void Ogre::ShadowCaster::updateEdgeListLightFacing | ( | EdgeData * | edgeData, | |
const Vector4 & | lightPos | |||
) | [protected, virtual] |
Tells the caster to perform the tasks necessary to update the edge data's light listing.
Can be overridden if the subclass needs to do additional things.
edgeData | The edge information to update | |
lightPos | 4D vector representing the light, a directional light has w=0.0 |
Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Fri May 25 23:40:21 2012