From a986686ac4b4896fc13feb5a85e64e511e6a4c83 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Tue, 21 Aug 2018 01:34:34 -0400 Subject: [PATCH] Rename Plane constants, add to Mono But I'm not tagging PR as [Core] or [Mono] due to it being a minor change anyway. --- core/variant_call.cpp | 6 +++--- modules/mono/glue/cs_files/Plane.cs | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/core/variant_call.cpp b/core/variant_call.cpp index ea51419233c..cddf4fcdb18 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1920,9 +1920,9 @@ void register_variant_methods() { transform_x.set(1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0); _VariantCall::add_variant_constant(Variant::TRANSFORM, "FLIP_Z", transform_z); - _VariantCall::add_variant_constant(Variant::PLANE, "X", Plane(Vector3(1, 0, 0), 0)); - _VariantCall::add_variant_constant(Variant::PLANE, "Y", Plane(Vector3(0, 1, 0), 0)); - _VariantCall::add_variant_constant(Variant::PLANE, "Z", Plane(Vector3(0, 0, 1), 0)); + _VariantCall::add_variant_constant(Variant::PLANE, "PLANE_YZ", Plane(Vector3(1, 0, 0), 0)); + _VariantCall::add_variant_constant(Variant::PLANE, "PLANE_XZ", Plane(Vector3(0, 1, 0), 0)); + _VariantCall::add_variant_constant(Variant::PLANE, "PLANE_XY", Plane(Vector3(0, 0, 1), 0)); _VariantCall::add_variant_constant(Variant::QUAT, "IDENTITY", Quat(0, 0, 0, 1)); diff --git a/modules/mono/glue/cs_files/Plane.cs b/modules/mono/glue/cs_files/Plane.cs index 1020f06bf59..9611dce11e6 100644 --- a/modules/mono/glue/cs_files/Plane.cs +++ b/modules/mono/glue/cs_files/Plane.cs @@ -145,6 +145,15 @@ namespace Godot return point - _normal * DistanceTo(point); } + // Constants + private static readonly Plane _planeYZ = new Plane(1, 0, 0, 0); + private static readonly Plane _planeXZ = new Plane(0, 1, 0, 0); + private static readonly Plane _planeXY = new Plane(0, 0, 1, 0); + + public static Plane PlaneYZ { get { return _planeYZ; } } + public static Plane PlaneXZ { get { return _planeXZ; } } + public static Plane PlaneXY { get { return _planeXY; } } + // Constructors public Plane(real_t a, real_t b, real_t c, real_t d) {