Class GorgonOrthoCamera
A camera that performs orthographic (2D) projection.
Inherited Members
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 SourceGorgonOrthoCamera(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 |
Properties
| Edit this page View SourceAnchor
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.
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 |
ViewableRegion
Property to return the viewable region for the camera.
Declaration
public override RectangleF ViewableRegion { get; }
Property Value
Type | Description |
---|---|
RectangleF |
Overrides
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.
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 SourceUpdateProjectionMatrix(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
| Edit this page View SourceUpdateViewMatrix(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. |