Table of Contents

Class OrthographicCamera

Namespace
LibGFX.Graphics
Assembly
LibGFX.dll

Represents an orthographic camera.

public class OrthographicCamera : Camera
Inheritance
OrthographicCamera
Inherited Members

Constructors

OrthographicCamera(Vector2, Vector2)

Creates a new instance of the OrthographicCamera class with the specified position and resolution.

public OrthographicCamera(Vector2 position, Vector2 resolution)

Parameters

position Vector2
resolution Vector2

Methods

CalculateScreenCorrection(float, float)

Calculates the screen correction factor based on the screen width and height.

public float CalculateScreenCorrection(float screenWidth, float screenHeight)

Parameters

screenWidth float
screenHeight float

Returns

float

ComputeAABB()

Computes the axis-aligned bounding box (AABB) of the camera based on its position and orientation

public override void ComputeAABB()

GetProjectionMatrix(Viewport)

Gets the projection matrix of the camera based on the viewport dimensions.

public override Matrix4 GetProjectionMatrix(Viewport viewport)

Parameters

viewport Viewport

Returns

Matrix4

GetViewMatrix()

Gets the view matrix of the camera.

public override Matrix4 GetViewMatrix()

Returns

Matrix4

IsAABBInFrustum(Viewport, Vector3, Vector3)

Checks if an axis-aligned bounding box (AABB) is within the frustum of the camera. Not implemented yet. ToDo: Implement proper frustum culling for orthographic camera.

public override bool IsAABBInFrustum(Viewport viewport, Vector3 min, Vector3 max)

Parameters

viewport Viewport
min Vector3
max Vector3

Returns

bool

IsPointInFrustum(Viewport, Vector3)

Checks if a point is within the frustum of the camera. Not implemented yet. ToDo: Implement proper frustum culling for orthographic camera.

public override bool IsPointInFrustum(Viewport viewport, Vector3 point)

Parameters

viewport Viewport
point Vector3

Returns

bool

LookAt(Vector3)

Looks at a target point in 3D space by setting the camera's position to the target.

public override void LookAt(Vector3 target)

Parameters

target Vector3

ScreenToWorld2D(float, float, Viewport)

Converts screen coordinates to world coordinates in 2D space.

public Vector2 ScreenToWorld2D(float screenX, float screenY, Viewport viewport)

Parameters

screenX float
screenY float
viewport Viewport

Returns

Vector2