C# Класс Axiom.Core.Camera

A viewpoint from which the scene will be rendered.
The engine renders scenes from a camera viewpoint into a buffer of some sort, normally a window or a texture (a subclass of RenderTarget). the engine cameras support both perspective projection (the default, meaning objects get smaller the further away they are) and orthographic projection (blueprint-style, no decrease in size with distance). Each camera carries with it a style of rendering, e.g. full textured, flat shaded, wireframe), field of view, rendering distances etc, allowing you to use the engine to create complex multi-window views if required. In addition, more than one camera can point at a single render target if required, each rendering to a subset of the target, allowing split screen and picture-in-picture views.

Cameras maintain their own aspect ratios, field of view, and frustrum, and project co-ordinates into a space measured from -1 to 1 in x and y, and 0 to 1 in z. At render time, the camera will be rendering to a Viewport which will translate these parametric co-ordinates into real screen co-ordinates. Obviously it is advisable that the viewport has the same aspect ratio as the camera to avoid distortion (unless you want it!).

Note that a Camera can be attached to a SceneNode, using the method SceneNode.AttachObject. If this is done the Camera will combine it's own position/orientation settings with it's parent SceneNode. This is useful for implementing more complex Camera / object relationships i.e. having a camera attached to a world object.

Наследование: Frustum
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
isYawFixed bool
recalculateWindow bool
useRenderingDistance bool
windowBottom float
windowLeft float
windowRight float
windowTop float
yawFixedAxis Vector3

Private Properties

Свойство Тип Описание
AutoTrack void
Camera System
ForwardIntersect void
GetCameraToViewportRay Axiom.Math.Ray
GetCameraToViewportRay void
GetRayForwardIntersect IEnumerable
Move void
MoveRelative void
NotifyRenderedBatches void
NotifyRenderedFaces void
NotifyViewport void
Pitch void
ProjectSphere bool
RenderScene void
ResetWindow void
Roll void
Rotate void
Rotate void
SetAutoTracking void
SetAutoTracking void
SetAutoTracking void
SetWindow void
Yaw void

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

Метод Описание
GetCameraToViewportBoxVolume ( Real screenLeft, Real screenTop, Real screenRight, Real screenBottom, bool includeFarPlane ) : PlaneBoundedVolume

Gets a world-space list of planes enclosing a volume based on a viewport rectangle.

Can be useful for populating a PlaneBoundedVolumeListSceneQuery, e.g. for a rubber-band selection.

GetCameraToViewportBoxVolume ( Real screenLeft, Real screenTop, Real screenRight, Real screenBottom, PlaneBoundedVolume outVolume, bool includeFarPlane ) : void

Gets a world-space list of planes enclosing a volume based on a viewport rectangle.

Can be useful for populating a PlaneBoundedVolumeListSceneQuery, e.g. for a rubber-band selection.

GetWindowPlane ( int index ) : Plane

Gets the window plane at the specified index.

IsObjectVisible ( AxisAlignedBox box ) : bool
IsObjectVisible ( AxisAlignedBox box, FrustumPlane &culledBy ) : bool
IsObjectVisible ( Sphere sphere ) : bool
IsObjectVisible ( Sphere sphere, FrustumPlane &culledBy ) : bool
IsObjectVisible ( Vector3 vertex ) : bool
IsObjectVisible ( Vector3 vertex, FrustumPlane &culledBy ) : bool
LookAt ( Vector3 target ) : void

Specifies a target that the camera should look at.

NotifyCurrentCamera ( Axiom camera ) : void
ToString ( ) : string
UpdateRenderQueue ( RenderQueue queue ) : 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.

SetWindowImpl ( ) : void

Do actual window setting, using parameters set in SetWindow call.

The method is called after projection matrix each change.

dispose ( bool disposeManagedResources ) : void

Приватные методы

Метод Описание
AutoTrack ( ) : void
Camera ( string name, SceneManager sceneManager ) : System
ForwardIntersect ( Plane worldPlane, IList intersect3D ) : void
GetCameraToViewportRay ( float screenX, float screenY ) : Ray
GetCameraToViewportRay ( float screenX, float screenY, Ray &ray ) : void
GetRayForwardIntersect ( Vector3 anchor, IEnumerable dir, Real planeOffset ) : IEnumerable
Move ( Vector3 offset ) : void
MoveRelative ( Vector3 offset ) : void
NotifyRenderedBatches ( int renderedBatchCount ) : void
NotifyRenderedFaces ( int renderedFaceCount ) : void
NotifyViewport ( Axiom.Core.Viewport viewport ) : void
Pitch ( float degrees ) : void
ProjectSphere ( Sphere sphere, float &left, float &top, float &right, float &bottom ) : bool
RenderScene ( Axiom.Core.Viewport viewport, bool showOverlays ) : void

Called to ask a camera to render the scene into the given viewport.

