From 9e1588160f5e1e66abf9369dff95ad8233d0d981 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 16 Aug 2022 22:09:26 +0200 Subject: [PATCH] Now all Variant math types are structs. --- core/math/aabb.h | 3 +-- core/math/basis.h | 3 +-- core/math/face3.h | 3 +-- core/math/plane.h | 3 +-- core/math/projection.h | 8 ++++---- core/math/quaternion.h | 3 +-- core/math/transform.h | 3 +-- core/math/transform_interpolator.h | 2 +- core/math/vector3.h | 2 +- editor/animation_track_editor.h | 2 +- editor/editor_plugin.h | 2 +- editor/inspector_dock.cpp | 2 +- editor/inspector_dock.h | 2 +- editor/plugins/spatial_editor_plugin.h | 2 +- editor/spatial_editor_gizmos.h | 2 +- servers/visual/portals/portal_renderer.h | 2 +- 16 files changed, 19 insertions(+), 25 deletions(-) diff --git a/core/math/aabb.h b/core/math/aabb.h index 51ed632d1..d34f521b8 100644 --- a/core/math/aabb.h +++ b/core/math/aabb.h @@ -41,8 +41,7 @@ class Variant; -class _NO_DISCARD_CLASS_ AABB { -public: +struct _NO_DISCARD_CLASS_ AABB { Vector3 position; Vector3 size; diff --git a/core/math/basis.h b/core/math/basis.h index 25c375181..4a8d6a923 100644 --- a/core/math/basis.h +++ b/core/math/basis.h @@ -34,8 +34,7 @@ #include "core/math/vector3.h" #include "core/math/vector3i.h" -class _NO_DISCARD_CLASS_ Basis { -public: +struct _NO_DISCARD_CLASS_ Basis { Vector3 rows[3] = { Vector3(1, 0, 0), Vector3(0, 1, 0), diff --git a/core/math/face3.h b/core/math/face3.h index b460c8844..4224937ae 100644 --- a/core/math/face3.h +++ b/core/math/face3.h @@ -35,8 +35,7 @@ #include "core/math/transform.h" #include "core/math/vector3.h" -class _NO_DISCARD_CLASS_ Face3 { -public: +struct _NO_DISCARD_CLASS_ Face3 { enum Side { SIDE_OVER, SIDE_UNDER, diff --git a/core/math/plane.h b/core/math/plane.h index 73e41980f..1478d7c8e 100644 --- a/core/math/plane.h +++ b/core/math/plane.h @@ -34,8 +34,7 @@ class Variant; -class _NO_DISCARD_CLASS_ Plane { -public: +struct _NO_DISCARD_CLASS_ Plane { Vector3 normal; real_t d; diff --git a/core/math/projection.h b/core/math/projection.h index 4a5fa95eb..a36a2beda 100644 --- a/core/math/projection.h +++ b/core/math/projection.h @@ -37,13 +37,13 @@ #include "core/vector.h" class Array; -class AABB; -class Plane; +struct AABB; +struct Plane; struct Rect2; -class Transform; +struct Transform; struct Vector2; -struct Projection { +struct _NO_DISCARD_CLASS_ Projection { enum Planes { PLANE_NEAR, PLANE_FAR, diff --git a/core/math/quaternion.h b/core/math/quaternion.h index 6b7af0348..e0e229c22 100644 --- a/core/math/quaternion.h +++ b/core/math/quaternion.h @@ -35,8 +35,7 @@ #include "core/math/vector3.h" #include "core/ustring.h" -class _NO_DISCARD_CLASS_ Quaternion { -public: +struct _NO_DISCARD_CLASS_ Quaternion { union { struct { real_t x; diff --git a/core/math/transform.h b/core/math/transform.h index 2704d83a2..079acb735 100644 --- a/core/math/transform.h +++ b/core/math/transform.h @@ -36,8 +36,7 @@ #include "core/math/vector3i.h" #include "core/pool_vector.h" -class _NO_DISCARD_CLASS_ Transform { -public: +struct _NO_DISCARD_CLASS_ Transform { Basis basis; Vector3 origin; diff --git a/core/math/transform_interpolator.h b/core/math/transform_interpolator.h index 11c209ece..f693a9933 100644 --- a/core/math/transform_interpolator.h +++ b/core/math/transform_interpolator.h @@ -45,7 +45,7 @@ // several frames may occur between each physics tick, which will make it cheaper // than performing every frame. -class Transform; +struct Transform; class TransformInterpolator { public: diff --git a/core/math/vector3.h b/core/math/vector3.h index 1cdb4bf39..9139f1c7f 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -33,7 +33,7 @@ #include "core/math/math_funcs.h" #include "core/ustring.h" -class Basis; +struct Basis; struct _NO_DISCARD_CLASS_ Vector3 { static const int AXIS_COUNT = 3; diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index 5f354bc3b..d34ac2c22 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -72,7 +72,7 @@ class Spatial; class SpinBox; class TextureRect; class ToolButton; -class Transform; +struct Transform; class Tree; class TreeItem; class UndoRedo; diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index 40958cf9f..fc3aa24b0 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -77,7 +77,7 @@ class Script; class ScriptCreateDialog; class Texture; class ToolButton; -class Transform; +struct Transform; class UndoRedo; class EditorInterface : public Node { diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 496b9d45b..2726d1144 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -63,7 +63,7 @@ #include "scene/resources/texture.h" class Container; -class Transform; +struct Transform; void InspectorDock::_menu_option(int p_option) { switch (p_option) { diff --git a/editor/inspector_dock.h b/editor/inspector_dock.h index cb2c3ef14..cb44e8788 100644 --- a/editor/inspector_dock.h +++ b/editor/inspector_dock.h @@ -50,7 +50,7 @@ class EditorPath; class LineEdit; class MenuButton; class ToolButton; -class Transform; +struct Transform; class InspectorDock : public VBoxContainer { GDCLASS(InspectorDock, VBoxContainer); diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 3f0911834..f251af26b 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -90,7 +90,7 @@ class LineEdit; class MenuButton; class OptionButton; class PanelContainer; -class Plane; +struct Plane; class PopupMenu; class SkinReference; class TriangleMesh; diff --git a/editor/spatial_editor_gizmos.h b/editor/spatial_editor_gizmos.h index 0db3b89ad..6e17c5e97 100644 --- a/editor/spatial_editor_gizmos.h +++ b/editor/spatial_editor_gizmos.h @@ -50,7 +50,7 @@ class Camera; class Spatial; class Timer; -class Transform; +struct Transform; class Timer; class EditorSpatialGizmo : public SpatialGizmo { diff --git a/servers/visual/portals/portal_renderer.h b/servers/visual/portals/portal_renderer.h index baad9eeaf..5f7af7972 100644 --- a/servers/visual/portals/portal_renderer.h +++ b/servers/visual/portals/portal_renderer.h @@ -42,7 +42,7 @@ #include "portal_tracer.h" #include "portal_types.h" -class Transform; +struct Transform; struct VSStatic { // the lifetime of statics is not strictly monitored like moving objects