From 68718085818dbe78b5dd63ebe276513f492ecdc1 Mon Sep 17 00:00:00 2001 From: ChrisDill Date: Sat, 12 Feb 2022 12:40:33 +0000 Subject: [PATCH] More reorganizing --- Raylib-cs/types/Camera2D.cs | 40 ++++++++++++++++++++++ Raylib-cs/types/{Camera.cs => Camera3D.cs} | 35 ------------------- Raylib-cs/types/Mesh.cs | 22 ------------ Raylib-cs/types/Transform.cs | 27 +++++++++++++++ 4 files changed, 67 insertions(+), 57 deletions(-) create mode 100644 Raylib-cs/types/Camera2D.cs rename Raylib-cs/types/{Camera.cs => Camera3D.cs} (64%) create mode 100644 Raylib-cs/types/Transform.cs diff --git a/Raylib-cs/types/Camera2D.cs b/Raylib-cs/types/Camera2D.cs new file mode 100644 index 0000000..76ad5bd --- /dev/null +++ b/Raylib-cs/types/Camera2D.cs @@ -0,0 +1,40 @@ +using System.Numerics; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Camera2D, defines position/orientation in 2d space + /// + [StructLayout(LayoutKind.Sequential)] + public partial 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; + } + } +} diff --git a/Raylib-cs/types/Camera.cs b/Raylib-cs/types/Camera3D.cs similarity index 64% rename from Raylib-cs/types/Camera.cs rename to Raylib-cs/types/Camera3D.cs index 041ac72..e4b5299 100644 --- a/Raylib-cs/types/Camera.cs +++ b/Raylib-cs/types/Camera3D.cs @@ -3,41 +3,6 @@ using System.Runtime.InteropServices; namespace Raylib_cs { - /// - /// Camera2D, defines position/orientation in 2d space - /// - [StructLayout(LayoutKind.Sequential)] - public partial 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 /// diff --git a/Raylib-cs/types/Mesh.cs b/Raylib-cs/types/Mesh.cs index e61b07d..1f4562d 100644 --- a/Raylib-cs/types/Mesh.cs +++ b/Raylib-cs/types/Mesh.cs @@ -4,28 +4,6 @@ using System.Runtime.InteropServices; namespace Raylib_cs { - /// - /// Transform, vectex transformation data - /// - [StructLayout(LayoutKind.Sequential)] - public partial struct Transform - { - /// - /// Translation - /// - public Vector3 translation; - - /// - /// Rotation - /// - public Vector4 rotation; - - /// - /// Scale - /// - public Vector3 scale; - } - /// /// Vertex data definning a mesh
/// NOTE: Data stored in CPU memory (and GPU) diff --git a/Raylib-cs/types/Transform.cs b/Raylib-cs/types/Transform.cs new file mode 100644 index 0000000..7d53b09 --- /dev/null +++ b/Raylib-cs/types/Transform.cs @@ -0,0 +1,27 @@ +using System.Numerics; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Transform, vectex transformation data + /// + [StructLayout(LayoutKind.Sequential)] + public partial struct Transform + { + /// + /// Translation + /// + public Vector3 translation; + + /// + /// Rotation + /// + public Vector4 rotation; + + /// + /// Scale + /// + public Vector3 scale; + } +}