From b56354d4ecf559e4e742b2e1c9291fad5b72ae5d Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Thu, 24 Dec 2020 14:53:21 -0600 Subject: [PATCH] Add Vec2/3 extensions with many constants --- Godot Node Extensions.csproj | 2 + addons/godot-next-cs/2d/Vec2.cs | 107 +++++++++++++++++++++++ addons/godot-next-cs/3d/Vec3.cs | 147 ++++++++++++++++++++++++++++++++ addons/godot-next/2d/vec2.gd | 103 ++++++++++++++++++++++ addons/godot-next/3d/vec3.gd | 143 +++++++++++++++++++++++++++++++ project.godot | 18 ++++ 6 files changed, 520 insertions(+) create mode 100644 addons/godot-next-cs/2d/Vec2.cs create mode 100644 addons/godot-next-cs/3d/Vec3.cs create mode 100644 addons/godot-next/2d/vec2.gd create mode 100644 addons/godot-next/3d/vec3.gd diff --git a/Godot Node Extensions.csproj b/Godot Node Extensions.csproj index f97314b..ac91048 100644 --- a/Godot Node Extensions.csproj +++ b/Godot Node Extensions.csproj @@ -55,7 +55,9 @@ + + diff --git a/addons/godot-next-cs/2d/Vec2.cs b/addons/godot-next-cs/2d/Vec2.cs new file mode 100644 index 0000000..45f66dc --- /dev/null +++ b/addons/godot-next-cs/2d/Vec2.cs @@ -0,0 +1,107 @@ +using Godot; +using Vector2Array = Godot.Collections.Array; + +/// +/// Adds more constants for Vector2. +/// +/// +/// Also includes all of Godot's Vector2 constants. +/// +public static partial class Vec2 +{ + public static readonly Vector2 Zero = new Vector2(0, 0); + public static readonly Vector2 One = new Vector2(1, 1); + public static readonly Vector2 Right = new Vector2(1, 0); + public static readonly Vector2 DownRight = new Vector2(1, 1); + public static readonly Vector2 Down = new Vector2(0, 1); + public static readonly Vector2 DownLeft = new Vector2(-1, 1); + public static readonly Vector2 Left = new Vector2(-1, 0); + public static readonly Vector2 UpLeft = new Vector2(-1, -1); + public static readonly Vector2 Up = new Vector2(0, -1); + public static readonly Vector2 UpRight = new Vector2(1, -1); + + public static readonly Vector2Array DirCardinal = new Vector2Array{ + Right, + Down, + Left, + Up, + }; + + public static readonly Vector2Array Dir = new Vector2Array{ + Right, + DownRight, + Down, + DownLeft, + Left, + UpLeft, + Up, + UpRight, + }; + + public static readonly Vector2 RightNorm = new Vector2(1, 0); + public static readonly Vector2 DownRightNorm = new Vector2(0.7071067811865475244f, 0.7071067811865475244f); + public static readonly Vector2 DownNorm = new Vector2(0, 1); + public static readonly Vector2 DownLeftNorm = new Vector2(-0.7071067811865475244f, 0.7071067811865475244f); + public static readonly Vector2 LeftNorm = new Vector2(-1, 0); + public static readonly Vector2 UpLeftNorm = new Vector2(-0.7071067811865475244f, -0.7071067811865475244f); + public static readonly Vector2 UpNorm = new Vector2(0, -1); + public static readonly Vector2 UpRightNorm = new Vector2(0.7071067811865475244f, -0.7071067811865475244f); + + public static readonly Vector2Array DirNorm = new Vector2Array{ + RightNorm, + DownRightNorm, + DownNorm, + DownLeftNorm, + LeftNorm, + UpLeftNorm, + UpNorm, + UpRightNorm, + }; + + public static readonly Vector2 E = new Vector2(1, 0); + public static readonly Vector2 SE = new Vector2(1, 1); + public static readonly Vector2 S = new Vector2(0, 1); + public static readonly Vector2 SW = new Vector2(-1, 1); + public static readonly Vector2 W = new Vector2(-1, 0); + public static readonly Vector2 NW = new Vector2(-1, -1); + public static readonly Vector2 N = new Vector2(0, -1); + public static readonly Vector2 NE = new Vector2(1, -1); + + public static readonly Vector2 ENorm = new Vector2(1, 0); + public static readonly Vector2 SENorm = new Vector2(0.7071067811865475244f, 0.7071067811865475244f); + public static readonly Vector2 SNorm = new Vector2(0, 1); + public static readonly Vector2 SWNorm = new Vector2(-0.7071067811865475244f, 0.7071067811865475244f); + public static readonly Vector2 WNorm = new Vector2(-1, 0); + public static readonly Vector2 NWNorm = new Vector2(-0.7071067811865475244f, -0.7071067811865475244f); + public static readonly Vector2 NNorm = new Vector2(0, -1); + public static readonly Vector2 NENorm = new Vector2(0.7071067811865475244f, -0.7071067811865475244f); + + public static readonly Vector2 SEE = new Vector2(0.9238795325112867561f, 0.3826834323650897717f); + public static readonly Vector2 SSE = new Vector2(0.3826834323650897717f, 0.9238795325112867561f); + public static readonly Vector2 SSW = new Vector2(-0.3826834323650897717f, 0.9238795325112867561f); + public static readonly Vector2 SWW = new Vector2(-0.9238795325112867561f, 0.3826834323650897717f); + public static readonly Vector2 NWW = new Vector2(-0.9238795325112867561f, -0.3826834323650897717f); + public static readonly Vector2 NNW = new Vector2(-0.3826834323650897717f, -0.9238795325112867561f); + public static readonly Vector2 NNE = new Vector2(0.3826834323650897717f, -0.9238795325112867561f); + public static readonly Vector2 NEE = new Vector2(0.9238795325112867561f, -0.3826834323650897717f); + + public static readonly Vector2Array Dir16 = new Vector2Array{ + ENorm, + SEE, + SENorm, + SSE, + SNorm, + SSW, + SWNorm, + SWW, + WNorm, + NWW, + NWNorm, + NNW, + NNorm, + NNE, + NENorm, + NEE, + }; + +} diff --git a/addons/godot-next-cs/3d/Vec3.cs b/addons/godot-next-cs/3d/Vec3.cs new file mode 100644 index 0000000..4d0606d --- /dev/null +++ b/addons/godot-next-cs/3d/Vec3.cs @@ -0,0 +1,147 @@ +using Godot; +using Vector3Array = Godot.Collections.Array; + +/// +/// Adds more constants for Vector3. +/// +/// +/// Also includes all of Godot's Vector3 constants. +/// +public static partial class Vec3 +{ + + public static readonly Vector3 Zero = new Vector3(0, 0, 0); + public static readonly Vector3 One = new Vector3(1, 1, 1); + public static readonly Vector3 Right = new Vector3(1, 0, 0); + public static readonly Vector3 BackRight = new Vector3(1, 0, 1); + public static readonly Vector3 Back = new Vector3(0, 0, 1); + public static readonly Vector3 BackLeft = new Vector3(-1, 0, 1); + public static readonly Vector3 Left = new Vector3(-1, 0, 0); + public static readonly Vector3 ForwardLeft = new Vector3(-1, 0, -1); + public static readonly Vector3 Forward = new Vector3(0, 0, -1); + public static readonly Vector3 ForwardRight = new Vector3(1, 0, -1); + + public static readonly Vector3Array DirCardinal = new Vector3Array{ + Right, + Back, + Left, + Forward, + }; + + public static readonly Vector3Array Dir = new Vector3Array{ + Right, + BackRight, + Back, + BackLeft, + Left, + ForwardLeft, + Forward, + ForwardRight, + }; + + public static readonly Vector3 RightNorm = new Vector3(1, 0, 0); + public static readonly Vector3 BackRightNorm = new Vector3(0.7071067811865475244f, 0, 0.7071067811865475244f); + public static readonly Vector3 BackNorm = new Vector3(0, 0, 1); + public static readonly Vector3 BackLeftNorm = new Vector3(-0.7071067811865475244f, 0, 0.7071067811865475244f); + public static readonly Vector3 LeftNorm = new Vector3(-1, 0, 0); + public static readonly Vector3 ForwardLeftNorm = new Vector3(-0.7071067811865475244f, 0, -0.7071067811865475244f); + public static readonly Vector3 ForwardNorm = new Vector3(0, 0, -1); + public static readonly Vector3 ForwardRightNorm = new Vector3(0.7071067811865475244f, 0, -0.7071067811865475244f); + + public static readonly Vector3Array DirNorm = new Vector3Array{ + RightNorm, + BackRightNorm, + BackNorm, + BackLeftNorm, + LeftNorm, + ForwardLeftNorm, + ForwardNorm, + ForwardRightNorm, + }; + + public static readonly Vector3 E = new Vector3(1, 0, 0); + public static readonly Vector3 SE = new Vector3(1, 0, 1); + public static readonly Vector3 S = new Vector3(0, 0, 1); + public static readonly Vector3 SW = new Vector3(-1, 0, 1); + public static readonly Vector3 W = new Vector3(-1, 0, 0); + public static readonly Vector3 NW = new Vector3(-1, 0, -1); + public static readonly Vector3 N = new Vector3(0, 0, -1); + public static readonly Vector3 NE = new Vector3(1, 0, -1); + + public static readonly Vector3 ENorm = new Vector3(1, 0, 0); + public static readonly Vector3 SENorm = new Vector3(0.7071067811865475244f, 0, 0.7071067811865475244f); + public static readonly Vector3 SNorm = new Vector3(0, 0, 1); + public static readonly Vector3 SWNorm = new Vector3(-0.7071067811865475244f, 0, 0.7071067811865475244f); + public static readonly Vector3 WNorm = new Vector3(-1, 0, 0); + public static readonly Vector3 NWNorm = new Vector3(-0.7071067811865475244f, 0, -0.7071067811865475244f); + public static readonly Vector3 NNorm = new Vector3(0, 0, -1); + public static readonly Vector3 NENorm = new Vector3(0.7071067811865475244f, 0, -0.7071067811865475244f); + + public static readonly Vector3 SEE = new Vector3(0.9238795325112867561f, 0, 0.3826834323650897717f); + public static readonly Vector3 SSE = new Vector3(0.3826834323650897717f, 0, 0.9238795325112867561f); + public static readonly Vector3 SSW = new Vector3(-0.3826834323650897717f, 0, 0.9238795325112867561f); + public static readonly Vector3 SWW = new Vector3(-0.9238795325112867561f, 0, 0.3826834323650897717f); + public static readonly Vector3 NWW = new Vector3(-0.9238795325112867561f, 0, -0.3826834323650897717f); + public static readonly Vector3 NNW = new Vector3(-0.3826834323650897717f, 0, -0.9238795325112867561f); + public static readonly Vector3 NNE = new Vector3(0.3826834323650897717f, 0, -0.9238795325112867561f); + public static readonly Vector3 NEE = new Vector3(0.9238795325112867561f, 0, -0.3826834323650897717f); + + public static readonly Vector3Array Dir16 = new Vector3Array{ + ENorm, + SEE, + SENorm, + SSE, + SNorm, + SSW, + SWNorm, + SWW, + WNorm, + NWW, + NWNorm, + NNW, + NNorm, + NNE, + NENorm, + NEE, + }; + + public static readonly Vector3 Up = new Vector3(0, 1, 0); + public static readonly Vector3 UpRight = new Vector3(1, 1, 0); + public static readonly Vector3 UpBackRight = new Vector3(1, 1, 1); + public static readonly Vector3 UpBack = new Vector3(0, 1, 1); + public static readonly Vector3 UpBackLeft = new Vector3(-1, 1, 1); + public static readonly Vector3 UpLeft = new Vector3(-1, 1, 0); + public static readonly Vector3 UpForwardLeft = new Vector3(-1, 1, -1); + public static readonly Vector3 UpForward = new Vector3(0, 1, -1); + public static readonly Vector3 UpForwardRight = new Vector3(1, 1, -1); + + public static readonly Vector3 Down = new Vector3(0, -1, 0); + public static readonly Vector3 DownRight = new Vector3(1, -1, 0); + public static readonly Vector3 DownBackRight = new Vector3(1, -1, 1); + public static readonly Vector3 DownBack = new Vector3(0, -1, 1); + public static readonly Vector3 DownBackLeft = new Vector3(-1, -1, 1); + public static readonly Vector3 DownLeft = new Vector3(-1, -1, 0); + public static readonly Vector3 DownForwardLeft = new Vector3(-1, -1, -1); + public static readonly Vector3 DownForward = new Vector3(0, -1, -1); + public static readonly Vector3 DownForwardRight = new Vector3(1, -1, -1); + + public static readonly Vector3 UpNorm = new Vector3(0, 1, 0); + public static readonly Vector3 UpRightNorm = new Vector3(0.7071067811865475244f, 0.7071067811865475244f, 0); + public static readonly Vector3 UpBackRightNorm = new Vector3(0.5773502691896257645f, 0.5773502691896257645f, 0.5773502691896257645f); + public static readonly Vector3 UpBackNorm = new Vector3(0, 0.7071067811865475244f, 0.7071067811865475244f); + public static readonly Vector3 UpBackLeftNorm = new Vector3(-0.5773502691896257645f, 0.5773502691896257645f, 0.5773502691896257645f); + public static readonly Vector3 UpLeftNorm = new Vector3(-0.7071067811865475244f, 0.7071067811865475244f, 0); + public static readonly Vector3 UpForwardLeftNorm = new Vector3(-0.5773502691896257645f, 0.5773502691896257645f, -0.5773502691896257645f); + public static readonly Vector3 UpForwardNorm = new Vector3(0, 0.7071067811865475244f, -0.7071067811865475244f); + public static readonly Vector3 UpForwardRightNorm = new Vector3(0.5773502691896257645f, 0.5773502691896257645f, -0.5773502691896257645f); + + public static readonly Vector3 DownNorm = new Vector3(0, -1, 0); + public static readonly Vector3 DownRightNorm = new Vector3(0.7071067811865475244f, -0.7071067811865475244f, 0); + public static readonly Vector3 DownBackRightNorm = new Vector3(0.5773502691896257645f, -0.5773502691896257645f, 0.5773502691896257645f); + public static readonly Vector3 DownBackNorm = new Vector3(0, -0.7071067811865475244f, 0.7071067811865475244f); + public static readonly Vector3 DownBackLeftNorm = new Vector3(-0.5773502691896257645f, -0.5773502691896257645f, 0.5773502691896257645f); + public static readonly Vector3 DownLeftNorm = new Vector3(-0.7071067811865475244f, -0.7071067811865475244f, 0); + public static readonly Vector3 DownForwardLeftNorm = new Vector3(-0.5773502691896257645f, -0.5773502691896257645f, -0.5773502691896257645f); + public static readonly Vector3 DownForwardNorm = new Vector3(0, -0.7071067811865475244f, -0.7071067811865475244f); + public static readonly Vector3 DownForwardRightNorm = new Vector3(0.5773502691896257645f, -0.5773502691896257645f, -0.5773502691896257645f); +} diff --git a/addons/godot-next/2d/vec2.gd b/addons/godot-next/2d/vec2.gd new file mode 100644 index 0000000..b8087aa --- /dev/null +++ b/addons/godot-next/2d/vec2.gd @@ -0,0 +1,103 @@ +class_name Vec2 +extends Resource +# author: aaronfranke +# license: MIT +# description: Adds more constants for Vector2. +# notes: +# - Also includes all of Godot's Vector2 constants. + +const ZERO = Vector2(0, 0) +const ONE = Vector2(1, 1) +const RIGHT = Vector2(1, 0) +const DOWN_RIGHT = Vector2(1, 1) +const DOWN = Vector2(0, 1) +const DOWN_LEFT = Vector2(-1, 1) +const LEFT = Vector2(-1, 0) +const UP_LEFT = Vector2(-1, -1) +const UP = Vector2(0, -1) +const UP_RIGHT = Vector2(1, -1) + +const DIR_CARDINAL = [ + RIGHT, + DOWN, + LEFT, + UP, +] + +const DIR = [ + RIGHT, + DOWN_RIGHT, + DOWN, + DOWN_LEFT, + LEFT, + UP_LEFT, + UP, + UP_RIGHT, +] + +const RIGHT_NORM = Vector2(1, 0) +const DOWN_RIGHT_NORM = Vector2(0.7071067811865475244, 0.7071067811865475244) +const DOWN_NORM = Vector2(0, 1) +const DOWN_LEFT_NORM = Vector2(-0.7071067811865475244, 0.7071067811865475244) +const LEFT_NORM = Vector2(-1, 0) +const UP_LEFT_NORM = Vector2(-0.7071067811865475244, -0.7071067811865475244) +const UP_NORM = Vector2(0, -1) +const UP_RIGHT_NORM = Vector2(0.7071067811865475244, -0.7071067811865475244) + +const DIR_NORM = [ + RIGHT_NORM, + DOWN_RIGHT_NORM, + DOWN_NORM, + DOWN_LEFT_NORM, + LEFT_NORM, + UP_LEFT_NORM, + UP_NORM, + UP_RIGHT_NORM, +] + +const E = Vector2(1, 0) +const SE = Vector2(1, 1) +const S = Vector2(0, 1) +const SW = Vector2(-1, 1) +const W = Vector2(-1, 0) +const NW = Vector2(-1, -1) +const N = Vector2(0, -1) +const NE = Vector2(1, -1) + +const E_NORM = Vector2(1, 0) +const SE_NORM = Vector2(0.7071067811865475244, 0.7071067811865475244) +const S_NORM = Vector2(0, 1) +const SW_NORM = Vector2(-0.7071067811865475244, 0.7071067811865475244) +const W_NORM = Vector2(-1, 0) +const NW_NORM = Vector2(-0.7071067811865475244, -0.7071067811865475244) +const N_NORM = Vector2(0, -1) +const NE_NORM = Vector2(0.7071067811865475244, -0.7071067811865475244) + +# These are always normalized, because tan(22.5 degrees) is not rational. +const SEE = Vector2(0.9238795325112867561, 0.3826834323650897717) +const SSE = Vector2(0.3826834323650897717, 0.9238795325112867561) +const SSW = Vector2(-0.3826834323650897717, 0.9238795325112867561) +const SWW = Vector2(-0.9238795325112867561, 0.3826834323650897717) +const NWW = Vector2(-0.9238795325112867561, -0.3826834323650897717) +const NNW = Vector2(-0.3826834323650897717, -0.9238795325112867561) +const NNE = Vector2(0.3826834323650897717, -0.9238795325112867561) +const NEE = Vector2(0.9238795325112867561, -0.3826834323650897717) + +const DIR_16 = [ + E_NORM, + SEE, + SE_NORM, + SSE, + S_NORM, + SSW, + SW_NORM, + SWW, + W_NORM, + NWW, + NW_NORM, + NNW, + N_NORM, + NNE, + NE_NORM, + NEE, +] diff --git a/addons/godot-next/3d/vec3.gd b/addons/godot-next/3d/vec3.gd new file mode 100644 index 0000000..08e66d6 --- /dev/null +++ b/addons/godot-next/3d/vec3.gd @@ -0,0 +1,143 @@ +class_name Vec3 +extends Resource +# author: aaronfranke +# license: MIT +# description: Adds more constants for Vector3. +# notes: +# - Also includes all of Godot's Vector3 constants. + +const ZERO = Vector3(0, 0, 0) +const ONE = Vector3(1, 1, 1) +const RIGHT = Vector3(1, 0, 0) +const BACK_RIGHT = Vector3(1, 0, 1) +const BACK = Vector3(0, 0, 1) +const BACK_LEFT = Vector3(-1, 0, 1) +const LEFT = Vector3(-1, 0, 0) +const FORWARD_LEFT = Vector3(-1, 0, -1) +const FORWARD = Vector3(0, 0, -1) +const FORWARD_RIGHT = Vector3(1, 0, -1) + +const DIR_CARDINAL = [ + RIGHT, + BACK, + LEFT, + FORWARD, +] + +const DIR = [ + RIGHT, + BACK_RIGHT, + BACK, + BACK_LEFT, + LEFT, + FORWARD_LEFT, + FORWARD, + FORWARD_RIGHT, +] + +const RIGHT_NORM = Vector3(1, 0, 0) +const BACK_RIGHT_NORM = Vector3(0.7071067811865475244, 0, 0.7071067811865475244) +const BACK_NORM = Vector3(0, 0, 1) +const BACK_LEFT_NORM = Vector3(-0.7071067811865475244, 0, 0.7071067811865475244) +const LEFT_NORM = Vector3(-1, 0, 0) +const FORWARD_LEFT_NORM = Vector3(-0.7071067811865475244, 0, -0.7071067811865475244) +const FORWARD_NORM = Vector3(0, 0, -1) +const FORWARD_RIGHT_NORM = Vector3(0.7071067811865475244, 0, -0.7071067811865475244) + +const DIR_NORM = [ + RIGHT_NORM, + BACK_RIGHT_NORM, + BACK_NORM, + BACK_LEFT_NORM, + LEFT_NORM, + FORWARD_LEFT_NORM, + FORWARD_NORM, + FORWARD_RIGHT_NORM, +] + +const E = Vector3(1, 0, 0) +const SE = Vector3(1, 0, 1) +const S = Vector3(0, 0, 1) +const SW = Vector3(-1, 0, 1) +const W = Vector3(-1, 0, 0) +const NW = Vector3(-1, 0, -1) +const N = Vector3(0, 0, -1) +const NE = Vector3(1, 0, -1) + +const E_NORM = Vector3(1, 0, 0) +const SE_NORM = Vector3(0.7071067811865475244, 0, 0.7071067811865475244) +const S_NORM = Vector3(0, 0, 1) +const SW_NORM = Vector3(-0.7071067811865475244, 0, 0.7071067811865475244) +const W_NORM = Vector3(-1, 0, 0) +const NW_NORM = Vector3(-0.7071067811865475244, 0, -0.7071067811865475244) +const N_NORM = Vector3(0, 0, -1) +const NE_NORM = Vector3(0.7071067811865475244, 0, -0.7071067811865475244) + +# These are always normalized, because tan(22.5 degrees) is not rational. +const SEE = Vector3(0.9238795325112867561, 0, 0.3826834323650897717) +const SSE = Vector3(0.3826834323650897717, 0, 0.9238795325112867561) +const SSW = Vector3(-0.3826834323650897717, 0, 0.9238795325112867561) +const SWW = Vector3(-0.9238795325112867561, 0, 0.3826834323650897717) +const NWW = Vector3(-0.9238795325112867561, 0, -0.3826834323650897717) +const NNW = Vector3(-0.3826834323650897717, 0, -0.9238795325112867561) +const NNE = Vector3(0.3826834323650897717, 0, -0.9238795325112867561) +const NEE = Vector3(0.9238795325112867561, 0, -0.3826834323650897717) + +const DIR_16 = [ + E_NORM, + SEE, + SE_NORM, + SSE, + S_NORM, + SSW, + SW_NORM, + SWW, + W_NORM, + NWW, + NW_NORM, + NNW, + N_NORM, + NNE, + NE_NORM, + NEE, +] + +const UP = Vector3(0, 1, 0) +const UP_RIGHT = Vector3(1, 1, 0) +const UP_BACK_RIGHT = Vector3(1, 1, 1) +const UP_BACK = Vector3(0, 1, 1) +const UP_BACK_LEFT = Vector3(-1, 1, 1) +const UP_LEFT = Vector3(-1, 1, 0) +const UP_FORWARD_LEFT = Vector3(-1, 1, -1) +const UP_FORWARD = Vector3(0, 1, -1) +const UP_FORWARD_RIGHT = Vector3(1, 1, -1) + +const DOWN = Vector3(0, -1, 0) +const DOWN_RIGHT = Vector3(1, -1, 0) +const DOWN_BACK_RIGHT = Vector3(1, -1, 1) +const DOWN_BACK = Vector3(0, -1, 1) +const DOWN_BACK_LEFT = Vector3(-1, -1, 1) +const DOWN_LEFT = Vector3(-1, -1, 0) +const DOWN_FORWARD_LEFT = Vector3(-1, -1, -1) +const DOWN_FORWARD = Vector3(0, -1, -1) +const DOWN_FORWARD_RIGHT = Vector3(1, -1, -1) + +const UP_NORM = Vector3(0, 1, 0) +const UP_RIGHT_NORM = Vector3(0.7071067811865475244, 0.7071067811865475244, 0) +const UP_BACK_RIGHT_NORM = Vector3(0.5773502691896257645, 0.5773502691896257645, 0.5773502691896257645) +const UP_BACK_NORM = Vector3(0, 0.7071067811865475244, 0.7071067811865475244) +const UP_BACK_LEFT_NORM = Vector3(-0.5773502691896257645, 0.5773502691896257645, 0.5773502691896257645) +const UP_LEFT_NORM = Vector3(-0.7071067811865475244, 0.7071067811865475244, 0) +const UP_FORWARD_LEFT_NORM = Vector3(-0.5773502691896257645, 0.5773502691896257645, -0.5773502691896257645) +const UP_FORWARD_NORM = Vector3(0, 0.7071067811865475244, -0.7071067811865475244) +const UP_FORWARD_RIGHT_NORM = Vector3(0.5773502691896257645, 0.5773502691896257645, -0.5773502691896257645) + +const DOWN_NORM = Vector3(0, -1, 0) +const DOWN_RIGHT_NORM = Vector3(0.7071067811865475244, -0.7071067811865475244, 0) +const DOWN_BACK_RIGHT_NORM = Vector3(0.5773502691896257645, -0.5773502691896257645, 0.5773502691896257645) +const DOWN_BACK_NORM = Vector3(0, -0.7071067811865475244, 0.7071067811865475244) +const DOWN_BACK_LEFT_NORM = Vector3(-0.5773502691896257645, -0.5773502691896257645, 0.5773502691896257645) +const DOWN_LEFT_NORM = Vector3(-0.7071067811865475244, -0.7071067811865475244, 0) +const DOWN_FORWARD_LEFT_NORM = Vector3(-0.5773502691896257645, -0.5773502691896257645, -0.5773502691896257645) +const DOWN_FORWARD_NORM = Vector3(0, -0.7071067811865475244, -0.7071067811865475244) +const DOWN_FORWARD_RIGHT_NORM = Vector3(0.5773502691896257645, -0.5773502691896257645, -0.5773502691896257645) diff --git a/project.godot b/project.godot index 538fa51..c344f62 100644 --- a/project.godot +++ b/project.godot @@ -15,6 +15,11 @@ _global_script_classes=[ { "path": "res://addons/godot-next/references/array_2d.gd" }, { "base": "Resource", +"class": "ArrayMap", +"language": "GDScript", +"path": "res://addons/godot-next/resources/array_map.gd" +}, { +"base": "Resource", "class": "Behavior", "language": "GDScript", "path": "res://addons/godot-next/resources/behavior.gd" @@ -174,6 +179,16 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://addons/godot-next/global/variant.gd" }, { +"base": "Resource", +"class": "Vec2", +"language": "GDScript", +"path": "res://addons/godot-next/2d/vec2.gd" +}, { +"base": "Resource", +"class": "Vec3", +"language": "GDScript", +"path": "res://addons/godot-next/3d/vec3.gd" +}, { "base": "Node", "class": "VectorDisplay2D", "language": "GDScript", @@ -186,6 +201,7 @@ _global_script_classes=[ { } ] _global_script_class_icons={ "Array2D": "", +"ArrayMap": "", "Behavior": "", "BitFlag": "", "Bitset": "", @@ -218,6 +234,8 @@ _global_script_class_icons={ "Tweener": "", "VBoxItemList": "res://addons/godot-next/icons/icon_v_box_item_list.svg", "Variant": "", +"Vec2": "", +"Vec3": "", "VectorDisplay2D": "", "VectorDisplay3D": "" }