C# 클래스 Axiom.Core.Frustum

A frustum represents a pyramid, capped at the near and far end which is used to represent either a visible area or a projection area. Can be used for a number of applications.
상속: Axiom.Core.MovableObject, IRenderable
파일 보기 프로젝트 열기: WolfgangSt/axiom 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_boundingBox Axiom.Math.AxisAlignedBox
_coeffB float[]
_coeffL float[]
_coeffR float[]
_coeffT float[]
_farDistance float
_focalLength float
_frustumExtentsManuallySet bool
_frustumOffset Vector2
_lastParentOrientation Axiom.Math.Quaternion
_lastParentPosition Vector3
_left float
_material Axiom.Graphics.Material
_orthoHeight float
_planes Axiom.Math.Plane[]
_projectionMatrix Axiom.Math.Matrix4
_projectionMatrixRS Axiom.Math.Matrix4
_projectionMatrixRSDepth Axiom.Math.Matrix4
_recalculateFrustum bool
_recalculateFrustumPlanes bool
_recalculateVertexData bool
_recalculateView bool
_recalculateWorldSpaceCorners bool
_vertexData Axiom.Graphics.VertexData
_viewMatrix Axiom.Math.Matrix4
_worldSpaceCorners Vector3[]
customParams List
dummyLightList LightList
isReflected bool
lastLinkedObliqueProjPlane Axiom.Math.Plane
lastLinkedReflectionPlane Axiom.Math.Plane
linkedObliqueProjPlane IDerivedPlaneProvider
linkedReflectionPlane IDerivedPlaneProvider
obliqueProjPlane Axiom.Math.Plane
renderOperation Axiom.Graphics.RenderOperation
useObliqueDepthProjection bool

Private Properties

프로퍼티 타입 설명
Initialize void

공개 메소드들

메소드 설명
CalcViewMatrixRelative ( Vector3 texProjRelativeOrigin, Matrix4 &tmp ) : void
DisableCustomNearClipPlane ( ) : void

Disables any custom near clip plane.

DisableReflection ( ) : void

Disables reflection modification previously turned on with EnableReflection(Plane).

EnableCustomNearClipPlane ( IDerivedPlaneProvider plane ) : void

Links the frustum to a custom near clip plane, which can be used to clip geometry in a custom manner without using user clip planes.

There are several applications for clipping a scene arbitrarily by a single plane; the most common is when rendering a reflection to a texture, and you only want to render geometry that is above the water plane (to do otherwise results in artefacts). Whilst it is possible to use user clip planes, they are not supported on all cards, and sometimes are not hardware accelerated when they are available. Instead, where a single clip plane is involved, this technique uses a 'fudging' of the near clip plane, which is available and fast on all hardware, to perform as the arbitrary clip plane. This does change the shape of the frustum, leading to some depth buffer loss of precision, but for many of the uses of this technique that is not an issue.

This version of the method links to a plane, rather than requiring a by-value plane definition, and therefore you can make changes to the plane (e.g. by moving / rotating the node it is attached to) and they will automatically affect this object.

This technique only works for perspective projection.

EnableCustomNearClipPlane ( Plane plane ) : void

Links the frustum to a custom near clip plane, which can be used to clip geometry in a custom manner without using user clip planes.

There are several applications for clipping a scene arbitrarily by a single plane; the most common is when rendering a reflection to a texture, and you only want to render geometry that is above the water plane (to do otherwise results in artefacts). Whilst it is possible to use user clip planes, they are not supported on all cards, and sometimes are not hardware accelerated when they are available. Instead, where a single clip plane is involved, this technique uses a 'fudging' of the near clip plane, which is available and fast on all hardware, to perform as the arbitrary clip plane. This does change the shape of the frustum, leading to some depth buffer loss of precision, but for many of the uses of this technique that is not an issue.

This version of the method links to a plane, rather than requiring a by-value plane definition, and therefore you can make changes to the plane (e.g. by moving / rotating the node it is attached to) and they will automatically affect this object.

This technique only works for perspective projection.

EnableReflection ( IDerivedPlaneProvider plane ) : void

Modifies this frustum so it always renders from the reflection of itself through the plane specified. Note that this version of the method links to a plane so that changes to it are picked up automatically.

This is obviously useful for performing planar reflections.