ResetWindow ( ) : void
Roll ( float degrees ) : void
Rotate ( Quaternion qnorm ) : void
Rotate ( Vector3 axis, float degrees ) : void
SetAutoTracking ( bool enabled, Axiom.Core.MovableObject target ) : void
SetAutoTracking ( bool enabled, SceneNode target ) : void
SetAutoTracking ( bool enabled, SceneNode target, Vector3 offset ) : void
SetWindow ( float left, float top, float right, float bottom ) : void
Yaw ( float degrees ) : void

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

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

Gets a world-space list of planes enclosing a volume based on a viewport rectangle.
Can be useful for populating a PlaneBoundedVolumeListSceneQuery, e.g. for a rubber-band selection.
public GetCameraToViewportBoxVolume ( Real screenLeft, Real screenTop, Real screenRight, Real screenBottom, bool includeFarPlane ) : PlaneBoundedVolume
screenLeft Real the left bound of the on-screen rectangle, expressed in normalized screen coordinates [0,1]
screenTop Real the upper bound of the on-screen rectangle, expressed in normalized screen coordinates [0,1]
screenRight Real the right bound of the on-screen rectangle, expressed in normalized screen coordinates [0,1]
screenBottom Real the lower bound of the on-screen rectangle, expressed in normalized screen coordinates [0,1]
includeFarPlane bool whether to include the far frustum plane
Результат Axiom.Math.PlaneBoundedVolume

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

Gets a world-space list of planes enclosing a volume based on a viewport rectangle.
Can be useful for populating a PlaneBoundedVolumeListSceneQuery, e.g. for a rubber-band selection.
public GetCameraToViewportBoxVolume ( Real screenLeft, Real screenTop, Real screenRight, Real screenBottom, PlaneBoundedVolume outVolume, bool includeFarPlane ) : void
screenLeft Real the left bound of the on-screen rectangle, expressed in normalized screen coordinates [0,1]
screenTop Real the upper bound of the on-screen rectangle, expressed in normalized screen coordinates [0,1]
screenRight Real the right bound of the on-screen rectangle, expressed in normalized screen coordinates [0,1]
screenBottom Real the lower bound of the on-screen rectangle, expressed in normalized screen coordinates [0,1]
outVolume Axiom.Math.PlaneBoundedVolume The plane list to populate with the result
includeFarPlane bool whether to include the far frustum plane
Результат 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

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

Gets the window plane at the specified index.
public GetWindowPlane ( int index ) : Plane
index int Index of the plane to get.
Результат Axiom.Math.Plane

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

Signal to update frustum information.
protected InvalidateFrustum ( ) : void
Результат void

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

Signal to update view information.
protected InvalidateView ( ) : void
Результат void

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

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

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

public IsObjectVisible ( AxisAlignedBox box, FrustumPlane &culledBy ) : bool
box Axiom.Math.AxisAlignedBox
culledBy FrustumPlane
Результат bool

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

public IsObjectVisible ( Sphere sphere ) : bool
sphere Axiom.Math.Sphere
Результат bool

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

public IsObjectVisible ( Sphere sphere, FrustumPlane &culledBy ) : bool
sphere Axiom.Math.Sphere
culledBy FrustumPlane
Результат bool

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

public IsObjectVisible ( Vector3 vertex ) : bool
vertex Vector3
Результат bool

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

public IsObjectVisible ( Vector3 vertex, FrustumPlane &culledBy ) : bool
vertex Vector3
culledBy FrustumPlane
Результат bool

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

Specifies a target that the camera should look at.
public LookAt ( Vector3 target ) : void
target Vector3
Результат void

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

public NotifyCurrentCamera ( Axiom camera ) : void
camera Axiom
Результат void

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

Do actual window setting, using parameters set in SetWindow call.
The method is called after projection matrix each change.
protected SetWindowImpl ( ) : void
Результат void

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

public ToString ( ) : string
Результат string

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

public UpdateRenderQueue ( RenderQueue queue ) : void
queue Axiom.Graphics.RenderQueue
Результат void

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

protected dispose ( bool disposeManagedResources ) : void
disposeManagedResources bool
Результат void

Описание свойств

isYawFixed защищенное свойство

Whether to yaw around a fixed axis.
protected bool isYawFixed
Результат bool

recalculateWindow защищенное свойство

Was viewing window changed?
protected bool recalculateWindow
Результат bool

useRenderingDistance защищенное свойство

Whether or not the rendering distance of objects should take effect for this camera
protected bool useRenderingDistance
Результат bool

windowBottom защищенное свойство

Bottom window edge (window clip planes).
protected float windowBottom
Результат float

windowLeft защищенное свойство

Left window edge (window clip planes).
protected float windowLeft
Результат float

windowRight защищенное свойство

Right window edge (window clip planes).
protected float windowRight
Результат float

windowTop защищенное свойство

Top window edge (window clip planes).
protected float windowTop
Результат float

yawFixedAxis защищенное свойство

Fixed axis to yaw around.
protected Vector3 yawFixedAxis
Результат Vector3