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
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_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