Ogre::PlaneOptimalShadowCameraSetup Class Reference
Core » Scene

Implements the plane optimal shadow camera algorithm. More...

`#include <OgreShadowCameraSetupPlaneOptimal.h>`

Inheritance diagram for Ogre::PlaneOptimalShadowCameraSetup:
[legend]

## Public Member Functions

| PlaneOptimalShadowCameraSetup (MovablePlane *plane)
| Constructor – requires a plane of interest. More...
virtual | ~PlaneOptimalShadowCameraSetup ()
| Destructor. More...
virtual void | getShadowCamera (const SceneManager *sm, const Camera *cam, const Viewport *vp, const Light *light, Camera *texCam, size_t iteration) const
| Returns shadow camera configured to get 1-1 homography between screen and shadow map when restricted to plane. More...
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info More...
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new More...
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info More...
void * | operator new[] (size_t sz)

## Private Member Functions

| PlaneOptimalShadowCameraSetup ()
| Default constructor is private. More...
Matrix4 | computeConstrainedProjection (const Vector4 &pinhole, const vector< Vector4 >::type &fpoint, const vector< Vector2 >::type &constraint) const
| helper function computing projection matrix given constraints More...

## Private Attributes

MovablePlane * | mPlane
| pointer to plane of interest More...

## Detailed Description

Implements the plane optimal shadow camera algorithm.

Remarks
  Given a plane of interest, it is possible to set up the shadow camera matrix such that the mapping between screen and shadow map is the identity (when restricted to pixels that view the plane of interest). Therefore, if the shadow map resolution matches the screen space resolution (of the seen planar receiver), we can get pixel perfect shadowing on the plane. Off the plane, the shadowing is not guaranteed to be perfect and will likely exhibit the usual sampling artifacts associated with shadow mapping.

Note
  Important: this routine requires double-precision calculations. When you are running under Direct3D, you must ensure that you set the floating point mode to 'Consistent' rather than 'Fastest' to ensure this precision. This does allegedly come with some performance cost but when measuring it appears to be negligible in modern systems for normal usage.
  Second important note: this projection also only works for lights with a finite position. Therefore you cannot use it for directional lights at this time.

Definition at line 62 of file OgreShadowCameraSetupPlaneOptimal.h.

## Constructor & Destructor Documentation

## PlaneOptimalShadowCameraSetup() [1/2]

Ogre::PlaneOptimalShadowCameraSetup::PlaneOptimalShadowCameraSetup | ( |  | ) |

private

Default constructor is private.

Definition at line 67 of file OgreShadowCameraSetupPlaneOptimal.h.

## PlaneOptimalShadowCameraSetup() [2/2]

Ogre::PlaneOptimalShadowCameraSetup::PlaneOptimalShadowCameraSetup | ( | MovablePlane * | plane | ) |

Constructor – requires a plane of interest.

## ~PlaneOptimalShadowCameraSetup()

virtual Ogre::PlaneOptimalShadowCameraSetup::~PlaneOptimalShadowCameraSetup | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## computeConstrainedProjection()

Matrix4 Ogre::PlaneOptimalShadowCameraSetup::computeConstrainedProjection | ( | const Vector4 & | pinhole,
|  | const vector< Vector4 >::type & | fpoint,
|  | const vector< Vector2 >::type & | constraint
| ) |  | const

private

helper function computing projection matrix given constraints

## getShadowCamera()

virtual void Ogre::PlaneOptimalShadowCameraSetup::getShadowCamera | ( | const SceneManager * | sm,
|  | const Camera * | cam,
|  | const Viewport * | vp,
|  | const Light * | light,
|  | Camera * | texCam,
|  | size_t | iteration
| ) |  | const

virtual

Returns shadow camera configured to get 1-1 homography between screen and shadow map when restricted to plane.

Implements Ogre::ShadowCameraSetup.

## operator delete() [1/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) |

inherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

## operator delete() [2/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |
| ) |  |

inherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

## operator delete() [3/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [1/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) |

inherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [2/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

## operator new() [1/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

## operator new() [2/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) |

inherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

## operator new() [3/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr
| ) |  |

inherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

## operator new[]() [1/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

## operator new[]() [2/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) |

inherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

## Member Data Documentation

## mPlane

MovablePlane* Ogre::PlaneOptimalShadowCameraSetup::mPlane

private

pointer to plane of interest

Definition at line 65 of file OgreShadowCameraSetupPlaneOptimal.h.

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

- OgreShadowCameraSetupPlaneOptimal.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.