C# Класс Axiom.Graphics.ShadowCaster

This class defines the interface that must be implemented by shadow casters.
Наследование: DisposableObject
Показать файл Открыть проект

Открытые методы

Метод Описание
ExtrudeVertices ( HardwareVertexBuffer vertexBuffer, int originalVertexCount, Vector4 lightPosition, float extrudeDistance ) : void

Utility method for extruding vertices based on a light.

Unfortunately, because D3D cannot handle homogenous (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.

GetDarkCapBounds ( Light light, float dirLightExtrusionDist ) : AxisAlignedBox

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

GetEdgeList ( ) : EdgeData

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

Defaults to LOD index 0.

GetEdgeList ( int lodIndex ) : EdgeData

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

GetLastShadowVolumeRenderableEnumerator ( ) : IEnumerator

Return the last calculated shadow renderables.

GetLightCapBounds ( ) : AxisAlignedBox

Gets the world space bounding box of the light cap.

GetPointExtrusionDistance ( Light light ) : float

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

GetShadowVolumeRenderableEnumerator ( ShadowTechnique technique, Light light, HardwareIndexBuffer indexBuffer, bool extrudeVertices, float extrusionDistance, int flags ) : IEnumerator

Gets an iterator over 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.

GetShadowVolumeRenderableEnumerator ( ShadowTechnique technique, Light light, HardwareIndexBuffer indexBuffer, float extrusionDistance, bool extrudeVertices ) : IEnumerator
GetWorldBoundingBox ( ) : AxisAlignedBox
GetWorldBoundingBox ( bool derive ) : AxisAlignedBox

Get the world bounding box of the caster.

Защищенные методы

Метод Описание
ExtrudeBounds ( AxisAlignedBox box, Vector4 lightPosition, float extrudeDistance ) : void

Utility method for extruding a bounding box.

GenerateShadowVolume ( EdgeData edgeData, HardwareIndexBuffer indexBuffer, Light light, ShadowRenderableList shadowRenderables, int flags ) : void

Generates the indexes required to render a shadow volume into the index buffer which is passed in, and updates shadow renderables to use it.

GetExtrusionDistance ( Vector3 objectPos, Light light ) : float

Helper method for calculating extrusion distance.

UpdateEdgeListLightFacing ( EdgeData edgeData, Vector4 lightPosition ) : void

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.

Описание методов

ExtrudeBounds() защищенный Метод

Utility method for extruding a bounding box.
protected ExtrudeBounds ( AxisAlignedBox box, Vector4 lightPosition, float extrudeDistance ) : void
box Axiom.Math.AxisAlignedBox Original bounding box, will be updated in-place.
lightPosition Vector4 4D light position in object space, when w=0.0f this /// represents a directional light
extrudeDistance float The distance to extrude.
Результат void

ExtrudeVertices() публичный статический Метод

Utility method for extruding vertices based on a light.
Unfortunately, because D3D cannot handle homogenous (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.
public static ExtrudeVertices ( HardwareVertexBuffer vertexBuffer, int originalVertexCount, Vector4 lightPosition, float extrudeDistance ) : void
vertexBuffer HardwareVertexBuffer The vertex buffer containing ONLY xyz position /// values, which must be originalVertexCount * 2 * 3 floats long.
originalVertexCount int The count of the original number of /// vertices, ie the number in the mesh, not counting the doubling /// which has already been done (by ) /// to provide the extruded area of the buffer.
lightPosition Vector4 4D light position in object space, when w=0.0f this /// represents a directional light
extrudeDistance float The distance to extrude.
Результат void

GenerateShadowVolume() защищенный Метод

Generates the indexes required to render a shadow volume into the index buffer which is passed in, and updates shadow renderables to use it.
protected GenerateShadowVolume ( EdgeData edgeData, HardwareIndexBuffer indexBuffer, Light light, ShadowRenderableList shadowRenderables, int flags ) : void
edgeData EdgeData The edge information to use.
indexBuffer HardwareIndexBuffer The buffer into which to write data into; current /// contents are assumed to be discardable.
light Axiom.Core.Light The light, mainly for type info as silhouette calculations /// should already have been done in
shadowRenderables ShadowRenderableList A list of shadow renderables which has /// already been constructed but will need populating with details of /// the index ranges to be used.
flags int Additional controller flags, see .
Результат void

GetDarkCapBounds() публичный абстрактный Метод

Gets the world space bounding box of the dark cap, as extruded using the light provided.
public abstract GetDarkCapBounds ( Light light, float dirLightExtrusionDist ) : AxisAlignedBox
light Axiom.Core.Light
dirLightExtrusionDist float
Результат Axiom.Math.AxisAlignedBox

GetEdgeList() публичный Метод

Gets details of the edges which might be used to determine a silhouette.
Defaults to LOD index 0.
public GetEdgeList ( ) : EdgeData
Результат EdgeData

GetEdgeList() публичный абстрактный Метод

Gets details of the edges which might be used to determine a silhouette.
public abstract GetEdgeList ( int lodIndex ) : EdgeData
lodIndex int
Результат EdgeData

GetExtrusionDistance() защищенный Метод

Helper method for calculating extrusion distance.
protected GetExtrusionDistance ( Vector3 objectPos, Light light ) : float
objectPos Vector3
light Axiom.Core.Light
Результат float

GetLastShadowVolumeRenderableEnumerator() публичный абстрактный Метод

Return the last calculated shadow renderables.
public abstract GetLastShadowVolumeRenderableEnumerator ( ) : IEnumerator
Результат IEnumerator

GetLightCapBounds() публичный абстрактный Метод

Gets the world space bounding box of the light cap.
public abstract GetLightCapBounds ( ) : AxisAlignedBox
Результат Axiom.Math.AxisAlignedBox

GetPointExtrusionDistance() публичный абстрактный Метод

Get the distance to extrude for a point/spot light.
public abstract GetPointExtrusionDistance ( Light light ) : float
light Axiom.Core.Light
Результат float

GetShadowVolumeRenderableEnumerator() публичный абстрактный Метод

Gets an iterator over 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.
public abstract GetShadowVolumeRenderableEnumerator ( ShadowTechnique technique, Light light, HardwareIndexBuffer indexBuffer, bool extrudeVertices, float extrusionDistance, int flags ) : IEnumerator
technique ShadowTechnique The technique being used to generate the shadow.
light Axiom.Core.Light The light to generate the shadow from.
indexBuffer HardwareIndexBuffer The index buffer to build the renderables into, /// the current contents are assumed to be disposable.
extrudeVertices bool 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 float
flags int Technique-specific flags, see
Результат IEnumerator

GetShadowVolumeRenderableEnumerator() публичный Метод

public GetShadowVolumeRenderableEnumerator ( ShadowTechnique technique, Light light, HardwareIndexBuffer indexBuffer, float extrusionDistance, bool extrudeVertices ) : IEnumerator
technique ShadowTechnique
light Axiom.Core.Light
indexBuffer HardwareIndexBuffer
extrusionDistance float
extrudeVertices bool
Результат IEnumerator

GetWorldBoundingBox() публичный Метод

public GetWorldBoundingBox ( ) : AxisAlignedBox
Результат Axiom.Math.AxisAlignedBox

GetWorldBoundingBox() публичный абстрактный Метод

Get the world bounding box of the caster.
public abstract GetWorldBoundingBox ( bool derive ) : AxisAlignedBox
derive bool
Результат Axiom.Math.AxisAlignedBox

UpdateEdgeListLightFacing() защищенный Метод

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.
protected UpdateEdgeListLightFacing ( EdgeData edgeData, Vector4 lightPosition ) : void
edgeData EdgeData The edge information to update.
lightPosition Vector4 4D vector representing the light, a directional light has w=0.0.
Результат void