C# Class 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.

Inheritance: Frustum
Datei anzeigen Open project: WolfgangSt/axiom Class Usage Examples

Protected Properties

Property Type Description
isYawFixed bool
recalculateWindow bool
useRenderingDistance bool
windowBottom float
windowLeft float
windowRight float
windowTop float
yawFixedAxis Vector3

Private Properties

Property Type Description
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

Public Methods

Method Description
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

Protected Methods

Method Description
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

Private Methods

Method Description
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

Method Details

GetCameraToViewportBoxVolume() public method

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
return Axiom.Math.PlaneBoundedVolume

GetCameraToViewportBoxVolume() public method

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
return void

GetOrientationForViewUpdate() protected method

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

GetPositionForViewUpdate() protected method

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

GetWindowPlane() public method

Gets the window plane at the specified index.
public GetWindowPlane ( int index ) : Plane
index int Index of the plane to get.
return Axiom.Math.Plane

InvalidateFrustum() protected method

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

InvalidateView() protected method

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

IsObjectVisible() public method

public IsObjectVisible ( AxisAlignedBox box ) : bool
box Axiom.Math.AxisAlignedBox
return bool

IsObjectVisible() public method

public IsObjectVisible ( AxisAlignedBox box, FrustumPlane &culledBy ) : bool
box Axiom.Math.AxisAlignedBox
culledBy FrustumPlane
return bool

IsObjectVisible() public method

public IsObjectVisible ( Sphere sphere ) : bool
sphere Axiom.Math.Sphere
return bool

IsObjectVisible() public method

public IsObjectVisible ( Sphere sphere, FrustumPlane &culledBy ) : bool
sphere Axiom.Math.Sphere
culledBy FrustumPlane
return bool

IsObjectVisible() public method

public IsObjectVisible ( Vector3 vertex ) : bool
vertex Vector3
return bool

IsObjectVisible() public method

public IsObjectVisible ( Vector3 vertex, FrustumPlane &culledBy ) : bool
vertex Vector3
culledBy FrustumPlane
return bool

LookAt() public method

Specifies a target that the camera should look at.
public LookAt ( Vector3 target ) : void
target Vector3
return void

NotifyCurrentCamera() public method

public NotifyCurrentCamera ( Axiom camera ) : void
camera Axiom
return void

SetWindowImpl() protected method

Do actual window setting, using parameters set in SetWindow call.
The method is called after projection matrix each change.
protected SetWindowImpl ( ) : void
return void

ToString() public method

public ToString ( ) : string
return string

UpdateRenderQueue() public method

public UpdateRenderQueue ( RenderQueue queue ) : void
queue Axiom.Graphics.RenderQueue
return void

dispose() protected method

protected dispose ( bool disposeManagedResources ) : void
disposeManagedResources bool
return void

Property Details

isYawFixed protected_oe property

Whether to yaw around a fixed axis.
protected bool isYawFixed
return bool

recalculateWindow protected_oe property

Was viewing window changed?
protected bool recalculateWindow
return bool

useRenderingDistance protected_oe property

Whether or not the rendering distance of objects should take effect for this camera
protected bool useRenderingDistance
return bool

windowBottom protected_oe property

Bottom window edge (window clip planes).
protected float windowBottom
return float

windowLeft protected_oe property

Left window edge (window clip planes).
protected float windowLeft
return float

windowRight protected_oe property

Right window edge (window clip planes).
protected float windowRight
return float

windowTop protected_oe property

Top window edge (window clip planes).
protected float windowTop
return float

yawFixedAxis protected_oe property

Fixed axis to yaw around.
protected Vector3 yawFixedAxis
return Vector3