diff options
-rw-r--r-- | core/input/input.cpp | 1 | ||||
-rw-r--r-- | core/math/bvh_split.inc | 4 | ||||
-rw-r--r-- | core/math/convex_hull.cpp | 14 | ||||
-rw-r--r-- | core/math/vector2.h | 16 | ||||
-rw-r--r-- | core/math/vector3.h | 8 | ||||
-rw-r--r-- | core/math/vector3i.cpp | 8 | ||||
-rw-r--r-- | core/math/vector3i.h | 4 | ||||
-rw-r--r-- | core/variant/binder_common.h | 3 | ||||
-rw-r--r-- | core/variant/variant_call.cpp | 12 | ||||
-rw-r--r-- | core/variant/variant_internal.h | 10 | ||||
-rw-r--r-- | doc/classes/Input.xml | 11 | ||||
-rw-r--r-- | doc/classes/Vector2.xml | 16 | ||||
-rw-r--r-- | doc/classes/Vector2i.xml | 16 | ||||
-rw-r--r-- | doc/classes/Vector3.xml | 14 | ||||
-rw-r--r-- | doc/classes/Vector3i.xml | 14 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_map_editor.cpp | 2 | ||||
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs | 14 | ||||
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs | 14 | ||||
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs | 14 | ||||
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs | 14 | ||||
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 6 |
21 files changed, 125 insertions, 90 deletions
diff --git a/core/input/input.cpp b/core/input/input.cpp index 342ab3b704..b72d980681 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -103,7 +103,6 @@ void Input::_bind_methods() { ClassDB::bind_method(D_METHOD("get_vector", "negative_x", "positive_x", "negative_y", "positive_y", "deadzone"), &Input::get_vector, DEFVAL(-1.0f)); ClassDB::bind_method(D_METHOD("add_joy_mapping", "mapping", "update_existing"), &Input::add_joy_mapping, DEFVAL(false)); ClassDB::bind_method(D_METHOD("remove_joy_mapping", "guid"), &Input::remove_joy_mapping); - ClassDB::bind_method(D_METHOD("joy_connection_changed", "device", "connected", "name", "guid"), &Input::joy_connection_changed); ClassDB::bind_method(D_METHOD("is_joy_known", "device"), &Input::is_joy_known); ClassDB::bind_method(D_METHOD("get_joy_axis", "device", "axis"), &Input::get_joy_axis); ClassDB::bind_method(D_METHOD("get_joy_name", "device"), &Input::get_joy_name); diff --git a/core/math/bvh_split.inc b/core/math/bvh_split.inc index 6f54d06ce7..f19ee8a7da 100644 --- a/core/math/bvh_split.inc +++ b/core/math/bvh_split.inc @@ -30,8 +30,8 @@ void _split_leaf_sort_groups_simple(int &num_a, int &num_b, uint16_t *group_a, u int order[Point::AXIS_COUNT]; - order[0] = size.min_axis(); - order[Point::AXIS_COUNT - 1] = size.max_axis(); + order[0] = size.min_axis_index(); + order[Point::AXIS_COUNT - 1] = size.max_axis_index(); static_assert(Point::AXIS_COUNT <= 3); if (Point::AXIS_COUNT == 3) { diff --git a/core/math/convex_hull.cpp b/core/math/convex_hull.cpp index 2956e0cf09..6f551319df 100644 --- a/core/math/convex_hull.cpp +++ b/core/math/convex_hull.cpp @@ -606,9 +606,9 @@ private: PagedAllocator<Face> face_pool; LocalVector<Vertex *> original_vertices; int32_t merge_stamp = 0; - int32_t min_axis = 0; - int32_t med_axis = 0; - int32_t max_axis = 0; + Vector3::Axis min_axis = Vector3::Axis::AXIS_X; + Vector3::Axis med_axis = Vector3::Axis::AXIS_X; + Vector3::Axis max_axis = Vector3::Axis::AXIS_X; int32_t used_edge_pairs = 0; int32_t max_used_edge_pairs = 0; @@ -1585,12 +1585,12 @@ void ConvexHullInternal::compute(const Vector3 *p_coords, int32_t p_count) { } Vector3 s = aabb.size; - max_axis = s.max_axis(); - min_axis = s.min_axis(); + max_axis = s.max_axis_index(); + min_axis = s.min_axis_index(); if (min_axis == max_axis) { - min_axis = (max_axis + 1) % 3; + min_axis = Vector3::Axis((max_axis + 1) % 3); } - med_axis = 3 - max_axis - min_axis; + med_axis = Vector3::Axis(3 - max_axis - min_axis); s /= real_t(10216); if (((med_axis + 1) % 3) != max_axis) { diff --git a/core/math/vector2.h b/core/math/vector2.h index 0a7b9d3faf..c0a189e040 100644 --- a/core/math/vector2.h +++ b/core/math/vector2.h @@ -70,12 +70,12 @@ struct Vector2 { x = y = p_value; } - _FORCE_INLINE_ int min_axis() const { - return x < y ? 0 : 1; + _FORCE_INLINE_ Vector2::Axis min_axis_index() const { + return x < y ? Vector2::AXIS_X : Vector2::AXIS_Y; } - _FORCE_INLINE_ int max_axis() const { - return x < y ? 1 : 0; + _FORCE_INLINE_ Vector2::Axis max_axis_index() const { + return x < y ? Vector2::AXIS_Y : Vector2::AXIS_X; } void normalize(); @@ -301,12 +301,12 @@ struct Vector2i { return p_idx ? y : x; } - _FORCE_INLINE_ int min_axis() const { - return x < y ? 0 : 1; + _FORCE_INLINE_ Vector2i::Axis min_axis_index() const { + return x < y ? Vector2i::AXIS_X : Vector2i::AXIS_Y; } - _FORCE_INLINE_ int max_axis() const { - return x < y ? 1 : 0; + _FORCE_INLINE_ Vector2i::Axis max_axis_index() const { + return x < y ? Vector2i::AXIS_Y : Vector2i::AXIS_X; } Vector2i min(const Vector2i &p_vector2i) const { diff --git a/core/math/vector3.h b/core/math/vector3.h index 6c21968aae..c0f80e8f11 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -71,12 +71,12 @@ struct Vector3 { x = y = z = p_value; } - _FORCE_INLINE_ int min_axis() const { - return x < y ? (x < z ? 0 : 2) : (y < z ? 1 : 2); + _FORCE_INLINE_ Vector3::Axis min_axis_index() const { + return x < y ? (x < z ? Vector3::AXIS_X : Vector3::AXIS_Z) : (y < z ? Vector3::AXIS_Y : Vector3::AXIS_Z); } - _FORCE_INLINE_ int max_axis() const { - return x < y ? (y < z ? 2 : 1) : (x < z ? 2 : 0); + _FORCE_INLINE_ Vector3::Axis max_axis_index() const { + return x < y ? (y < z ? Vector3::AXIS_Z : Vector3::AXIS_Y) : (x < z ? Vector3::AXIS_Z : Vector3::AXIS_X); } _FORCE_INLINE_ real_t length() const; diff --git a/core/math/vector3i.cpp b/core/math/vector3i.cpp index d3a57af77c..7812a0b41c 100644 --- a/core/math/vector3i.cpp +++ b/core/math/vector3i.cpp @@ -40,12 +40,12 @@ int32_t Vector3i::get_axis(const int p_axis) const { return operator[](p_axis); } -int Vector3i::min_axis() const { - return x < y ? (x < z ? 0 : 2) : (y < z ? 1 : 2); +Vector3i::Axis Vector3i::min_axis_index() const { + return x < y ? (x < z ? Vector3i::AXIS_X : Vector3i::AXIS_Z) : (y < z ? Vector3i::AXIS_Y : Vector3i::AXIS_Z); } -int Vector3i::max_axis() const { - return x < y ? (y < z ? 2 : 1) : (x < z ? 2 : 0); +Vector3i::Axis Vector3i::max_axis_index() const { + return x < y ? (y < z ? Vector3i::AXIS_Z : Vector3i::AXIS_Y) : (x < z ? Vector3i::AXIS_Z : Vector3i::AXIS_X); } Vector3i Vector3i::clamp(const Vector3i &p_min, const Vector3i &p_max) const { diff --git a/core/math/vector3i.h b/core/math/vector3i.h index 10c28a5bb9..fba29a1f8d 100644 --- a/core/math/vector3i.h +++ b/core/math/vector3i.h @@ -62,8 +62,8 @@ struct Vector3i { void set_axis(const int p_axis, const int32_t p_value); int32_t get_axis(const int p_axis) const; - int min_axis() const; - int max_axis() const; + Vector3i::Axis min_axis_index() const; + Vector3i::Axis max_axis_index() const; _FORCE_INLINE_ void zero(); diff --git a/core/variant/binder_common.h b/core/variant/binder_common.h index 98be62391f..3f9f7e02b2 100644 --- a/core/variant/binder_common.h +++ b/core/variant/binder_common.h @@ -87,7 +87,10 @@ struct VariantCaster<const T &> { // Object enum casts must go here VARIANT_ENUM_CAST(Object::ConnectFlags); +VARIANT_ENUM_CAST(Vector2::Axis); +VARIANT_ENUM_CAST(Vector2i::Axis); VARIANT_ENUM_CAST(Vector3::Axis); +VARIANT_ENUM_CAST(Vector3i::Axis); VARIANT_ENUM_CAST(Basis::EulerOrder); VARIANT_ENUM_CAST(Error); diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index b586757dcd..75f986bdf5 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -1486,6 +1486,8 @@ static void _register_variant_builtin_methods() { bind_method(Vector2, lerp, sarray("to", "weight"), varray()); bind_method(Vector2, slerp, sarray("to", "weight"), varray()); bind_method(Vector2, cubic_interpolate, sarray("b", "pre_a", "post_b", "weight"), varray()); + bind_method(Vector2, max_axis_index, sarray(), varray()); + bind_method(Vector2, min_axis_index, sarray(), varray()); bind_method(Vector2, move_toward, sarray("to", "delta"), varray()); bind_method(Vector2, rotated, sarray("phi"), varray()); bind_method(Vector2, orthogonal, sarray(), varray()); @@ -1508,6 +1510,8 @@ static void _register_variant_builtin_methods() { /* Vector2i */ bind_method(Vector2i, aspect, sarray(), varray()); + bind_method(Vector2i, max_axis_index, sarray(), varray()); + bind_method(Vector2i, min_axis_index, sarray(), varray()); bind_method(Vector2i, sign, sarray(), varray()); bind_method(Vector2i, abs, sarray(), varray()); bind_method(Vector2i, clamp, sarray("min", "max"), varray()); @@ -1547,8 +1551,8 @@ static void _register_variant_builtin_methods() { /* Vector3 */ - bind_method(Vector3, min_axis, sarray(), varray()); - bind_method(Vector3, max_axis, sarray(), varray()); + bind_method(Vector3, min_axis_index, sarray(), varray()); + bind_method(Vector3, max_axis_index, sarray(), varray()); bind_method(Vector3, angle_to, sarray("to"), varray()); bind_method(Vector3, signed_angle_to, sarray("to", "axis"), varray()); bind_method(Vector3, direction_to, sarray("to"), varray()); @@ -1587,8 +1591,8 @@ static void _register_variant_builtin_methods() { /* Vector3i */ - bind_method(Vector3i, min_axis, sarray(), varray()); - bind_method(Vector3i, max_axis, sarray(), varray()); + bind_method(Vector3i, min_axis_index, sarray(), varray()); + bind_method(Vector3i, max_axis_index, sarray(), varray()); bind_method(Vector3i, sign, sarray(), varray()); bind_method(Vector3i, abs, sarray(), varray()); bind_method(Vector3i, clamp, sarray("min", "max"), varray()); diff --git a/core/variant/variant_internal.h b/core/variant/variant_internal.h index 2ba24b5af8..d24f3e90f5 100644 --- a/core/variant/variant_internal.h +++ b/core/variant/variant_internal.h @@ -753,8 +753,14 @@ VARIANT_ACCESSOR_NUMBER(uint32_t) VARIANT_ACCESSOR_NUMBER(int64_t) VARIANT_ACCESSOR_NUMBER(uint64_t) VARIANT_ACCESSOR_NUMBER(char32_t) + +// Bind enums to allow using them as return types. VARIANT_ACCESSOR_NUMBER(Error) VARIANT_ACCESSOR_NUMBER(Side) +VARIANT_ACCESSOR_NUMBER(Vector2::Axis) +VARIANT_ACCESSOR_NUMBER(Vector2i::Axis) +VARIANT_ACCESSOR_NUMBER(Vector3::Axis) +VARIANT_ACCESSOR_NUMBER(Vector3i::Axis) template <> struct VariantInternalAccessor<Basis::EulerOrder> { @@ -1020,6 +1026,10 @@ INITIALIZER_INT(int64_t) INITIALIZER_INT(char32_t) INITIALIZER_INT(Error) INITIALIZER_INT(ObjectID) +INITIALIZER_INT(Vector2::Axis) +INITIALIZER_INT(Vector2i::Axis) +INITIALIZER_INT(Vector3::Axis) +INITIALIZER_INT(Vector3i::Axis) template <> struct VariantInitializer<double> { diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index cd5ba2e17f..068106f2c7 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -243,17 +243,6 @@ Returns [code]true[/code] if you are pressing the key in the physical location on the 101/102-key US QWERTY keyboard. You can pass a [enum Key] constant. </description> </method> - <method name="joy_connection_changed"> - <return type="void" /> - <argument index="0" name="device" type="int" /> - <argument index="1" name="connected" type="bool" /> - <argument index="2" name="name" type="String" /> - <argument index="3" name="guid" type="String" /> - <description> - Notifies the [Input] singleton that a connection has changed, to update the state for the [code]device[/code] index. - This is used internally and should not have to be called from user scripts. See [signal joy_connection_changed] for the signal emitted when this is triggered internally. - </description> - </method> <method name="parse_input_event"> <return type="void" /> <argument index="0" name="event" type="InputEvent" /> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 15f7d2f9e3..49ada66020 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -214,6 +214,18 @@ Returns the vector with a maximum length by limiting its length to [code]length[/code]. </description> </method> + <method name="max_axis_index" qualifiers="const"> + <return type="int" /> + <description> + Returns the axis of the vector's highest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X]. + </description> + </method> + <method name="min_axis_index" qualifiers="const"> + <return type="int" /> + <description> + Returns the axis of the vector's lowest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Y]. + </description> + </method> <method name="move_toward" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="to" type="Vector2" /> @@ -315,10 +327,10 @@ </members> <constants> <constant name="AXIS_X" value="0"> - Enumerated value for the X axis. + Enumerated value for the X axis. Returned by [method max_axis_index] and [method min_axis_index]. </constant> <constant name="AXIS_Y" value="1"> - Enumerated value for the Y axis. + Enumerated value for the Y axis. Returned by [method max_axis_index] and [method min_axis_index]. </constant> <constant name="ZERO" value="Vector2(0, 0)"> Zero vector, a vector with all components set to [code]0[/code]. diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml index 62362409a5..a9334d924f 100644 --- a/doc/classes/Vector2i.xml +++ b/doc/classes/Vector2i.xml @@ -64,6 +64,18 @@ Returns a new vector with all components clamped between the components of [code]min[/code] and [code]max[/code], by running [method @GlobalScope.clamp] on each component. </description> </method> + <method name="max_axis_index" qualifiers="const"> + <return type="int" /> + <description> + Returns the axis of the vector's highest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X]. + </description> + </method> + <method name="min_axis_index" qualifiers="const"> + <return type="int" /> + <description> + Returns the axis of the vector's lowest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Y]. + </description> + </method> <method name="sign" qualifiers="const"> <return type="Vector2i" /> <description> @@ -81,10 +93,10 @@ </members> <constants> <constant name="AXIS_X" value="0"> - Enumerated value for the X axis. + Enumerated value for the X axis. Returned by [method max_axis_index] and [method min_axis_index]. </constant> <constant name="AXIS_Y" value="1"> - Enumerated value for the Y axis. + Enumerated value for the Y axis. Returned by [method max_axis_index] and [method min_axis_index]. </constant> <constant name="ZERO" value="Vector2i(0, 0)"> Zero vector, a vector with all components set to [code]0[/code]. diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index 6d87ce9ea8..5174cec02d 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -184,16 +184,16 @@ Returns the vector with a maximum length by limiting its length to [code]length[/code]. </description> </method> - <method name="max_axis" qualifiers="const"> + <method name="max_axis_index" qualifiers="const"> <return type="int" /> <description> - Returns the axis of the vector's largest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X]. + Returns the axis of the vector's highest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X]. </description> </method> - <method name="min_axis" qualifiers="const"> + <method name="min_axis_index" qualifiers="const"> <return type="int" /> <description> - Returns the axis of the vector's smallest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Z]. + Returns the axis of the vector's lowest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Z]. </description> </method> <method name="move_toward" qualifiers="const"> @@ -321,13 +321,13 @@ </members> <constants> <constant name="AXIS_X" value="0"> - Enumerated value for the X axis. Returned by [method max_axis] and [method min_axis]. + Enumerated value for the X axis. Returned by [method max_axis_index] and [method min_axis_index]. </constant> <constant name="AXIS_Y" value="1"> - Enumerated value for the Y axis. Returned by [method max_axis] and [method min_axis]. + Enumerated value for the Y axis. Returned by [method max_axis_index] and [method min_axis_index]. </constant> <constant name="AXIS_Z" value="2"> - Enumerated value for the Z axis. Returned by [method max_axis] and [method min_axis]. + Enumerated value for the Z axis. Returned by [method max_axis_index] and [method min_axis_index]. </constant> <constant name="ZERO" value="Vector3(0, 0, 0)"> Zero vector, a vector with all components set to [code]0[/code]. diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml index 17febdea83..9b952292b6 100644 --- a/doc/classes/Vector3i.xml +++ b/doc/classes/Vector3i.xml @@ -58,16 +58,16 @@ Returns a new vector with all components clamped between the components of [code]min[/code] and [code]max[/code], by running [method @GlobalScope.clamp] on each component. </description> </method> - <method name="max_axis" qualifiers="const"> + <method name="max_axis_index" qualifiers="const"> <return type="int" /> <description> - Returns the axis of the vector's largest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X]. + Returns the axis of the vector's highest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X]. </description> </method> - <method name="min_axis" qualifiers="const"> + <method name="min_axis_index" qualifiers="const"> <return type="int" /> <description> - Returns the axis of the vector's smallest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Z]. + Returns the axis of the vector's lowest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Z]. </description> </method> <method name="sign" qualifiers="const"> @@ -90,13 +90,13 @@ </members> <constants> <constant name="AXIS_X" value="0"> - Enumerated value for the X axis. + Enumerated value for the X axis. Returned by [method max_axis_index] and [method min_axis_index]. </constant> <constant name="AXIS_Y" value="1"> - Enumerated value for the Y axis. + Enumerated value for the Y axis. Returned by [method max_axis_index] and [method min_axis_index]. </constant> <constant name="AXIS_Z" value="2"> - Enumerated value for the Z axis. + Enumerated value for the Z axis. Returned by [method max_axis_index] and [method min_axis_index]. </constant> <constant name="ZERO" value="Vector3i(0, 0, 0)"> Zero vector, a vector with all components set to [code]0[/code]. diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index 37d52174f9..fd2648a469 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -3786,7 +3786,7 @@ void TileMapEditor::forward_canvas_draw_over_viewport(Control *p_overlay) { } // Draw the warning icon. - int min_axis = missing_tile_texture->get_size().min_axis(); + Vector2::Axis min_axis = missing_tile_texture->get_size().min_axis_index(); Vector2 icon_size; icon_size[min_axis] = tile_set->get_tile_size()[min_axis] / 3; icon_size[(min_axis + 1) % 2] = (icon_size[min_axis] * missing_tile_texture->get_size()[(min_axis + 1) % 2] / missing_tile_texture->get_size()[min_axis]); diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs index 30ecd22db7..1f5282e88f 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs @@ -17,7 +17,7 @@ namespace Godot { /// <summary> /// Enumerated index values for the axes. - /// Returned by <see cref="MaxAxis"/> and <see cref="MinAxis"/>. + /// Returned by <see cref="MaxAxisIndex"/> and <see cref="MinAxisIndex"/>. /// </summary> public enum Axis { @@ -365,21 +365,21 @@ namespace Godot } /// <summary> - /// Returns the axis of the vector's largest value. See <see cref="Axis"/>. + /// Returns the axis of the vector's highest value. See <see cref="Axis"/>. /// If both components are equal, this method returns <see cref="Axis.X"/>. /// </summary> - /// <returns>The index of the largest axis.</returns> - public Axis MaxAxis() + /// <returns>The index of the highest axis.</returns> + public Axis MaxAxisIndex() { return x < y ? Axis.Y : Axis.X; } /// <summary> - /// Returns the axis of the vector's smallest value. See <see cref="Axis"/>. + /// Returns the axis of the vector's lowest value. See <see cref="Axis"/>. /// If both components are equal, this method returns <see cref="Axis.Y"/>. /// </summary> - /// <returns>The index of the smallest axis.</returns> - public Axis MinAxis() + /// <returns>The index of the lowest axis.</returns> + public Axis MinAxisIndex() { return x < y ? Axis.X : Axis.Y; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs index 3bbc2ae2ba..9b51de5c8c 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs @@ -17,7 +17,7 @@ namespace Godot { /// <summary> /// Enumerated index values for the axes. - /// Returned by <see cref="MaxAxis"/> and <see cref="MinAxis"/>. + /// Returned by <see cref="MaxAxisIndex"/> and <see cref="MinAxisIndex"/>. /// </summary> public enum Axis { @@ -218,21 +218,21 @@ namespace Godot } /// <summary> - /// Returns the axis of the vector's largest value. See <see cref="Axis"/>. + /// Returns the axis of the vector's highest value. See <see cref="Axis"/>. /// If both components are equal, this method returns <see cref="Axis.X"/>. /// </summary> - /// <returns>The index of the largest axis.</returns> - public Axis MaxAxis() + /// <returns>The index of the highest axis.</returns> + public Axis MaxAxisIndex() { return x < y ? Axis.Y : Axis.X; } /// <summary> - /// Returns the axis of the vector's smallest value. See <see cref="Axis"/>. + /// Returns the axis of the vector's lowest value. See <see cref="Axis"/>. /// If both components are equal, this method returns <see cref="Axis.Y"/>. /// </summary> - /// <returns>The index of the smallest axis.</returns> - public Axis MinAxis() + /// <returns>The index of the lowest axis.</returns> + public Axis MinAxisIndex() { return x < y ? Axis.X : Axis.Y; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs index 15acf88f62..433a5d9dc9 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs @@ -17,7 +17,7 @@ namespace Godot { /// <summary> /// Enumerated index values for the axes. - /// Returned by <see cref="MaxAxis"/> and <see cref="MinAxis"/>. + /// Returned by <see cref="MaxAxisIndex"/> and <see cref="MinAxisIndex"/>. /// </summary> public enum Axis { @@ -364,21 +364,21 @@ namespace Godot } /// <summary> - /// Returns the axis of the vector's largest value. See <see cref="Axis"/>. + /// Returns the axis of the vector's highest value. See <see cref="Axis"/>. /// If all components are equal, this method returns <see cref="Axis.X"/>. /// </summary> - /// <returns>The index of the largest axis.</returns> - public Axis MaxAxis() + /// <returns>The index of the highest axis.</returns> + public Axis MaxAxisIndex() { return x < y ? (y < z ? Axis.Z : Axis.Y) : (x < z ? Axis.Z : Axis.X); } /// <summary> - /// Returns the axis of the vector's smallest value. See <see cref="Axis"/>. + /// Returns the axis of the vector's lowest value. See <see cref="Axis"/>. /// If all components are equal, this method returns <see cref="Axis.Z"/>. /// </summary> - /// <returns>The index of the smallest axis.</returns> - public Axis MinAxis() + /// <returns>The index of the lowest axis.</returns> + public Axis MinAxisIndex() { return x < y ? (x < z ? Axis.X : Axis.Z) : (y < z ? Axis.Y : Axis.Z); } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs index 562f653fa8..eb06d2b87e 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs @@ -17,7 +17,7 @@ namespace Godot { /// <summary> /// Enumerated index values for the axes. - /// Returned by <see cref="MaxAxis"/> and <see cref="MinAxis"/>. + /// Returned by <see cref="MaxAxisIndex"/> and <see cref="MinAxisIndex"/>. /// </summary> public enum Axis { @@ -186,21 +186,21 @@ namespace Godot } /// <summary> - /// Returns the axis of the vector's largest value. See <see cref="Axis"/>. + /// Returns the axis of the vector's highest value. See <see cref="Axis"/>. /// If all components are equal, this method returns <see cref="Axis.X"/>. /// </summary> - /// <returns>The index of the largest axis.</returns> - public Axis MaxAxis() + /// <returns>The index of the highest axis.</returns> + public Axis MaxAxisIndex() { return x < y ? (y < z ? Axis.Z : Axis.Y) : (x < z ? Axis.Z : Axis.X); } /// <summary> - /// Returns the axis of the vector's smallest value. See <see cref="Axis"/>. + /// Returns the axis of the vector's lowest value. See <see cref="Axis"/>. /// If all components are equal, this method returns <see cref="Axis.Z"/>. /// </summary> - /// <returns>The index of the smallest axis.</returns> - public Axis MinAxis() + /// <returns>The index of the lowest axis.</returns> + public Axis MinAxisIndex() { return x < y ? (x < z ? Axis.X : Axis.Z) : (y < z ? Axis.Y : Axis.Z); } diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index efe23c6102..bdcab49e4e 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -391,7 +391,13 @@ Vector<AudioFrame> AudioStreamPlayer3D::_update_panning() { PhysicsDirectSpaceState3D *space_state = PhysicsServer3D::get_singleton()->space_get_direct_state(world_3d->get_space()); for (Camera3D *camera : cameras) { + if (!camera) { + continue; + } Viewport *vp = camera->get_viewport(); + if (!vp) { + continue; + } if (!vp->is_audio_listener_3d()) { continue; } |