Now all Variant math types are structs.

This commit is contained in:
Relintai 2022-08-16 22:09:26 +02:00
parent e71e3ed897
commit 9e1588160f
16 changed files with 19 additions and 25 deletions

View File

@ -41,8 +41,7 @@
class Variant; class Variant;
class _NO_DISCARD_CLASS_ AABB { struct _NO_DISCARD_CLASS_ AABB {
public:
Vector3 position; Vector3 position;
Vector3 size; Vector3 size;

View File

@ -34,8 +34,7 @@
#include "core/math/vector3.h" #include "core/math/vector3.h"
#include "core/math/vector3i.h" #include "core/math/vector3i.h"
class _NO_DISCARD_CLASS_ Basis { struct _NO_DISCARD_CLASS_ Basis {
public:
Vector3 rows[3] = { Vector3 rows[3] = {
Vector3(1, 0, 0), Vector3(1, 0, 0),
Vector3(0, 1, 0), Vector3(0, 1, 0),

View File

@ -35,8 +35,7 @@
#include "core/math/transform.h" #include "core/math/transform.h"
#include "core/math/vector3.h" #include "core/math/vector3.h"
class _NO_DISCARD_CLASS_ Face3 { struct _NO_DISCARD_CLASS_ Face3 {
public:
enum Side { enum Side {
SIDE_OVER, SIDE_OVER,
SIDE_UNDER, SIDE_UNDER,

View File

@ -34,8 +34,7 @@
class Variant; class Variant;
class _NO_DISCARD_CLASS_ Plane { struct _NO_DISCARD_CLASS_ Plane {
public:
Vector3 normal; Vector3 normal;
real_t d; real_t d;

View File

@ -37,13 +37,13 @@
#include "core/vector.h" #include "core/vector.h"
class Array; class Array;
class AABB; struct AABB;
class Plane; struct Plane;
struct Rect2; struct Rect2;
class Transform; struct Transform;
struct Vector2; struct Vector2;
struct Projection { struct _NO_DISCARD_CLASS_ Projection {
enum Planes { enum Planes {
PLANE_NEAR, PLANE_NEAR,
PLANE_FAR, PLANE_FAR,

View File

@ -35,8 +35,7 @@
#include "core/math/vector3.h" #include "core/math/vector3.h"
#include "core/ustring.h" #include "core/ustring.h"
class _NO_DISCARD_CLASS_ Quaternion { struct _NO_DISCARD_CLASS_ Quaternion {
public:
union { union {
struct { struct {
real_t x; real_t x;

View File

@ -36,8 +36,7 @@
#include "core/math/vector3i.h" #include "core/math/vector3i.h"
#include "core/pool_vector.h" #include "core/pool_vector.h"
class _NO_DISCARD_CLASS_ Transform { struct _NO_DISCARD_CLASS_ Transform {
public:
Basis basis; Basis basis;
Vector3 origin; Vector3 origin;

View File

@ -45,7 +45,7 @@
// several frames may occur between each physics tick, which will make it cheaper // several frames may occur between each physics tick, which will make it cheaper
// than performing every frame. // than performing every frame.
class Transform; struct Transform;
class TransformInterpolator { class TransformInterpolator {
public: public:

View File

@ -33,7 +33,7 @@
#include "core/math/math_funcs.h" #include "core/math/math_funcs.h"
#include "core/ustring.h" #include "core/ustring.h"
class Basis; struct Basis;
struct _NO_DISCARD_CLASS_ Vector3 { struct _NO_DISCARD_CLASS_ Vector3 {
static const int AXIS_COUNT = 3; static const int AXIS_COUNT = 3;

View File

@ -72,7 +72,7 @@ class Spatial;
class SpinBox; class SpinBox;
class TextureRect; class TextureRect;
class ToolButton; class ToolButton;
class Transform; struct Transform;
class Tree; class Tree;
class TreeItem; class TreeItem;
class UndoRedo; class UndoRedo;

View File

@ -77,7 +77,7 @@ class Script;
class ScriptCreateDialog; class ScriptCreateDialog;
class Texture; class Texture;
class ToolButton; class ToolButton;
class Transform; struct Transform;
class UndoRedo; class UndoRedo;
class EditorInterface : public Node { class EditorInterface : public Node {

View File

@ -63,7 +63,7 @@
#include "scene/resources/texture.h" #include "scene/resources/texture.h"
class Container; class Container;
class Transform; struct Transform;
void InspectorDock::_menu_option(int p_option) { void InspectorDock::_menu_option(int p_option) {
switch (p_option) { switch (p_option) {

View File

@ -50,7 +50,7 @@ class EditorPath;
class LineEdit; class LineEdit;
class MenuButton; class MenuButton;
class ToolButton; class ToolButton;
class Transform; struct Transform;
class InspectorDock : public VBoxContainer { class InspectorDock : public VBoxContainer {
GDCLASS(InspectorDock, VBoxContainer); GDCLASS(InspectorDock, VBoxContainer);

View File

@ -90,7 +90,7 @@ class LineEdit;
class MenuButton; class MenuButton;
class OptionButton; class OptionButton;
class PanelContainer; class PanelContainer;
class Plane; struct Plane;
class PopupMenu; class PopupMenu;
class SkinReference; class SkinReference;
class TriangleMesh; class TriangleMesh;

View File

@ -50,7 +50,7 @@
class Camera; class Camera;
class Spatial; class Spatial;
class Timer; class Timer;
class Transform; struct Transform;
class Timer; class Timer;
class EditorSpatialGizmo : public SpatialGizmo { class EditorSpatialGizmo : public SpatialGizmo {

View File

@ -42,7 +42,7 @@
#include "portal_tracer.h" #include "portal_tracer.h"
#include "portal_types.h" #include "portal_types.h"
class Transform; struct Transform;
struct VSStatic { struct VSStatic {
// the lifetime of statics is not strictly monitored like moving objects // the lifetime of statics is not strictly monitored like moving objects