Class Camera2D
This class represent a camera in a 3D world. Cameras are the devices that capture and display the world to the player.
Inheritance
Implements
Inherited Members
Namespace: Evergine.Framework.Graphics
Assembly: Evergine.Framework.dll
Syntax
public class Camera2D : Camera, IDependencyObject
Constructors
Camera2D()
Initializes a new instance of the Camera2D class.
Declaration
public Camera2D()
Fields
IgnoreVirtualScreenRefresh
If true, it ignores the virtual screen refresh events.
Declaration
public bool IgnoreVirtualScreenRefresh
Field Value
Type | Description |
---|---|
bool |
upVector
Up vector.
Declaration
protected Vector3 upVector
Field Value
Type | Description |
---|---|
Vector3 |
Properties
DrawablesToRender
Gets the drawable type that this camera should render.
Declaration
public override DrawableType DrawablesToRender { get; }
Property Value
Type | Description |
---|---|
DrawableType |
Overrides
HasPerspective
Gets a value indicating whether this camera is using perspective projection. This indicate that the FieldOfView is lower than 1º.
Declaration
public bool HasPerspective { get; }
Property Value
Type | Description |
---|---|
bool |
Transform
Gets the camera transform.
Declaration
public Transform2D Transform { get; }
Property Value
Type | Description |
---|---|
Transform2D |
UpVector
Gets or sets the vector.
Declaration
public Vector3 UpVector { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
VanishingPoint
Gets or sets the vanishing point of the Camera 2D. It indicates the point of the screen where the perspective is focused. Its values are included in [0, 1] where (0, 0) indicates the top left corner. Such values are percentages where 1 means the 100% of the rectangle's width/height.
Declaration
public Vector2 VanishingPoint { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
Remarks
The default value is [0.5f, 0.5f].
Methods
OnAttached()
Attach the camera to the system.
Declaration
protected override bool OnAttached()
Returns
Type | Description |
---|---|
bool | True if all is OK. |
Overrides
OnDetach()
Detach the camera to the system.
Declaration
protected override void OnDetach()
Overrides
RefreshDimensions()
Refresh the with and height of the camera.
Declaration
protected override void RefreshDimensions()
Overrides
RefreshProjection()
Calculate the projection matrix.
Declaration
protected override void RefreshProjection()
Overrides
RefreshView()
Refresh the view matrix.
Declaration
protected override void RefreshView()
Overrides
Unproject(ref Vector2, out Vector2)
Unprojects the specified source.
Declaration
public void Unproject(ref Vector2 source, out Vector2 result)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | source | The source. |
Vector2 | result | Unprojected position. |