diff --git a/Raylib-cs/types/Raylib.Utils.cs b/Raylib-cs/types/Raylib.Utils.cs index 98b9526..6bb24f9 100644 --- a/Raylib-cs/types/Raylib.Utils.cs +++ b/Raylib-cs/types/Raylib.Utils.cs @@ -277,6 +277,127 @@ public static unsafe partial class Raylib } } + /// Returns the cameras forward vector (normalized) + public static Vector3 GetCameraForward(ref Camera3D camera) + { + fixed (Camera3D* c = &camera) + { + return GetCameraForward(c); + } + } + + /// + /// Returns the cameras up vector (normalized)
+ /// NOTE: The up vector might not be perpendicular to the forward vector + ///
+ public static Vector3 GetCameraUp(ref Camera3D camera) + { + fixed (Camera3D* c = &camera) + { + return GetCameraUp(c); + } + } + + /// Returns the cameras right vector (normalized) + public static Vector3 GetCameraRight(ref Camera3D camera) + { + fixed (Camera3D* c = &camera) + { + return GetCameraRight(c); + } + } + + /// Moves the camera in its forward direction + public static void CameraMoveForward(ref Camera3D camera, float distance, CBool moveInWorldPlane) + { + fixed (Camera3D* c = &camera) + { + CameraMoveForward(c, distance, moveInWorldPlane); + } + } + + /// Moves the camera in its up direction + public static void CameraMoveUp(ref Camera3D camera, float distance) + { + fixed (Camera3D* c = &camera) + { + CameraMoveUp(c, distance); + } + } + + /// Moves the camera target in its current right direction + public static void CameraMoveRight(ref Camera3D camera, float distance, CBool moveInWorldPlane) + { + fixed (Camera3D* c = &camera) + { + CameraMoveRight(c, distance, moveInWorldPlane); + } + } + + /// Moves the camera position closer/farther to/from the camera target + public static void CameraMoveToTarget(ref Camera3D camera, float delta) + { + fixed (Camera3D* c = &camera) + { + CameraMoveToTarget(c, delta); + } + } + + /// + /// Rotates the camera around its up vector
+ /// If rotateAroundTarget is false, the camera rotates around its position + ///
+ public static void CameraYaw(ref Camera3D camera, float angle, CBool rotateAroundTarget) + { + fixed (Camera3D* c = &camera) + { + CameraYaw(c, angle, rotateAroundTarget); + } + } + + /// + /// Rotates the camera around its right vector + /// + public static void CameraPitch(ref Camera3D camera, + float angle, + CBool lockView, + CBool rotateAroundTarget, + CBool rotateUp + ) + { + fixed (Camera3D* c = &camera) + { + CameraPitch(c, angle, lockView, rotateAroundTarget, rotateUp); + } + } + + /// Rotates the camera around its forward vector + public static void CameraRoll(ref Camera3D camera, float angle) + { + fixed (Camera3D* c = &camera) + { + CameraRoll(c, angle); + } + } + + /// Returns the camera view matrix + public static Matrix4x4 GetCameraViewMatrix(ref Camera3D camera) + { + fixed (Camera3D* c = &camera) + { + return GetCameraViewMatrix(c); + } + } + + /// Returns the camera projection matrix + public static Matrix4x4 GetCameraProjectionMatrix(ref Camera3D camera, float aspect) + { + fixed (Camera3D* c = &camera) + { + return GetCameraProjectionMatrix(c, aspect); + } + } + /// /// Check the collision between two lines defined by two points each, returns collision point by reference ///