C# 클래스 Axiom.Graphics.ShadowCaster

This class defines the interface that must be implemented by shadow casters.
상속: DisposableObject
파일 보기 프로젝트 열기: mono-soc-2011/axiom

공개 메소드들

메소드 설명
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