Loading...
Searching...
No Matches
Ogre::ShadowCaster Class Referenceabstract
Core » Scene

This class defines the interface that must be implemented by shadow casters. More...

`#include <OgreShadowCaster.h>`

Inheritance diagram for Ogre::ShadowCaster:
[legend]

## Public Types

typedef Ogre::ShadowRenderableList | 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.
const AxisAlignedBox & | getDarkCapBounds (const Light &light, Real dirLightExtrusionDist) const
| Gets the world space bounding box of the dark cap, as extruded using the light provided.
virtual EdgeData * | getEdgeList (void)
| Returns details of the edges which might be used to determine a silhouette.
const AxisAlignedBox & | getLightCapBounds (void) const
| Gets the world space bounding box of the light cap.
virtual Real | getPointExtrusionDistance (const Light *l) const =0
| Get the distance to extrude for a point/spot light.
virtual const ShadowRenderableList & | getShadowVolumeRenderableList (const Light *light, const HardwareIndexBufferPtr &indexBuffer, size_t &indexBufferUsedSize, float extrusionDistance, int flags=0)
| Gets an list of the renderables required to render the shadow volume.
virtual const AxisAlignedBox & | getWorldBoundingBox (bool derive=false) const =0
| Get the world bounding box of the caster.
bool | hasEdgeList ()
| Returns whether the object has a valid edge list.

## Static Public Member Functions

static void | clearShadowRenderableList (ShadowRenderableList &shadowRenderables)
| Common implementation of releasing shadow renderables.
static void | extrudeVertices (const HardwareVertexBufferSharedPtr &vertexBuffer, size_t originalVertexCount, const Vector4 &lightPos, Real extrudeDist)
| Utility method for extruding vertices based on a light.

## Detailed Description

This class defines the interface that must be implemented by shadow casters.

## Member Typedef Documentation

## ShadowRenderableList

typedef Ogre::ShadowRenderableList Ogre::ShadowCaster::ShadowRenderableList

## ShadowRenderableListIterator

typedef VectorIterator<ShadowRenderableList> Ogre::ShadowCaster::ShadowRenderableListIterator

## Constructor & Destructor Documentation

## ~ShadowCaster()

virtual Ogre::ShadowCaster::~ShadowCaster | ( |  | ) |

inline virtual

## Member Function Documentation

## getCastShadows()

virtual bool Ogre::ShadowCaster::getCastShadows | ( | void |  | ) | const

pure virtual

Returns whether or not this object currently casts a shadow.

Implemented in Ogre::MovableObject.

## getEdgeList()

virtual EdgeData * Ogre::ShadowCaster::getEdgeList | ( | void |  | ) |

inline virtual

Returns details of the edges which might be used to determine a silhouette.

Reimplemented in Ogre::Entity, Ogre::ManualObject, and Ogre::StaticGeometry::Region.

Referenced by hasEdgeList().

## hasEdgeList()

bool Ogre::ShadowCaster::hasEdgeList | ( |  | ) |

inline

Returns whether the object has a valid edge list.

References getEdgeList().

## getWorldBoundingBox()

virtual const AxisAlignedBox & Ogre::ShadowCaster::getWorldBoundingBox | ( | bool | derive = false | ) | const

pure virtual

Get the world bounding box of the caster.

Implemented in Ogre::Entity, Ogre::MovableObject, and Ogre::PortalBase.

Referenced by getLightCapBounds().

## getLightCapBounds()

const AxisAlignedBox & Ogre::ShadowCaster::getLightCapBounds | ( | void |  | ) | const

inline

Gets the world space bounding box of the light cap.

References getWorldBoundingBox().

## getDarkCapBounds()

const AxisAlignedBox & Ogre::ShadowCaster::getDarkCapBounds | ( | const Light & | light,
|  | Real | dirLightExtrusionDist ) const

Gets the world space bounding box of the dark cap, as extruded using the light provided.

## getShadowVolumeRenderableList()

virtual const ShadowRenderableList & Ogre::ShadowCaster::getShadowVolumeRenderableList | ( | const Light * | light,
|  | const HardwareIndexBufferPtr & | indexBuffer,
|  | size_t & | indexBufferUsedSize,
|  | float | extrusionDistance,
|  | int | flags = 0 )

virtual

Gets an list of the renderables required to render the shadow volume.

Shadowable geometry should ideally be designed such that there is only one ShadowRenderable required to render the the shadow; however this is not a necessary limitation and it can be exceeded if required.

Parameters

  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.
  indexBufferUsedSize | If the rest of buffer is enough than it would be locked with HBL_NO_OVERWRITE semantic and indexBufferUsedSize would be increased, otherwise HBL_DISCARD would be used and indexBufferUsedSize would be reset.
  extrusionDistance | The distance to extrude the shadow volume.
  flags | Technique-specific flags, see ShadowRenderableFlags.

Reimplemented in Ogre::Entity, Ogre::ManualObject, and Ogre::StaticGeometry::Region.

## clearShadowRenderableList()

void Ogre::ShadowCaster::clearShadowRenderableList | ( | ShadowRenderableList & | shadowRenderables | ) |

static

Common implementation of releasing shadow renderables.

## extrudeVertices()

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.

Unfortunately, because D3D cannot handle homogeneous (4D) position coordinates in the fixed-function pipeline (GL can, but we have to be cross-API), when we extrude in software we cannot extrude to infinity the way we do in the vertex program (by setting w to 0.0f). Therefore we extrude by a fixed distance, which may cause some problems with larger scenes. Luckily better hardware (ie vertex programs) can fix this.

Parameters

  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.

## getPointExtrusionDistance()

virtual Real Ogre::ShadowCaster::getPointExtrusionDistance | ( | const Light * | l | ) | const

pure virtual

Get the distance to extrude for a point/spot light.

Implemented in Ogre::MovableObject.

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

- OgreShadowCaster.h