EnableReflection ( Plane plane ) : void

Modifies this camera so it always renders from the reflection of itself through the plane specified.

This is obviously useful for rendering planar reflections.

Frustum ( ) : System

Default constructor.

Frustum ( string name ) : System
GetCustomParameter ( int index ) : Vector4
GetFrustumExtents ( float &left, float &right, float &top, float &bottom ) : void
GetSquaredViewDepth ( Camera camera ) : float
GetWorldTransforms ( Matrix4 matrices ) : void
IsObjectVisible ( AxisAlignedBox box ) : bool

Overloaded method.

IsObjectVisible ( AxisAlignedBox box, FrustumPlane &culledBy ) : bool

Tests whether the given box is visible in the Frustum.

IsObjectVisible ( Sphere sphere ) : bool

Overloaded method.

IsObjectVisible ( Sphere sphere, FrustumPlane &culledBy ) : bool

Tests whether the given sphere is in the viewing frustum.

IsObjectVisible ( Vector3 vertex ) : bool

Overloaded method.

IsObjectVisible ( Vector3 vertex, FrustumPlane &culledBy ) : bool

Tests whether the given 3D point is in the viewing frustum.

NotifyCurrentCamera ( Camera camera ) : void

ProjectSphere ( Sphere sphere, float &left, float &top, float &right, float &bottom ) : bool
ResetFrustumExtents ( ) : void
SetCustomParameter ( int index, Vector4 val ) : void
SetCustomProjectionMatrix ( bool enable ) : void
SetCustomProjectionMatrix ( bool enable, Matrix4 projMatrix ) : void
SetCustomViewMatrix ( bool enable ) : void
SetCustomViewMatrix ( bool enable, Matrix4 viewMatrix ) : void
SetFrustumExtents ( float left, float right, float top, float bottom ) : void
SetOrthoWindow ( float w, float h ) : void

Set view area size for orthographic mode.

Note that this method adjusts the frustum's aspect ratio.

UpdateCustomGpuParameter ( GpuProgramParameters entry, GpuProgramParameters gpuParams ) : void
UpdateRenderQueue ( RenderQueue queue ) : void

Implemented to add outself to the rendering queue.

this ( FrustumPlane plane ) : Plane

An indexer that accepts a FrustumPlane enum value and return the appropriate plane side of the Frustum.

보호된 메소드들

메소드 설명
CalculateProjectionParameters ( Real &vpLeft, Real &vpRight, Real &vpBottom, Real &vpTop ) : void
GetOrientationForViewUpdate ( ) : Quaternion

Get the derived orientation of this frustum.

GetPositionForViewUpdate ( ) : Vector3

Get the derived position of this frustum.

InvalidateFrustum ( ) : void

Signal to update frustum information.

InvalidateView ( ) : void

Signal to update view information.

UpdateFrustum ( ) : void

Updates the frustum data.

UpdateFrustumPlanes ( ) : void
UpdateVertexData ( ) : void
UpdateView ( ) : void

Updates the view matrix.

UpdateWorldSpaceCorners ( ) : void
_updateFrustum ( ) : void
_updateFrustumPlanes ( ) : void
_updateView ( ) : void
_updateWorldSpaceCorners ( ) : void
dispose ( bool disposeManagedResources ) : void

Class level dispose method

