Class OrthographicCamera
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
Methods
CalculateScreenCorrection(float, float)
Calculates the screen correction factor based on the screen width and height.
public float CalculateScreenCorrection(float screenWidth, float screenHeight)
Parameters
Returns
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
viewportViewport
Returns
GetViewMatrix()
Gets the view matrix of the camera.
public override Matrix4 GetViewMatrix()
Returns
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
Returns
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
Returns
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
targetVector3
ScreenToWorld2D(float, float, Viewport)
Converts screen coordinates to world coordinates in 2D space.
public Vector2 ScreenToWorld2D(float screenX, float screenY, Viewport viewport)