using System.Numerics;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
/// Camera2D, defines position/orientation in 2d space
[StructLayout(LayoutKind.Sequential)]
public struct Camera2D
{
///
/// Camera offset (displacement from target)
///
public Vector2 offset;
///
/// Camera target (rotation and zoom origin)
///
public Vector2 target;
///
/// Camera rotation in degrees
///
public float rotation;
///
/// Camera zoom (scaling), should be 1.0f by default
///
public float zoom;
public Camera2D(Vector2 offset, Vector2 target, float rotation, float zoom)
{
this.offset = offset;
this.target = target;
this.rotation = rotation;
this.zoom = zoom;
}
}
/// Camera system modes
public enum CameraMode
{
CAMERA_CUSTOM = 0,
CAMERA_FREE,
CAMERA_ORBITAL,
CAMERA_FIRST_PERSON,
CAMERA_THIRD_PERSON
}
/// Camera projection
public enum CameraProjection
{
CAMERA_PERSPECTIVE = 0,
CAMERA_ORTHOGRAPHIC
}
///
/// Camera3D, defines position/orientation in 3d space
///
[StructLayout(LayoutKind.Sequential)]
public struct Camera3D
{
///
/// Camera position
///
public Vector3 position;
///
/// Camera target it looks-at
///
public Vector3 target;
///
/// Camera up vector (rotation over its axis)
///
public Vector3 up;
///
/// Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
///
public float fovy;
///
/// Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
///
public CameraProjection projection;
public Camera3D(Vector3 position, Vector3 target, Vector3 up, float fovy, CameraProjection projection)
{
this.position = position;
this.target = target;
this.up = up;
this.fovy = fovy;
this.projection = projection;
}
}
}