Watch
2
0
Fork
You've already forked raylib-cs
0
raylib-cs/Raylib-cs/types/Camera3D.cs
Matorio b84a0d4f12 Merging
Added new extension "byte.Lerp".
Added new extension "Log" for "TraceLogLevel".
Constructors on Color no longer just truncate the float value, but also round it (+ 0.5f).
New static method on Color, "Color.Lerp".
Added static method "FromHSV" to Color.
Added new getter method "GetHSV" on Color.
Added index security on the FilePathList indexer.
Merged Rectangle extensions with the type itself as read-only methods.
Merged Image extensions with the type itself.
Merged Texture2D extensions with the type itself.
New file "Raymath.Utils" with some useful methods taken from Unity.
Added "MoveTowards" extensions to RaylibExtensions.
Added "TranslateLocal" and "TranslateGlobal" to Transform.
Added "Load", "Export", "ExportAsCode", "Format", "Crop", and "Unload" shortcut methods to Wave.
Added "IsValid" property to Wave, Texture2D, Sound, Shader, RenderTexture2D, Music, Image, Model, Material, Font, and AudioStream.
Added "IsPlaying" and "IsProcessed" properties to AudioStream.
Added "Load", "Play", "Stop", "Pause", "Resume", "SetBufferSizeDefault", "SetPan", "SetPitch", "SetVolume", and "Unload" shortcut methods to AudioStream.
Added "Load", "Export", and "Unload" methods to AutomationEventList.
Added "Default" property to Font.
Added "Load", "GetMaterial", "GetTexture", "SetTexture", "SetShader", and "Unload" methods to material.
Added "Draw", "DrawInstanced", "Export", "ExportAsCode", "Upload", and "Unload" methods to Mesh.
Added "Load", "LoadFromMesh", "Unload", and a lot of "Draw" overloads.
Added "Load", "Play", "Pause", "Stop", "SetPan", "SetPitch", "SetVolume", "Seek", and "Unload" methods to Music.
Added "Load" and "Unload" methods to RenderTexture2D.
Added "Load", "LoadFromMemory", "GetLocationAttrib", "SetValue", "SetTexture", "SetMatrix", and "Unload" methods to Shader.
Removed unnecessary "partial" declarations.
2025-07-17 03:14:57 -05:00

66 lines
1.4 KiB
C#

using System.Numerics;
using System.Runtime.InteropServices;
namespace Raylib_cs;
/// <summary>
/// Camera system modes
/// </summary>
public enum CameraMode
{
Custom = 0,
Free,
Orbital,
FirstPerson,
ThirdPerson
}
/// <summary>
/// Camera projection
/// </summary>
public enum CameraProjection
{
Perspective = 0,
Orthographic
}
/// <summary>
/// Camera3D, defines position/orientation in 3d space
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct Camera3D
{
/// <summary>
/// Camera position
/// </summary>
public Vector3 Position;
/// <summary>
/// Camera target it looks-at
/// </summary>
public Vector3 Target;
/// <summary>
/// Camera up vector (rotation over its axis)
/// </summary>
public Vector3 Up;
/// <summary>
/// Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
/// </summary>
public float FovY;
/// <summary>
/// Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
/// </summary>
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;
}
}