When implementing this method in an inherited class the following template should be used; protected override void dispose( bool disposeManagedResources ) { if ( !isDisposed ) { if ( disposeManagedResources ) { // Dispose managed resources. } // There are no unmanaged resources to release, but // if we add them, they need to be released here. } // If it is available, make the call to the // base class's Dispose(Boolean) method base.dispose( disposeManagedResources ); }

비공개 메소드들

메소드 설명
Initialize ( ) : void

메소드 상세

CalcViewMatrixRelative() 공개 메소드

public CalcViewMatrixRelative ( Vector3 texProjRelativeOrigin, Matrix4 &tmp ) : void
texProjRelativeOrigin Vector3
tmp Axiom.Math.Matrix4
리턴 void

CalculateProjectionParameters() 보호된 메소드

protected CalculateProjectionParameters ( Real &vpLeft, Real &vpRight, Real &vpBottom, Real &vpTop ) : void
vpLeft Real
vpRight Real
vpBottom Real
vpTop Real
리턴 void

DisableCustomNearClipPlane() 공개 메소드

Disables any custom near clip plane.
public DisableCustomNearClipPlane ( ) : void
리턴 void

DisableReflection() 공개 메소드

Disables reflection modification previously turned on with EnableReflection(Plane).
public DisableReflection ( ) : void
리턴 void

EnableCustomNearClipPlane() 공개 메소드

Links the frustum to a custom near clip plane, which can be used to clip geometry in a custom manner without using user clip planes.

There are several applications for clipping a scene arbitrarily by a single plane; the most common is when rendering a reflection to a texture, and you only want to render geometry that is above the water plane (to do otherwise results in artefacts). Whilst it is possible to use user clip planes, they are not supported on all cards, and sometimes are not hardware accelerated when they are available. Instead, where a single clip plane is involved, this technique uses a 'fudging' of the near clip plane, which is available and fast on all hardware, to perform as the arbitrary clip plane. This does change the shape of the frustum, leading to some depth buffer loss of precision, but for many of the uses of this technique that is not an issue.

This version of the method links to a plane, rather than requiring a by-value plane definition, and therefore you can make changes to the plane (e.g. by moving / rotating the node it is attached to) and they will automatically affect this object.

This technique only works for perspective projection.

public EnableCustomNearClipPlane ( IDerivedPlaneProvider plane ) : void
plane IDerivedPlaneProvider The plane to link to to perform the clipping.
리턴 void

EnableCustomNearClipPlane() 공개 메소드

Links the frustum to a custom near clip plane, which can be used to clip geometry in a custom manner without using user clip planes.

There are several applications for clipping a scene arbitrarily by a single plane; the most common is when rendering a reflection to a texture, and you only want to render geometry that is above the water plane (to do otherwise results in artefacts). Whilst it is possible to use user clip planes, they are not supported on all cards, and sometimes are not hardware accelerated when they are available. Instead, where a single clip plane is involved, this technique uses a 'fudging' of the near clip plane, which is available and fast on all hardware, to perform as the arbitrary clip plane. This does change the shape of the frustum, leading to some depth buffer loss of precision, but for many of the uses of this technique that is not an issue.

This version of the method links to a plane, rather than requiring a by-value plane definition, and therefore you can make changes to the plane (e.g. by moving / rotating the node it is attached to) and they will automatically affect this object.

This technique only works for perspective projection.

public EnableCustomNearClipPlane ( Plane plane ) : void
plane Axiom.Math.Plane The plane to link to to perform the clipping.
리턴 void

EnableReflection() 공개 메소드

Modifies this frustum so it always renders from the reflection of itself through the plane specified. Note that this version of the method links to a plane so that changes to it are picked up automatically.
This is obviously useful for performing planar reflections.
public EnableReflection ( IDerivedPlaneProvider plane ) : void
plane IDerivedPlaneProvider
리턴 void

EnableReflection() 공개 메소드

Modifies this camera so it always renders from the reflection of itself through the plane specified.
This is obviously useful for rendering planar reflections.
public EnableReflection ( Plane plane ) : void
plane Axiom.Math.Plane
리턴 void

Frustum() 공개 메소드

Default constructor.
public Frustum ( ) : System
리턴 System

Frustum() 공개 메소드

public Frustum ( string name ) : System
name string
리턴 System

GetCustomParameter() 공개 메소드

public GetCustomParameter ( int index ) : Vector4
index int
리턴 Vector4

GetFrustumExtents() 공개 메소드

public GetFrustumExtents ( float &left, float &right, float &top, float &bottom ) : void
left float
right float
top float
bottom float
리턴 void

GetOrientationForViewUpdate() 보호된 메소드

Get the derived orientation of this frustum.
protected GetOrientationForViewUpdate ( ) : Quaternion
리턴 Axiom.Math.Quaternion

GetPositionForViewUpdate() 보호된 메소드

Get the derived position of this frustum.
protected GetPositionForViewUpdate ( ) : Vector3
리턴 Vector3

GetSquaredViewDepth() 공개 메소드

public GetSquaredViewDepth ( Camera camera ) : float
camera Camera
리턴 float

GetWorldTransforms() 공개 메소드

public GetWorldTransforms ( Matrix4 matrices ) : void
matrices Axiom.Math.Matrix4
리턴 void

InvalidateFrustum() 보호된 메소드

Signal to update frustum information.
protected InvalidateFrustum ( ) : void
리턴 void

InvalidateView() 보호된 메소드

Signal to update view information.
protected InvalidateView ( ) : void
리턴 void

IsObjectVisible() 공개 메소드

Overloaded method.
public IsObjectVisible ( AxisAlignedBox box ) : bool
box Axiom.Math.AxisAlignedBox
리턴 bool

IsObjectVisible() 공개 메소드

Tests whether the given box is visible in the Frustum.
public IsObjectVisible ( AxisAlignedBox box, FrustumPlane &culledBy ) : bool
box Axiom.Math.AxisAlignedBox Bounding box to be checked.
culledBy FrustumPlane /// Optional FrustrumPlane params which will be filled by the plane which culled /// the box if the result was false. ///
리턴 bool

IsObjectVisible() 공개 메소드

Overloaded method.
public IsObjectVisible ( Sphere sphere ) : bool
sphere Axiom.Math.Sphere
리턴 bool

IsObjectVisible() 공개 메소드

Tests whether the given sphere is in the viewing frustum.
public IsObjectVisible ( Sphere sphere, FrustumPlane &culledBy ) : bool
sphere Axiom.Math.Sphere Bounding sphere to be checked.
culledBy FrustumPlane /// Optional FrustrumPlane params which will be filled by the plane which culled /// the box if the result was false. ///
리턴 bool

IsObjectVisible() 공개 메소드

Overloaded method.
public IsObjectVisible ( Vector3 vertex ) : bool
vertex Vector3
리턴 bool

IsObjectVisible() 공개 메소드

Tests whether the given 3D point is in the viewing frustum.
public IsObjectVisible ( Vector3 vertex, FrustumPlane &culledBy ) : bool
vertex Vector3 3D point to check for frustum visibility.
culledBy FrustumPlane /// Optional FrustrumPlane params which will be filled by the plane which culled /// the box if the result was false. ///
리턴 bool

NotifyCurrentCamera() 공개 메소드

public NotifyCurrentCamera ( Camera camera ) : void
camera Camera
리턴 void

ProjectSphere() 공개 메소드

public ProjectSphere ( Sphere sphere, float &left, float &top, float &right, float &bottom ) : bool
sphere Axiom.Math.Sphere
left float
top float
right float
bottom float
리턴 bool

ResetFrustumExtents() 공개 메소드

public ResetFrustumExtents ( ) : void
리턴 void

SetCustomParameter() 공개 메소드

public SetCustomParameter ( int index, Vector4 val ) : void
index int
val Vector4
리턴 void

SetCustomProjectionMatrix() 공개 메소드

public SetCustomProjectionMatrix ( bool enable ) : void
enable bool
리턴 void

SetCustomProjectionMatrix() 공개 메소드

public SetCustomProjectionMatrix ( bool enable, Matrix4 projMatrix ) : void
enable bool
projMatrix Axiom.Math.Matrix4
리턴 void

SetCustomViewMatrix() 공개 메소드

public SetCustomViewMatrix ( bool enable ) : void
enable bool
리턴 void

SetCustomViewMatrix() 공개 메소드

public SetCustomViewMatrix ( bool enable, Matrix4 viewMatrix ) : void
enable bool
viewMatrix Axiom.Math.Matrix4
리턴 void

SetFrustumExtents() 공개 메소드

public SetFrustumExtents ( float left, float right, float top, float bottom ) : void
left float
right float
top float
bottom float
리턴 void

SetOrthoWindow() 공개 메소드

Set view area size for orthographic mode.
Note that this method adjusts the frustum's aspect ratio.
public SetOrthoWindow ( float w, float h ) : void
w float Width of the area to be visible
h float Height of the area to be visible
리턴 void

UpdateCustomGpuParameter() 공개 메소드

public UpdateCustomGpuParameter ( GpuProgramParameters entry, GpuProgramParameters gpuParams ) : void
entry Axiom.Graphics.GpuProgramParameters
gpuParams Axiom.Graphics.GpuProgramParameters
리턴 void

UpdateFrustum() 보호된 메소드

Updates the frustum data.
protected UpdateFrustum ( ) : void
리턴 void

UpdateFrustumPlanes() 보호된 메소드

protected UpdateFrustumPlanes ( ) : void
리턴 void

UpdateRenderQueue() 공개 메소드

Implemented to add outself to the rendering queue.
public UpdateRenderQueue ( RenderQueue queue ) : void
queue Axiom.Graphics.RenderQueue
리턴 void

UpdateVertexData() 보호된 메소드

protected UpdateVertexData ( ) : void
리턴 void

UpdateView() 보호된 메소드

Updates the view matrix.
protected UpdateView ( ) : void
리턴 void

UpdateWorldSpaceCorners() 보호된 메소드

protected UpdateWorldSpaceCorners ( ) : void
리턴 void

_updateFrustum() 보호된 메소드

protected _updateFrustum ( ) : void
리턴 void

_updateFrustumPlanes() 보호된 메소드

protected _updateFrustumPlanes ( ) : void
리턴 void

_updateView() 보호된 메소드

protected _updateView ( ) : void
리턴 void

_updateWorldSpaceCorners() 보호된 메소드

protected _updateWorldSpaceCorners ( ) : void
리턴 void

dispose() 보호된 메소드

Class level dispose method
When implementing this method in an inherited class the following template should be used; protected override void dispose( bool disposeManagedResources ) { if ( !isDisposed ) { if ( disposeManagedResources ) { // Dispose managed resources. } // There are no unmanaged resources to release, but // if we add them, they need to be released here. } // If it is available, make the call to the // base class's Dispose(Boolean) method base.dispose( disposeManagedResources ); }
protected dispose ( bool disposeManagedResources ) : void
disposeManagedResources bool True if Unmanaged resources should be released.
리턴 void

this() 공개 메소드

An indexer that accepts a FrustumPlane enum value and return the appropriate plane side of the Frustum.
public this ( FrustumPlane plane ) : Plane
plane FrustumPlane
리턴 Axiom.Math.Plane

프로퍼티 상세

_boundingBox 보호되어 있는 프로퍼티

Bounding box of this frustum.
protected AxisAlignedBox,Axiom.Math _boundingBox
리턴 Axiom.Math.AxisAlignedBox

_coeffB 보호되어 있는 프로퍼티

protected float[] _coeffB
리턴 float[]

_coeffL 보호되어 있는 프로퍼티

protected float[] _coeffL
리턴 float[]

_coeffR 보호되어 있는 프로퍼티

protected float[] _coeffR
리턴 float[]

_coeffT 보호되어 있는 프로퍼티

protected float[] _coeffT
리턴 float[]

_farDistance 보호되어 있는 프로퍼티

Far clip distance - default 10000.
protected float _farDistance
리턴 float

_focalLength 보호되어 있는 프로퍼티

Focal length of frustum (for stereo rendering, defaults to 1.0)
protected float _focalLength
리턴 float

_frustumExtentsManuallySet 보호되어 있는 프로퍼티

protected bool _frustumExtentsManuallySet
리턴 bool

_frustumOffset 보호되어 있는 프로퍼티

Off-axis frustum center offset - default (0.0, 0.0)
protected Vector2 _frustumOffset
리턴 Vector2

_lastParentOrientation 보호되어 있는 프로퍼티

Stored versions of parent orientation.
protected Quaternion,Axiom.Math _lastParentOrientation
리턴 Axiom.Math.Quaternion

_lastParentPosition 보호되어 있는 프로퍼티

Stored versions of parent position.
protected Vector3 _lastParentPosition
리턴 Vector3

_left 보호되어 있는 프로퍼티

protected float _left
리턴 float

_material 보호되어 있는 프로퍼티

Material to use when rendering this frustum.
protected Material,Axiom.Graphics _material
리턴 Axiom.Graphics.Material

_orthoHeight 보호되어 있는 프로퍼티

protected float _orthoHeight
리턴 float

_planes 보호되어 있는 프로퍼티

The 6 main clipping planes.
protected Plane[],Axiom.Math _planes
리턴 Axiom.Math.Plane[]

_projectionMatrix 보호되어 있는 프로퍼티

The normal projection matrix for this frustum, ie the projection matrix which conforms to standard right-handed rules and uses depth range [-1,+1].
This differs from the rendering-API dependent getProjectionMatrixRS in that it always returns a right-handed projection matrix with depth range [-1,+1], result no matter what rendering API is being used - this is required for some uniform algebra for example.
protected Matrix4,Axiom.Math _projectionMatrix
리턴 Axiom.Math.Matrix4

_projectionMatrixRS 보호되어 있는 프로퍼티

Gets the projection matrix for this frustum adjusted for the current rendersystem specifics (may be right or left-handed, depth range may vary).
This method retrieves the rendering-API dependent version of the projection matrix. If you want a 'typical' projection matrix then use _projectionMatrix.
protected Matrix4,Axiom.Math _projectionMatrixRS
리턴 Axiom.Math.Matrix4

_projectionMatrixRSDepth 보호되어 있는 프로퍼티

The depth-adjusted projection matrix for the current rendersystem, but one which still conforms to right-hand rules.
This differs from the rendering-API dependent getProjectionMatrix in that it always returns a right-handed projection matrix result no matter what rendering API is being used - this is required for vertex and fragment programs for example. However, the resulting depth range may still vary between render systems since D3D uses [0,1] and GL uses [-1,1], and the range must be kept the same between programmable and fixed-function pipelines.
protected Matrix4,Axiom.Math _projectionMatrixRSDepth
리턴 Axiom.Math.Matrix4

_recalculateFrustum 보호되어 있는 프로퍼티

Something's changed in the frustum shape?
protected bool _recalculateFrustum
리턴 bool

_recalculateFrustumPlanes 보호되어 있는 프로퍼티

protected bool _recalculateFrustumPlanes
리턴 bool

_recalculateVertexData 보호되어 있는 프로퍼티

protected bool _recalculateVertexData
리턴 bool

_recalculateView 보호되어 있는 프로퍼티

Something in the view pos has changed?
protected bool _recalculateView
리턴 bool

_recalculateWorldSpaceCorners 보호되어 있는 프로퍼티

Signal to recalculate World Space Corners
protected bool _recalculateWorldSpaceCorners
리턴 bool

_vertexData 보호되어 있는 프로퍼티

Vertex info for rendering this frustum.
protected VertexData,Axiom.Graphics _vertexData
리턴 Axiom.Graphics.VertexData

_viewMatrix 보호되어 있는 프로퍼티

Pre-calced view matrix.
protected Matrix4,Axiom.Math _viewMatrix
리턴 Axiom.Math.Matrix4

_worldSpaceCorners 보호되어 있는 프로퍼티

Frustum corners in world space.
protected Vector3[] _worldSpaceCorners
리턴 Vector3[]

customParams 보호되어 있는 프로퍼티

protected List customParams
리턴 List

dummyLightList 보호되어 있는 프로퍼티

Dummy list for IRenderable.Lights since we wont be lit.
protected LightList dummyLightList
리턴 LightList

isReflected 보호되어 있는 프로퍼티

Is this frustum to act as a reflection of itself?
protected bool isReflected
리턴 bool

lastLinkedObliqueProjPlane 보호되어 있는 프로퍼티

Record of the last world-space oblique depth projection plane info used.
protected Plane,Axiom.Math lastLinkedObliqueProjPlane
리턴 Axiom.Math.Plane

lastLinkedReflectionPlane 보호되어 있는 프로퍼티

Record of the last world-space reflection plane info used.
protected Plane,Axiom.Math lastLinkedReflectionPlane
리턴 Axiom.Math.Plane

linkedObliqueProjPlane 보호되어 있는 프로퍼티

Reference to oblique projection plane (automatically updated).
protected IDerivedPlaneProvider linkedObliqueProjPlane
리턴 IDerivedPlaneProvider

linkedReflectionPlane 보호되어 있는 프로퍼티

Reference of a reflection plane (automatically updated).
protected IDerivedPlaneProvider linkedReflectionPlane
리턴 IDerivedPlaneProvider

obliqueProjPlane 보호되어 있는 프로퍼티

Fixed oblique projection plane.
protected Plane,Axiom.Math obliqueProjPlane
리턴 Axiom.Math.Plane

renderOperation 보호되어 있는 프로퍼티

protected RenderOperation,Axiom.Graphics renderOperation
리턴 Axiom.Graphics.RenderOperation

useObliqueDepthProjection 보호되어 있는 프로퍼티

Is this frustum using an oblique depth projection?
protected bool useObliqueDepthProjection
리턴 bool