Class Camera¶
Namespace: Apogee.Rendering
Assembly: Apogee.Rendering.dll
A perspective camera in a right-handed world (+Y up, looking down -Z at yaw 0). The projection is reverse-Z with an infinite far plane: the
near plane maps to depth 1 and infinity to 0, which spreads float precision evenly over the whole depth range. Normalized device y points
down, as in Vulkan, so no viewport flip is needed; the image, and so the winding of triangles (counter-clockwise for front faces, as in glTF), is unchanged.
The position is a
public sealed class Camera
Inheritance¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Properties¶
ClusterFar¶
How far the light-culling clusters reach; nothing is clipped at this distance.
public float ClusterFar { get; set; }
Property Value¶
Forward¶
public Vector3 Forward { get; }
Property Value¶
Near¶
public float Near { get; set; }
Property Value¶
Pitch¶
Rotation up (positive) or down, in radians.
public float Pitch { get; set; }
Property Value¶
Position¶
public Double3 Position { get; set; }
Property Value¶
Right¶
public Vector3 Right { get; }
Property Value¶
VerticalFov¶
public float VerticalFov { get; set; }
Property Value¶
View¶
The view matrix for camera-relative positions: the camera is at the origin, so it holds only the rotation. Use
public Matrix4x4 View { get; }
Property Value¶
Yaw¶
Rotation about +Y in radians; positive turns to the left.
public float Yaw { get; set; }
Property Value¶
Methods¶
LookAt(Double3)¶
Points the camera at a target.
public void LookAt(Double3 target)
Parameters¶
target Double3
Projection(float)¶
public Matrix4x4 Projection(float aspect)
Parameters¶
aspect float
Returns¶
ReverseZ(float, float, float)¶
public static Matrix4x4 ReverseZ(float verticalFov, float aspect, float near)
Parameters¶
verticalFov float
aspect float
near float
Returns¶
WorldToView(Double3)¶
A world position in view space (x right, y up, the camera looking down -Z): the offset from the camera is taken in double precision first.
public Vector3 WorldToView(Double3 point)
Parameters¶
point Double3