Gorgon
Show / Hide Table of Contents

Class GorgonOrthoCamera

A camera that performs orthographic (2D) projection.

Inheritance
object
GorgonCameraCommon
GorgonOrthoCamera
Implements
IGorgonGraphicsObject
IGorgonNamedObject
Inherited Members
GorgonCameraCommon.PositionRef
GorgonCameraCommon.Target
GorgonCameraCommon.Changes
GorgonCameraCommon.Graphics
GorgonCameraCommon.AspectRatio
GorgonCameraCommon.ViewDimensions
GorgonCameraCommon.MinimumDepth
GorgonCameraCommon.MaximumDepth
GorgonCameraCommon.Position
GorgonCameraCommon.AllowUpdateOnResize
GorgonCameraCommon.TargetWidth
GorgonCameraCommon.TargetHeight
GorgonCameraCommon.Name
GorgonCameraCommon.GetTarget()
GorgonCameraCommon.GetViewMatrix()
GorgonCameraCommon.GetProjectionMatrix()
GorgonCameraCommon.Project(ref Vector3, out Vector3, bool)
GorgonCameraCommon.Project(ref Vector3, out Vector3, Size2, bool)
GorgonCameraCommon.Unproject(in Vector3, out Vector3, bool)
GorgonCameraCommon.Unproject(in Vector3, out Vector3, Size2, bool)
GorgonCameraCommon.Project(Vector3, Size2, bool)
GorgonCameraCommon.Project(Vector3, bool)
GorgonCameraCommon.Unproject(Vector3, bool)
GorgonCameraCommon.Unproject(Vector3, Size2, bool)
GorgonCameraCommon.DiscardChanges()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Renderers.Cameras
Assembly: Gorgon.Graphics.Core.dll
Syntax
public class GorgonOrthoCamera : GorgonCameraCommon, IGorgonGraphicsObject, IGorgonNamedObject
Remarks

This camera performs 2D projection of sprites and other renderables on to a target. By default, the camera will use absolute screen space coordinates e.g. 160x120 will be the center of a 320x240 render target. The user may define their own coordinate system to apply to the projection.

Constructors

| Edit this page View Source

GorgonOrthoCamera(GorgonGraphics, Size2F, float, float, string)

Initializes a new instance of the GorgonOrthoCamera class.

Declaration
public GorgonOrthoCamera(GorgonGraphics graphics, Size2F viewDimensions, float minDepth = 0, float maximumDepth = 1, string name = null)
Parameters
Type Name Description
GorgonGraphics graphics

The graphics interface to use with this object.

Size2F viewDimensions

The view dimensions.

float minDepth

[Optional] The minimum depth value.

float maximumDepth

[Optional] The maximum depth value.

string name

[Optional] The name of the camera.

Exceptions
Type Condition
ArgumentNullException

Thrown when the graphics parameter is null.

Properties

| Edit this page View Source

Anchor

Property to set or return an anchor for rotation, scaling and positioning.

Declaration
public Vector2 Anchor { get; set; }
Property Value
Type Description
Vector2
Remarks

This value is in relative coordinates. That is, 0,0 would be the upper left corner of the ViewDimensions, and 1,1 would be lower right corner of the ViewDimensions.

| Edit this page View Source

Angle

Property to set or return the rotation on the Z axis, in degrees.

Declaration
public float Angle { get; set; }
Property Value
Type Description
float
| Edit this page View Source

ViewableRegion

Property to return the viewable region for the camera.

Declaration
public override RectangleF ViewableRegion { get; }
Property Value
Type Description
RectangleF
Overrides
GorgonCameraCommon.ViewableRegion
Remarks

This represents the boundaries of viewable space for the camera using its coordinate system. The upper left of the region corresponds with the upper left of the active render target at minimum Z depth, and the lower right of the region corresponds with the lower right of the active render target at minimum Z depth.

| Edit this page View Source

Zoom

Property to set or return the zoom for the camera.

Declaration
public Vector2 Zoom { get; set; }
Property Value
Type Description
Vector2

Methods

| Edit this page View Source

UpdateProjectionMatrix(ref Matrix4x4)

Function to update the projection matrix.

Declaration
protected override void UpdateProjectionMatrix(ref Matrix4x4 projectionMatrix)
Parameters
Type Name Description
Matrix4x4 projectionMatrix

The instance of the matrix to update.

Overrides
GorgonCameraCommon.UpdateProjectionMatrix(ref Matrix4x4)
| Edit this page View Source

UpdateViewMatrix(ref Matrix4x4)

Function to update the view matrix.

Declaration
protected override void UpdateViewMatrix(ref Matrix4x4 viewMatrix)
Parameters
Type Name Description
Matrix4x4 viewMatrix

The instance of the matrix to update.

Overrides
GorgonCameraCommon.UpdateViewMatrix(ref Matrix4x4)

Implements

IGorgonGraphicsObject
IGorgonNamedObject

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author