Programming API Reference: SharpGfx.Cameras

Class public abstract Camera

is IMouseButtonDownHandling, IMouseButtonUpHandling
This is the camera abstraction. The camera is oriented such that the x-z plane is horizontal.
Property public Point3 Position { get; set; }: where the camera is placed.
Property public Vector3 LookAt { get; set; }: the direction to which the camera is pointed.
Property public Projection Projection { get; }: that is applied
Property public float Pitch { get; set; }: of this camera.
Property public float Yaw { get; set; }: of this camera.
Property public View View { get; set; }: from this camera.
Property protected MouseButton PressedButtons { get; set; }: the set of mouse buttons that is currently pressed.

Constructor()

This constructor is called by non-abstract cameras.
  • Point3 position
  • Vector3 lookAt
  • Projection? projection: that is applied by the camera, perspective when not given

Method protected static float Limit()

This is a mathematical helper-function limiting the value in the given range around zero.
  • float value
  • float range

Method public ( Point3 topLeft Point3 topRight Point3 bottomLeft Point3 bottomRight ) GetProjectionPlane()

This method returns the world positions of the projection plane in unit distance from the camera position. This is useful to calculate the view-frustum.
  • float aspect: the relation of projection width over height.

Method public Matrix4 GetProjection()

This method returns the projection matrix.
  • int width: in pixels.
  • int height: in pixels.