summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml5
-rw-r--r--CHANGELOG.md4
-rw-r--r--core/io/http_client.cpp2
-rw-r--r--core/math/aabb.h4
-rw-r--r--core/math/geometry_3d.cpp2
-rw-r--r--core/math/plane.cpp4
-rw-r--r--core/math/plane.h1
-rw-r--r--core/variant_call.cpp4
-rw-r--r--doc/classes/AABB.xml16
-rw-r--r--doc/classes/AESContext.xml2
-rw-r--r--doc/classes/BaseButton.xml3
-rw-r--r--doc/classes/Basis.xml35
-rw-r--r--doc/classes/Color.xml26
-rw-r--r--doc/classes/OS.xml2
-rw-r--r--doc/classes/Plane.xml29
-rw-r--r--doc/classes/Quat.xml41
-rw-r--r--doc/classes/Rect2.xml7
-rw-r--r--doc/classes/Rect2i.xml7
-rw-r--r--doc/classes/RigidBody3D.xml7
-rw-r--r--doc/classes/Skeleton3D.xml2
-rw-r--r--doc/classes/Transform.xml16
-rw-r--r--doc/classes/Transform2D.xml34
-rw-r--r--doc/classes/Vector2.xml62
-rw-r--r--doc/classes/Vector2i.xml12
-rw-r--r--doc/classes/Vector3.xml67
-rw-r--r--doc/classes/Vector3i.xml16
-rw-r--r--doc/classes/Viewport.xml2
-rw-r--r--doc/classes/VisualShaderNodeOutput.xml2
-rw-r--r--doc/classes/VisualShaderNodeVectorRefract.xml2
-rw-r--r--drivers/vulkan/rendering_device_vulkan.cpp22
-rw-r--r--drivers/vulkan/rendering_device_vulkan.h8
-rw-r--r--drivers/vulkan/vulkan_context.cpp2
-rw-r--r--editor/create_dialog.cpp2
-rw-r--r--editor/editor_node.cpp2
-rw-r--r--editor/import/resource_importer_layered_texture.cpp2
-rw-r--r--editor/plugins/script_editor_plugin.cpp2
-rw-r--r--editor/scene_tree_dock.cpp6
-rw-r--r--modules/gdnative/gdnative/aabb.cpp7
-rw-r--r--modules/gdnative/gdnative/plane.cpp7
-rw-r--r--modules/gdnative/gdnative_api.json14
-rw-r--r--modules/gdnative/include/gdnative/aabb.h2
-rw-r--r--modules/gdnative/include/gdnative/plane.h2
-rw-r--r--modules/gdnative/register_types.cpp2
-rw-r--r--modules/gdscript/doc_classes/@GDScript.xml64
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs2
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs8
-rw-r--r--platform/android/android_keys_utils.h4
-rw-r--r--platform/android/display_server_android.cpp26
-rw-r--r--platform/android/display_server_android.h7
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/GodotGLRenderView.java5
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/GodotRenderView.java4
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/GodotVulkanRenderView.java5
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java29
-rw-r--r--platform/linuxbsd/display_server_x11.cpp4
-rw-r--r--platform/osx/display_server_osx.mm2
-rw-r--r--platform/windows/display_server_windows.cpp2
-rw-r--r--scene/3d/navigation_3d.cpp2
-rw-r--r--scene/3d/physics_body_3d.cpp7
-rw-r--r--scene/3d/physics_body_3d.h3
-rw-r--r--scene/gui/box_container.cpp2
-rw-r--r--scene/resources/texture.cpp2
-rw-r--r--servers/display_server.cpp2
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_effects_rd.cpp2
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_scene_rd.cpp8
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp8
-rw-r--r--servers/rendering/rendering_device_binds.cpp2
66 files changed, 401 insertions, 295 deletions
diff --git a/.travis.yml b/.travis.yml
index 12afc7f48d..cb576efee7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -67,9 +67,10 @@ install:
misc/ci/android-tools-linux.sh;
fi
- if [ "$PLATFORM" = "javascript" ]; then
- git clone --depth 1 --branch 1.39.19 https://github.com/emscripten-core/emsdk;
+ git clone --depth 1 https://github.com/emscripten-core/emsdk;
./emsdk/emsdk install latest;
- ./emsdk/emsdk activate --no-embedded latest;
+ ./emsdk/emsdk activate latest;
+ source ./emsdk/emsdk_env.sh;
fi
before_script:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 15a73f7021..1f8f8bd676 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -217,7 +217,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- This makes it possible to change its value at runtime, rather than just defining it once in the Project Settings.
- `SceneTree.quit()` now accepts an optional argument with an exit code.
- If set to a value greater than or equal to 0, it will override the `OS.exit_code` property.
-- `VisualServer.get_video_adapter_name()` and `VisualServer.get_video_adapter_vendor()` methods to retreive the user's graphics card model and vendor.
+- `VisualServer.get_video_adapter_name()` and `VisualServer.get_video_adapter_vendor()` methods to retrieve the user's graphics card model and vendor.
- `VisualServer.multimesh_create()` is now exposed to scripting.
- Ability to override how scripted objects are converted to strings by defining a `_to_string()` method.
- Export hints for 2D and 3D physics/render layers.
@@ -885,7 +885,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `editor` and `standalone` feature tags to check whether the project is running from an editor or non-editor binary.
- `android_add_asset_dir("...")` method to Android module Gradle build configuration.
- **iOS:** Support for exporting to the iPhone X.
-- **iOS:** Readded support for in-app purchases.
+- **iOS:** Re-added support for in-app purchases.
### Changed
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index 40debae9e5..46e45500bf 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -451,7 +451,7 @@ Error HTTPClient::poll() {
}
}
- // This is a HEAD request, we wont receive anything.
+ // This is a HEAD request, we won't receive anything.
if (head_request) {
body_size = 0;
body_left = 0;
diff --git a/core/math/aabb.h b/core/math/aabb.h
index 4106fbb93c..bd1f3a1a36 100644
--- a/core/math/aabb.h
+++ b/core/math/aabb.h
@@ -99,6 +99,10 @@ public:
_FORCE_INLINE_ void project_range_in_plane(const Plane &p_plane, real_t &r_min, real_t &r_max) const;
_FORCE_INLINE_ void expand_to(const Vector3 &p_vector); /** expand to contain a point if necessary */
+ _FORCE_INLINE_ AABB abs() const {
+ return AABB(Vector3(position.x + MIN(size.x, 0), position.y + MIN(size.y, 0), position.z + MIN(size.z, 0)), size.abs());
+ }
+
operator String() const;
_FORCE_INLINE_ AABB() {}
diff --git a/core/math/geometry_3d.cpp b/core/math/geometry_3d.cpp
index 7807ab19a7..2c19fe2085 100644
--- a/core/math/geometry_3d.cpp
+++ b/core/math/geometry_3d.cpp
@@ -648,7 +648,7 @@ Geometry3D::MeshData Geometry3D::build_convex_mesh(const Vector<Plane> &p_planes
Vector<Vector3> vertices;
- Vector3 center = p.get_any_point();
+ Vector3 center = p.center();
// make a quad clockwise
vertices.push_back(center - up * subplane_size + right * subplane_size);
vertices.push_back(center - up * subplane_size - right * subplane_size);
diff --git a/core/math/plane.cpp b/core/math/plane.cpp
index df37ceb0e5..4200484c59 100644
--- a/core/math/plane.cpp
+++ b/core/math/plane.cpp
@@ -52,10 +52,6 @@ Plane Plane::normalized() const {
return p;
}
-Vector3 Plane::get_any_point() const {
- return get_normal() * d;
-}
-
Vector3 Plane::get_any_perpendicular_normal() const {
static const Vector3 p1 = Vector3(1, 0, 0);
static const Vector3 p2 = Vector3(0, 1, 0);
diff --git a/core/math/plane.h b/core/math/plane.h
index 9a3e5a485f..70a6111edd 100644
--- a/core/math/plane.h
+++ b/core/math/plane.h
@@ -47,7 +47,6 @@ public:
/* Plane-Point operations */
_FORCE_INLINE_ Vector3 center() const { return normal * d; }
- Vector3 get_any_point() const;
Vector3 get_any_perpendicular_normal() const;
_FORCE_INLINE_ bool is_point_over(const Vector3 &p_point) const; ///< Point is over plane
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 0aa1339401..8afa24e63d 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -455,7 +455,6 @@ struct _VariantCall {
VCALL_LOCALMEM0R(Plane, normalized);
VCALL_LOCALMEM0R(Plane, center);
- VCALL_LOCALMEM0R(Plane, get_any_point);
VCALL_LOCALMEM1R(Plane, is_equal_approx);
VCALL_LOCALMEM1R(Plane, is_point_over);
VCALL_LOCALMEM1R(Plane, distance_to);
@@ -843,6 +842,7 @@ struct _VariantCall {
#define VCALL_PTR5R(m_type, m_method) \
static void _call_##m_type##_##m_method(Variant &r_ret, Variant &p_self, const Variant **p_args) { r_ret = reinterpret_cast<m_type *>(p_self._data._ptr)->m_method(*p_args[0], *p_args[1], *p_args[2], *p_args[3], *p_args[4]); }
+ VCALL_PTR0R(AABB, abs);
VCALL_PTR0R(AABB, get_area);
VCALL_PTR0R(AABB, has_no_area);
VCALL_PTR0R(AABB, has_no_surface);
@@ -1980,7 +1980,6 @@ void register_variant_methods() {
ADDFUNC0R(PLANE, PLANE, Plane, normalized, varray());
ADDFUNC0R(PLANE, VECTOR3, Plane, center, varray());
- ADDFUNC0R(PLANE, VECTOR3, Plane, get_any_point, varray());
ADDFUNC1R(PLANE, BOOL, Plane, is_equal_approx, PLANE, "plane", varray());
ADDFUNC1R(PLANE, BOOL, Plane, is_point_over, VECTOR3, "point", varray());
ADDFUNC1R(PLANE, FLOAT, Plane, distance_to, VECTOR3, "point", varray());
@@ -2220,6 +2219,7 @@ void register_variant_methods() {
//pointerbased
+ ADDFUNC0R(AABB, AABB, AABB, abs, varray());
ADDFUNC0R(AABB, FLOAT, AABB, get_area, varray());
ADDFUNC0R(AABB, BOOL, AABB, has_no_area, varray());
ADDFUNC0R(AABB, BOOL, AABB, has_no_surface, varray());
diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml
index 3f2f27d121..ae80abc5d2 100644
--- a/doc/classes/AABB.xml
+++ b/doc/classes/AABB.xml
@@ -18,7 +18,14 @@
<argument index="1" name="size" type="Vector3">
</argument>
<description>
- Optional constructor, accepts position and size.
+ Constructs an [AABB] from a position and size.
+ </description>
+ </method>
+ <method name="abs">
+ <return type="AABB">
+ </return>
+ <description>
+ Returns an AABB with equivalent position and size, modified so that the most-negative corner is the origin and the size is positive.
</description>
</method>
<method name="encloses">
@@ -197,13 +204,14 @@
</methods>
<members>
<member name="end" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
- Ending corner. This is calculated as [code]position + size[/code]. Changing this property changes [member size] accordingly.
+ Ending corner. This is calculated as [code]position + size[/code]. Setting this value will change the size.
</member>
<member name="position" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
- Beginning corner.
+ Beginning corner. Typically has values lower than [member end].
</member>
<member name="size" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
- Size from position to end.
+ Size from [member position] to [member end]. Typically all components are positive.
+ If the size is negative, you can use [method abs] to fix it.
</member>
</members>
<constants>
diff --git a/doc/classes/AESContext.xml b/doc/classes/AESContext.xml
index ab4d0e0bc3..ff433370bd 100644
--- a/doc/classes/AESContext.xml
+++ b/doc/classes/AESContext.xml
@@ -51,7 +51,7 @@
<return type="PackedByteArray">
</return>
<description>
- Get the current IV state for this context (IV gets updated when calling [method update]). You normally don't need this funciton.
+ Get the current IV state for this context (IV gets updated when calling [method update]). You normally don't need this function.
Note: This function only makes sense when the context is started with [constant MODE_CBC_ENCRYPT] or [constant MODE_CBC_DECRYPT].
</description>
</method>
diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml
index 5e908b0e53..3812b45b13 100644
--- a/doc/classes/BaseButton.xml
+++ b/doc/classes/BaseButton.xml
@@ -13,7 +13,7 @@
<return type="void">
</return>
<description>
- Called when the button is pressed.
+ Called when the button is pressed. If you need to know the button's pressed state (and [member toggle_mode] is active), use [method _toggled] instead.
</description>
</method>
<method name="_toggled" qualifiers="virtual">
@@ -89,6 +89,7 @@
<signal name="pressed">
<description>
Emitted when the button is toggled or pressed. This is on [signal button_down] if [member action_mode] is [constant ACTION_MODE_BUTTON_PRESS] and on [signal button_up] otherwise.
+ If you need to know the button's pressed state (and [member toggle_mode] is active), use [signal toggled] instead.
</description>
</signal>
<signal name="toggled">
diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml
index 3952ea2d27..47433d7adc 100644
--- a/doc/classes/Basis.xml
+++ b/doc/classes/Basis.xml
@@ -4,10 +4,13 @@
3×3 matrix datatype.
</brief_description>
<description>
- 3×3 matrix used for 3D rotation and scale. Contains 3 vector fields X, Y and Z as its columns, which can be interpreted as the local basis vectors of a transformation. Can also be accessed as array of 3D vectors. These vectors are orthogonal to each other, but are not necessarily normalized (due to scaling). Almost always used as an orthogonal basis for a [Transform].
- For such use, it is composed of a scaling and a rotation matrix, in that order (M = R.S).
+ 3×3 matrix used for 3D rotation and scale. Almost always used as an orthogonal basis for a Transform.
+ Contains 3 vector fields X, Y and Z as its columns, which are typically interpreted as the local basis vectors of a transformation. For such use, it is composed of a scaling and a rotation matrix, in that order (M = R.S).
+ Can also be accessed as array of 3D vectors. These vectors are normally orthogonal to each other, but are not necessarily normalized (due to scaling).
+ For more information, read the "Matrices and transforms" documentation article.
</description>
<tutorials>
+ <link>https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link>
<link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link>
</tutorials>
<methods>
@@ -17,7 +20,7 @@
<argument index="0" name="from" type="Quat">
</argument>
<description>
- Create a rotation matrix from the given quaternion.
+ Constructs a pure rotation basis matrix from the given quaternion.
</description>
</method>
<method name="Basis">
@@ -26,7 +29,8 @@
<argument index="0" name="from" type="Vector3">
</argument>
<description>
- Create a rotation matrix (in the YXZ convention: first Z, then X, and Y last) from the specified Euler angles, given in the vector format as (X angle, Y angle, Z angle).
+ Constructs a pure rotation basis matrix from the given Euler angles (in the YXZ convention: when *composing*, first Y, then X, and Z last), given in the vector format as (X angle, Y angle, Z angle).
+ Consider using the [Quat] constructor instead, which uses a quaternion instead of Euler angles.
</description>
</method>
<method name="Basis">
@@ -37,7 +41,7 @@
<argument index="1" name="phi" type="float">
</argument>
<description>
- Create a rotation matrix which rotates around the given axis by the specified angle, in radians. The axis must be a normalized vector.
+ Constructs a pure rotation basis matrix, rotated around the given [code]axis[/code] by [code]phi[/code], in radians. The axis must be a normalized vector.
</description>
</method>
<method name="Basis">
@@ -50,28 +54,30 @@
<argument index="2" name="z_axis" type="Vector3">
</argument>
<description>
- Create a matrix from 3 axis vectors.
+ Constructs a basis matrix from 3 axis vectors (matrix columns).
</description>
</method>
<method name="determinant">
<return type="float">
</return>
<description>
- Returns the determinant of the matrix.
+ Returns the determinant of the basis matrix. If the basis is uniformly scaled, its determinant is the square of the scale.
+ A negative determinant means the basis has a negative scale. A zero determinant means the basis isn't invertible, and is usually considered invalid.
</description>
</method>
<method name="get_euler">
<return type="Vector3">
</return>
<description>
- Returns the basis's rotation in the form of Euler angles (in the YXZ convention: first Z, then X, and Y last). The returned vector contains the rotation angles in the format (X angle, Y angle, Z angle). See [method get_rotation_quat] if you need a quaternion instead.
+ Returns the basis's rotation in the form of Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last). The returned vector contains the rotation angles in the format (X angle, Y angle, Z angle).
+ Consider using the [method get_rotation_quat] method instead, which returns a [Quat] quaternion instead of Euler angles.
</description>
</method>
<method name="get_orthogonal_index">
<return type="int">
</return>
<description>
- This function considers a discretization of rotations into 24 points on unit sphere, lying along the vectors (x,y,z) with each component being either -1, 0, or 1, and returns the index of the point best representing the orientation of the object. It is mainly used by the grid map editor. For further details, refer to the Godot source code.
+ This function considers a discretization of rotations into 24 points on unit sphere, lying along the vectors (x,y,z) with each component being either -1, 0, or 1, and returns the index of the point best representing the orientation of the object. It is mainly used by the [GridMap] editor. For further details, refer to the Godot source code.
</description>
</method>
<method name="get_rotation_quat">
@@ -193,25 +199,26 @@
<argument index="0" name="v" type="Vector3">
</argument>
<description>
- Returns a vector transformed (multiplied) by the transposed matrix.
+ Returns a vector transformed (multiplied) by the transposed basis matrix.
[b]Note:[/b] This results in a multiplication by the inverse of the matrix only if it represents a rotation-reflection.
</description>
</method>
</methods>
<members>
<member name="x" type="Vector3" setter="" getter="" default="Vector3( 1, 0, 0 )">
- The basis matrix's X vector.
+ The basis matrix's X vector (column 0). Equivalent to array index [code]0[/code].
</member>
<member name="y" type="Vector3" setter="" getter="" default="Vector3( 0, 1, 0 )">
- The basis matrix's Y vector.
+ The basis matrix's Y vector (column 1). Equivalent to array index [code]1[/code].
</member>
<member name="z" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 1 )">
- The basis matrix's Z vector.
+ The basis matrix's Z vector (column 2). Equivalent to array index [code]2[/code].
</member>
</members>
<constants>
<constant name="IDENTITY" value="Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )">
- The identity basis. This is identical to calling [code]Basis()[/code] without any parameters. This constant can be used to make your code clearer.
+ The identity basis, with no rotation or scaling applied.
+ This is identical to calling [code]Basis()[/code] without any parameters. This constant can be used to make your code clearer, and for consistency with C#.
</constant>
<constant name="FLIP_X" value="Basis( -1, 0, 0, 0, 1, 0, 0, 0, 1 )">
The basis that will flip something along the X axis when used in a transformation.
diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml
index 17b474531e..240e70db9f 100644
--- a/doc/classes/Color.xml
+++ b/doc/classes/Color.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Color" version="4.0">
<brief_description>
- Color in RGBA format with some support for ARGB format.
+ Color in RGBA format using floats on the range of 0 to 1.
</brief_description>
<description>
- A color is represented by red, green, and blue [code](r, g, b)[/code] components. Additionally, [code]a[/code] represents the alpha component, often used for transparency. Values are in floating-point and usually range from 0 to 1. Some properties (such as [member CanvasItem.modulate]) may accept values greater than 1.
+ A color represented by red, green, blue, and alpha (RGBA) components. The alpha component is often used for transparency. Values are in floating-point and usually range from 0 to 1. Some properties (such as CanvasItem.modulate) may accept values greater than 1 (overbright or HDR colors).
You can also create a color from standardized color names by using [method @GDScript.ColorN] or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url].
If you want to supply values in a range of 0 to 255, you should use [method @GDScript.Color8].
[b]Note:[/b] In a boolean context, a Color will evaluate to [code]false[/code] if it's equal to [code]Color(0, 0, 0, 1)[/code] (opaque black). Otherwise, a Color will always evaluate to [code]true[/code].
@@ -277,37 +277,37 @@
</methods>
<members>
<member name="a" type="float" setter="" getter="" default="1.0">
- Alpha value (range 0 to 1).
+ The color's alpha (transparency) component, typically on the range of 0 to 1.
</member>
<member name="a8" type="int" setter="" getter="" default="255">
- Alpha value (range 0 to 255).
+ Wrapper for [member a] that uses the range 0 to 255 instead of 0 to 1.
</member>
<member name="b" type="float" setter="" getter="" default="0.0">
- Blue value (range 0 to 1).
+ The color's blue component, typically on the range of 0 to 1.
</member>
<member name="b8" type="int" setter="" getter="" default="0">
- Blue value (range 0 to 255).
+ Wrapper for [member b] that uses the range 0 to 255 instead of 0 to 1.
</member>
<member name="g" type="float" setter="" getter="" default="0.0">
- Green value (range 0 to 1).
+ The color's green component, typically on the range of 0 to 1.
</member>
<member name="g8" type="int" setter="" getter="" default="0">
- Green value (range 0 to 255).
+ Wrapper for [member g] that uses the range 0 to 255 instead of 0 to 1.
</member>
<member name="h" type="float" setter="" getter="" default="0.0">
- HSV hue value (range 0 to 1).
+ The HSV hue of this color, on the range 0 to 1.
</member>
<member name="r" type="float" setter="" getter="" default="0.0">
- Red value (range 0 to 1).
+ The color's red component, typically on the range of 0 to 1.
</member>
<member name="r8" type="int" setter="" getter="" default="0">
- Red value (range 0 to 255).
+ Wrapper for [member r] that uses the range 0 to 255 instead of 0 to 1.
</member>
<member name="s" type="float" setter="" getter="" default="0.0">
- HSV saturation value (range 0 to 1).
+ The HSV saturation of this color, on the range 0 to 1.
</member>
<member name="v" type="float" setter="" getter="" default="0.0">
- HSV value (range 0 to 1).
+ The HSV value (brightness) of this color, on the range 0 to 1.
</member>
</members>
<constants>
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 238bc970ef..5b4b5d02fb 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -516,7 +516,7 @@
The amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage.
</member>
<member name="tablet_driver" type="String" setter="set_current_tablet_driver" getter="get_current_tablet_driver" default="&quot;&quot;">
- The current tablet drvier in use.
+ The current tablet driver in use.
</member>
</members>
<constants>
diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml
index 292acd8b5d..ce0680523c 100644
--- a/doc/classes/Plane.xml
+++ b/doc/classes/Plane.xml
@@ -65,13 +65,6 @@
Returns the shortest distance from the plane to the position [code]point[/code].
</description>
</method>
- <method name="get_any_point">
- <return type="Vector3">
- </return>
- <description>
- Returns a point on the plane.
- </description>
- </method>
<method name="has_point">
<return type="bool">
</return>
@@ -80,7 +73,7 @@
<argument index="1" name="epsilon" type="float" default="1e-05">
</argument>
<description>
- Returns [code]true[/code] if [code]point[/code] is inside the plane (by a very minimum [code]epsilon[/code] threshold).
+ Returns [code]true[/code] if [code]point[/code] is inside the plane. Comparison uses a custom minimum [code]epsilon[/code] threshold.
</description>
</method>
<method name="intersect_3">
@@ -147,36 +140,38 @@
<argument index="0" name="point" type="Vector3">
</argument>
<description>
- Returns the orthogonal projection of point [code]p[/code] into a point in the plane.
+ Returns the orthogonal projection of [code]point[/code] into a point in the plane.
</description>
</method>
</methods>
<members>
<member name="d" type="float" setter="" getter="" default="0.0">
- Distance from the origin to the plane, in the direction of [member normal].
+ The distance from the origin to the plane, in the direction of [member normal]. This value is typically non-negative.
+ In the scalar equation of the plane [code]ax + by + cz = d[/code], this is [code]d[/code], while the [code](a, b, c)[/code] coordinates are represented by the [member normal] property.
</member>
<member name="normal" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
- The normal of the plane. "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing.
+ The normal of the plane, which must be normalized.
+ In the scalar equation of the plane [code]ax + by + cz = d[/code], this is the vector [code](a, b, c)[/code], where [code]d[/code] is the [member d] property.
</member>
<member name="x" type="float" setter="" getter="" default="0.0">
- The [member normal]'s X component.
+ The X component of the plane's [member normal] vector.
</member>
<member name="y" type="float" setter="" getter="" default="0.0">
- The [member normal]'s Y component.
+ The Y component of the plane's [member normal] vector.
</member>
<member name="z" type="float" setter="" getter="" default="0.0">
- The [member normal]'s Z component.
+ The Z component of the plane's [member normal] vector.
</member>
</members>
<constants>
<constant name="PLANE_YZ" value="Plane( 1, 0, 0, 0 )">
- A plane that extends in the Y and Z axes.
+ A plane that extends in the Y and Z axes (normal vector points +X).
</constant>
<constant name="PLANE_XZ" value="Plane( 0, 1, 0, 0 )">
- A plane that extends in the X and Z axes.
+ A plane that extends in the X and Z axes (normal vector points +Y).
</constant>
<constant name="PLANE_XY" value="Plane( 0, 0, 1, 0 )">
- A plane that extends in the X and Y axes.
+ A plane that extends in the X and Y axes (normal vector points +Z).
</constant>
</constants>
</class>
diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml
index 327fa882e5..730edb00d9 100644
--- a/doc/classes/Quat.xml
+++ b/doc/classes/Quat.xml
@@ -4,9 +4,9 @@
Quaternion.
</brief_description>
<description>
- A unit quaternion used for representing 3D rotations.
- It is similar to [Basis], which implements matrix representation of rotations, and can be parametrized using both an axis-angle pair or Euler angles. But due to its compactness and the way it is stored in memory, certain operations (obtaining axis-angle and performing SLERP, in particular) are more efficient and robust against floating-point errors.
- Quaternions need to be (re)normalized.
+ A unit quaternion used for representing 3D rotations. Quaternions need to be normalized to be used for rotation.
+ It is similar to Basis, which implements matrix representation of rotations, and can be parametrized using both an axis-angle pair or Euler angles. Basis stores rotation, scale, and shearing, while Quat only stores rotation.
+ Due to its compactness and the way it is stored in memory, certain operations (obtaining axis-angle and performing SLERP, in particular) are more efficient and robust against floating-point errors.
</description>
<tutorials>
<link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html#interpolating-with-quaternions</link>
@@ -18,7 +18,7 @@
<argument index="0" name="from" type="Basis">
</argument>
<description>
- Returns the rotation matrix corresponding to the given quaternion.
+ Constructs a quaternion from the given [Basis].
</description>
</method>
<method name="Quat">
@@ -27,7 +27,7 @@
<argument index="0" name="euler" type="Vector3">
</argument>
<description>
- Returns a quaternion that will perform a rotation specified by Euler angles (in the YXZ convention: first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle).
+ Constructs a quaternion that will perform a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle).
</description>
</method>
<method name="Quat">
@@ -38,7 +38,7 @@
<argument index="1" name="angle" type="float">
</argument>
<description>
- Returns a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector.
+ Constructs a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector.
</description>
</method>
<method name="Quat">
@@ -53,7 +53,7 @@
<argument index="3" name="w" type="float">
</argument>
<description>
- Returns a quaternion defined by these values.
+ Constructs a quaternion defined by the given values.
</description>
</method>
<method name="cubic_slerp">
@@ -68,7 +68,7 @@
<argument index="3" name="t" type="float">
</argument>
<description>
- Performs a cubic spherical-linear interpolation with another quaternion.
+ Performs a cubic spherical interpolation between quaternions [code]preA[/code], this vector, [code]b[/code], and [code]postB[/code], by the given amount [code]t[/code].
</description>
</method>
<method name="dot">
@@ -84,7 +84,7 @@
<return type="Vector3">
</return>
<description>
- Returns Euler angles (in the YXZ convention: first Z, then X, and Y last) corresponding to the rotation represented by the unit quaternion. Returned vector contains the rotation angles in the format (X angle, Y angle, Z angle).
+ Returns Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last) corresponding to the rotation represented by the unit quaternion. Returned vector contains the rotation angles in the format (X angle, Y angle, Z angle).
</description>
</method>
<method name="inverse">
@@ -148,7 +148,7 @@
<argument index="0" name="euler" type="Vector3">
</argument>
<description>
- Sets the quaternion to a rotation specified by Euler angles (in the YXZ convention: first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle).
+ Sets the quaternion to a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle).
</description>
</method>
<method name="slerp">
@@ -159,7 +159,8 @@
<argument index="1" name="t" type="float">
</argument>
<description>
- Performs a spherical-linear interpolation with another quaternion.
+ Returns the result of the spherical linear interpolation between this quaternion and [code]to[/code] by amount [code]weight[/code].
+ [b]Note:[/b] Both quaternions must be normalized.
</description>
</method>
<method name="slerpni">
@@ -170,7 +171,7 @@
<argument index="1" name="t" type="float">
</argument>
<description>
- Performs a spherical-linear interpolation with another quaterion without checking if the rotation path is not bigger than 90°.
+ Returns the result of the spherical linear interpolation between this quaternion and [code]to[/code] by amount [code]weight[/code], but without checking if the rotation path is not bigger than 90 degrees.
</description>
</method>
<method name="xform">
@@ -179,27 +180,31 @@
<argument index="0" name="v" type="Vector3">
</argument>
<description>
- Transforms the vector [code]v[/code] by this quaternion.
+ Returns a vector transformed (multiplied) by this quaternion.
</description>
</method>
</methods>
<members>
<member name="w" type="float" setter="" getter="" default="1.0">
- W component of the quaternion.
+ W component of the quaternion (real part).
+ Quaternion components should usually not be manipulated directly.
</member>
<member name="x" type="float" setter="" getter="" default="0.0">
- X component of the quaternion.
+ X component of the quaternion (imaginary [code]i[/code] axis part).
+ Quaternion components should usually not be manipulated directly.
</member>
<member name="y" type="float" setter="" getter="" default="0.0">
- Y component of the quaternion.
+ Y component of the quaternion (imaginary [code]j[/code] axis part).
+ Quaternion components should usually not be manipulated directly.
</member>
<member name="z" type="float" setter="" getter="" default="0.0">
- Z component of the quaternion.
+ Z component of the quaternion (imaginary [code]k[/code] axis part).
+ Quaternion components should usually not be manipulated directly.
</member>
</members>
<constants>
<constant name="IDENTITY" value="Quat( 0, 0, 0, 1 )">
- The identity rotation. Equivalent to an identity matrix. If a vector is transformed by an identity quaternion, it will not change.
+ The identity quaternion, representing no rotation. Equivalent to an identity [Basis] matrix. If a vector is transformed by an identity quaternion, it will not change.
</constant>
</constants>
</class>
diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml
index dbf461cdf1..8599aad95e 100644
--- a/doc/classes/Rect2.xml
+++ b/doc/classes/Rect2.xml
@@ -171,13 +171,14 @@
</methods>
<members>
<member name="end" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )">
- Ending corner.
+ Ending corner. This is calculated as [code]position + size[/code]. Setting this value will change the size.
</member>
<member name="position" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )">
- Position (starting corner).
+ Beginning corner. Typically has values lower than [member end].
</member>
<member name="size" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )">
- Size from position to end.
+ Size from [member position] to [member end]. Typically all components are positive.
+ If the size is negative, you can use [method abs] to fix it.
</member>
</members>
<constants>
diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml
index f3a7ba0476..7362580c02 100644
--- a/doc/classes/Rect2i.xml
+++ b/doc/classes/Rect2i.xml
@@ -160,13 +160,14 @@
</methods>
<members>
<member name="end" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )">
- Ending corner.
+ Ending corner. This is calculated as [code]position + size[/code]. Setting this value will change the size.
</member>
<member name="position" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )">
- Position (starting corner).
+ Beginning corner. Typically has values lower than [member end].
</member>
<member name="size" type="Vector2i" setter="" getter="" default="Vector2i( 0, 0 )">
- Size from position to end.
+ Size from [member position] to [member end]. Typically all components are positive.
+ If the size is negative, you can use [method abs] to fix it.
</member>
</members>
<constants>
diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml
index efd55f5566..370e6bd19c 100644
--- a/doc/classes/RigidBody3D.xml
+++ b/doc/classes/RigidBody3D.xml
@@ -100,6 +100,13 @@
[b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead.
</description>
</method>
+ <method name="get_inverse_inertia_tensor">
+ <return type="Basis">
+ </return>
+ <description>
+ Returns the inverse inertia tensor basis. This is used to calculate the angular acceleration resulting from a torque applied to the [RigidBody3D].
+ </description>
+ </method>
<method name="set_axis_lock">
<return type="void">
</return>
diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml
index 183fd5396f..050d7056af 100644
--- a/doc/classes/Skeleton3D.xml
+++ b/doc/classes/Skeleton3D.xml
@@ -239,7 +239,7 @@
</argument>
<description>
Sets the global pose transform, [code]pose[/code], for the bone at [code]bone_idx[/code].
- [code]amount[/code] is the interpolation strengh that will be used when applying the pose, and [code]persistent[/code] determines if the applied pose will remain.
+ [code]amount[/code] is the interpolation strength that will be used when applying the pose, and [code]persistent[/code] determines if the applied pose will remain.
[b]Note[/b]: The pose transform needs to be in bone space. Use [method world_transform_to_bone_transform] to convert a world transform, like one you can get from a [Node3D], to bone space.
</description>
</method>
diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml
index 4175f01eb4..26c190bfa9 100644
--- a/doc/classes/Transform.xml
+++ b/doc/classes/Transform.xml
@@ -4,10 +4,12 @@
3D transformation (3×4 matrix).
</brief_description>
<description>
- Represents one or many transformations in 3D space such as translation, rotation, or scaling. It consists of a [member basis] and an [member origin]. It is similar to a 3×4 matrix.
+ 3×4 matrix (3 rows, 4 columns) used for 3D linear transformations. It can represent transformations such as translation, rotation, or scaling. It consists of a [member basis] (first 3 columns) and a [Vector3] for the [member origin] (last column).
+ For more information, read the "Matrices and transforms" documentation article.
</description>
<tutorials>
<link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
+ <link>https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link>
<link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link>
</tutorials>
<methods>
@@ -23,7 +25,7 @@
<argument index="3" name="origin" type="Vector3">
</argument>
<description>
- Constructs the Transform from four [Vector3]. Each axis corresponds to local basis vectors (some of which may be scaled).
+ Constructs a Transform from four [Vector3] values (matrix columns). Each axis corresponds to local basis vectors (some of which may be scaled).
</description>
</method>
<method name="Transform">
@@ -34,7 +36,7 @@
<argument index="1" name="origin" type="Vector3">
</argument>
<description>
- Constructs the Transform from a [Basis] and [Vector3].
+ Constructs a Transform from a [Basis] and [Vector3].
</description>
</method>
<method name="Transform">
@@ -43,7 +45,7 @@
<argument index="0" name="from" type="Transform2D">
</argument>
<description>
- Constructs the Transform from a [Transform2D].
+ Constructs a Transform from a [Transform2D].
</description>
</method>
<method name="Transform">
@@ -52,7 +54,7 @@
<argument index="0" name="from" type="Quat">
</argument>
<description>
- Constructs the Transform from a [Quat]. The origin will be Vector3(0, 0, 0).
+ Constructs a Transform from a [Quat]. The origin will be [code]Vector3(0, 0, 0)[/code].
</description>
</method>
<method name="Transform">
@@ -79,7 +81,7 @@
<argument index="1" name="weight" type="float">
</argument>
<description>
- Interpolates the transform to other Transform by weight amount (0-1).
+ Interpolates the transform to other Transform by weight amount (on the range of 0.0 to 1.0).
</description>
</method>
<method name="inverse">
@@ -172,7 +174,7 @@
The basis is a matrix containing 3 [Vector3] as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object.
</member>
<member name="origin" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
- The translation offset of the transform.
+ The translation offset of the transform (column 3, the fourth column). Equivalent to array index [code]3[/code].
</member>
</members>
<constants>
diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml
index af93d4c654..f630df7afe 100644
--- a/doc/classes/Transform2D.xml
+++ b/doc/classes/Transform2D.xml
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Transform2D" version="4.0">
<brief_description>
- 2D transformation (3×2 matrix).
+ 2D transformation (2×3 matrix).
</brief_description>
<description>
- Represents one or many transformations in 2D space such as translation, rotation, or scaling. It consists of two [member x] and [member y] [Vector2]s and an [member origin]. It is similar to a 3×2 matrix.
+ 2×3 matrix (2 rows, 3 columns) used for 2D linear transformations. It can represent transformations such as translation, rotation, or scaling. It consists of a three [Vector2] values: [member x], [member y], and the [member origin].
+ For more information, read the "Matrices and transforms" documentation article.
</description>
<tutorials>
+ <link>https://docs.godotengine.org/en/latest/tutorials/math/matrices_and_transforms.html</link>
</tutorials>
<methods>
<method name="Transform2D">
@@ -28,7 +30,7 @@
<argument index="2" name="origin" type="Vector2">
</argument>
<description>
- Constructs the transform from 3 [Vector2]s representing x, y, and origin.
+ Constructs the transform from 3 [Vector2] values representing [member x], [member y], and the [member origin] (the three column vectors).
</description>
</method>
<method name="Transform2D">
@@ -46,7 +48,7 @@
<return type="Transform2D">
</return>
<description>
- Returns the inverse of the matrix.
+ Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling and translation.
</description>
</method>
<method name="basis_xform">
@@ -55,7 +57,8 @@
<argument index="0" name="v" type="Vector2">
</argument>
<description>
- Transforms the given vector by this transform's basis (no translation).
+ Returns a vector transformed (multiplied) by the basis matrix.
+ This method does not account for translation (the origin vector).
</description>
</method>
<method name="basis_xform_inv">
@@ -64,7 +67,8 @@
<argument index="0" name="v" type="Vector2">
</argument>
<description>
- Inverse-transforms the given vector by this transform's basis (no translation).
+ Returns a vector transformed (multiplied) by the inverse basis matrix.
+ This method does not account for translation (the origin vector).
</description>
</method>
<method name="get_origin">
@@ -96,14 +100,14 @@
<argument index="1" name="weight" type="float">
</argument>
<description>
- Returns a transform interpolated between this transform and another by a given weight (0-1).
+ Returns a transform interpolated between this transform and another by a given weight (on the range of 0.0 to 1.0).
</description>
</method>
<method name="inverse">
<return type="Transform2D">
</return>
<description>
- Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling).
+ Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use [method affine_inverse] for transforms with scaling).
</description>
</method>
<method name="is_equal_approx">
@@ -119,7 +123,7 @@
<return type="Transform2D">
</return>
<description>
- Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors.
+ Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors (scale of 1 or -1).
</description>
</method>
<method name="rotated">
@@ -171,24 +175,24 @@
</methods>
<members>
<member name="origin" type="Vector2" setter="" getter="" default="Vector2( 0, 0 )">
- The transform's translation offset.
+ The origin vector (column 2, the third column). Equivalent to array index [code]2[/code]. The origin vector represents translation.
</member>
<member name="x" type="Vector2" setter="" getter="" default="Vector2( 1, 0 )">
- The X axis of 2×2 basis matrix containing 2 [Vector2]s as its columns: X axis and Y axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object.
+ The basis matrix's X vector (column 0). Equivalent to array index [code]0[/code].
</member>
<member name="y" type="Vector2" setter="" getter="" default="Vector2( 0, 1 )">
- The Y axis of 2×2 basis matrix containing 2 [Vector2]s as its columns: X axis and Y axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object.
+ The basis matrix's Y vector (column 1). Equivalent to array index [code]1[/code].
</member>
</members>
<constants>
<constant name="IDENTITY" value="Transform2D( 1, 0, 0, 1, 0, 0 )">
- [Transform2D] with no translation, rotation or scaling applied. When applied to other data structures, [constant IDENTITY] performs no transformation.
+ The identity [Transform2D] with no translation, rotation or scaling applied. When applied to other data structures, [constant IDENTITY] performs no transformation.
</constant>
<constant name="FLIP_X" value="Transform2D( -1, 0, 0, 1, 0, 0 )">
- [Transform2D] with mirroring applied parallel to the X axis.
+ The [Transform2D] that will flip something along the X axis.
</constant>
<constant name="FLIP_Y" value="Transform2D( 1, 0, 0, -1, 0, 0 )">
- [Transform2D] with mirroring applied parallel to the Y axis.
+ The [Transform2D] that will flip something along the Y axis.
</constant>
</constants>
</class>
diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml
index c97f99cfaa..c0d8628d88 100644
--- a/doc/classes/Vector2.xml
+++ b/doc/classes/Vector2.xml
@@ -43,7 +43,7 @@
<return type="float">
</return>
<description>
- Returns the vector's angle in radians with respect to the X axis, or [code](1, 0)[/code] vector.
+ Returns this vector's angle with respect to the X axis, or [code](1, 0)[/code] vector, in radians.
Equivalent to the result of [method @GDScript.atan2] when called with the vector's [member y] and [member x] as parameters: [code]atan2(y, x)[/code].
</description>
</method>
@@ -53,7 +53,7 @@
<argument index="0" name="to" type="Vector2">
</argument>
<description>
- Returns the angle in radians between the two vectors.
+ Returns the angle to the given vector, in radians.
</description>
</method>
<method name="angle_to_point">
@@ -62,14 +62,14 @@
<argument index="0" name="to" type="Vector2">
</argument>
<description>
- Returns the angle in radians between the line connecting the two points and the X coordinate.
+ Returns the angle between the line connecting the two points and the X axis, in radians.
</description>
</method>
<method name="aspect">
<return type="float">
</return>
<description>
- Returns the ratio of [member x] to [member y].
+ Returns the aspect ratio of this vector, the ratio of [member x] to [member y].
</description>
</method>
<method name="bounce">
@@ -85,7 +85,7 @@
<return type="Vector2">
</return>
<description>
- Returns the vector with all components rounded up.
+ Returns the vector with all components rounded up (towards positive infinity).
</description>
</method>
<method name="clamped">
@@ -94,7 +94,7 @@
<argument index="0" name="length" type="float">
</argument>
<description>
- Returns the vector with a maximum length.
+ Returns the vector with a maximum length by limiting its length to [code]length[/code].
</description>
</method>
<method name="cross">
@@ -103,7 +103,7 @@
<argument index="0" name="with" type="Vector2">
</argument>
<description>
- Returns the 2-dimensional analog of the cross product with the given vector.
+ Returns the cross product of this vector and [code]with[/code].
</description>
</method>
<method name="cubic_interpolate">
@@ -118,7 +118,7 @@
<argument index="3" name="t" type="float">
</argument>
<description>
- Cubically interpolates between this vector and [code]b[/code] using [code]pre_a[/code] and [code]post_b[/code] as handles, and returns the result at position [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], representing the amount of interpolation.
+ Cubically interpolates between this vector and [code]b[/code] using [code]pre_a[/code] and [code]post_b[/code] as handles, and returns the result at position [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
</description>
</method>
<method name="direction_to">
@@ -136,7 +136,8 @@
<argument index="0" name="to" type="Vector2">
</argument>
<description>
- Returns the squared distance to vector [code]b[/code]. Prefer this function over [method distance_to] if you need to sort vectors or need the squared distance for some formula.
+ Returns the squared distance between this vector and [code]b[/code].
+ This method runs faster than [method distance_to], so prefer it if you need to compare vectors or need the squared distance for some formula.
</description>
</method>
<method name="distance_to">
@@ -145,7 +146,7 @@
<argument index="0" name="to" type="Vector2">
</argument>
<description>
- Returns the distance to vector [code]b[/code].
+ Returns the distance between this vector and [code]to[/code].
</description>
</method>
<method name="dot">
@@ -154,7 +155,7 @@
<argument index="0" name="with" type="Vector2">
</argument>
<description>
- Returns the dot product with vector [code]b[/code]. This can be used to compare the angle between two vectors. For example, this can be used to determine whether an enemy is facing the player.
+ Returns the dot product of this vector and [code]with[/code]. This can be used to compare the angle between two vectors. For example, this can be used to determine whether an enemy is facing the player.
The dot product will be [code]0[/code] for a straight angle (90 degrees), greater than 0 for angles narrower than 90 degrees and lower than 0 for angles wider than 90 degrees.
When using unit (normalized) vectors, the result will always be between [code]-1.0[/code] (180 degree angle) when the vectors are facing opposite directions, and [code]1.0[/code] (0 degree angle) when the vectors are aligned.
[b]Note:[/b] [code]a.dot(b)[/code] is equivalent to [code]b.dot(a)[/code].
@@ -164,7 +165,7 @@
<return type="Vector2">
</return>
<description>
- Returns the vector with all components rounded down.
+ Returns the vector with all components rounded down (towards negative infinity).
</description>
</method>
<method name="is_equal_approx">
@@ -180,21 +181,22 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the vector is normalized.
+ Returns [code]true[/code] if the vector is normalized, and false otherwise.
</description>
</method>
<method name="length">
<return type="float">
</return>
<description>
- Returns the vector's length.
+ Returns the length (magnitude) of this vector.
</description>
</method>
<method name="length_squared">
<return type="float">
</return>
<description>
- Returns the vector's length squared. Prefer this method over [method length] if you need to sort vectors or need the squared length for some formula.
+ Returns the squared length (squared magnitude) of this vector.
+ This method runs faster than [method length], so prefer it if you need to compare vectors or need the squared distance for some formula.
</description>
</method>
<method name="lerp">
@@ -205,7 +207,7 @@
<argument index="1" name="t" type="float">
</argument>
<description>
- Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], representing the amount of interpolation.
+ Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
</description>
</method>
<method name="move_toward">
@@ -232,7 +234,7 @@
<argument index="0" name="mod" type="float">
</argument>
<description>
- Returns a vector composed of the [code]fposmod[/code] of this vector's components and [code]mod[/code].
+ Returns a vector composed of the [method @GDScript.fposmod] of this vector's components and [code]mod[/code].
</description>
</method>
<method name="posmodv">
@@ -241,7 +243,7 @@
<argument index="0" name="modv" type="Vector2">
</argument>
<description>
- Returns a vector composed of the [code]fposmod[/code] of this vector's components and [code]modv[/code]'s components.
+ Returns a vector composed of the [method @GDScript.fposmod] of this vector's components and [code]modv[/code]'s components.
</description>
</method>
<method name="project">
@@ -282,7 +284,7 @@
<return type="Vector2">
</return>
<description>
- Returns the vector with each component set to one or negative one, depending on the signs of the components.
+ Returns the vector with each component set to one or negative one, depending on the signs of the components, or zero if the component is zero, by calling [method @GDScript.sign] on each component.
</description>
</method>
<method name="slerp">
@@ -293,7 +295,7 @@
<argument index="1" name="t" type="float">
</argument>
<description>
- Returns the result of spherical linear interpolation between this vector and [code]b[/code], by amount [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], representing the amount of interpolation.
+ Returns the result of spherical linear interpolation between this vector and [code]b[/code], by amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
[b]Note:[/b] Both vectors must be normalized.
</description>
</method>
@@ -303,7 +305,7 @@
<argument index="0" name="n" type="Vector2">
</argument>
<description>
- Returns the component of the vector along a plane defined by the given normal.
+ Returns this vector slid along a plane defined by the given normal.
</description>
</method>
<method name="snapped">
@@ -312,14 +314,14 @@
<argument index="0" name="by" type="Vector2">
</argument>
<description>
- Returns the vector snapped to a grid with the given size.
+ Returns this vector with each component snapped to the nearest multiple of [code]step[/code]. This can also be used to round to an arbitrary number of decimals.
</description>
</method>
<method name="tangent">
<return type="Vector2">
</return>
<description>
- Returns a perpendicular vector.
+ Returns a perpendicular vector rotated 90 degrees counter-clockwise compared to the original, with the same length.
</description>
</method>
</methods>
@@ -339,25 +341,25 @@
Enumerated value for the Y axis.
</constant>
<constant name="ZERO" value="Vector2( 0, 0 )">
- Zero vector.
+ Zero vector, a vector with all components set to [code]0[/code].
</constant>
<constant name="ONE" value="Vector2( 1, 1 )">
- One vector.
+ One vector, a vector with all components set to [code]1[/code].
</constant>
<constant name="INF" value="Vector2( inf, inf )">
- Infinity vector.
+ Infinity vector, a vector with all components set to [constant @GDScript.INF].
</constant>
<constant name="LEFT" value="Vector2( -1, 0 )">
- Left unit vector.
+ Left unit vector. Represents the direction of left.
</constant>
<constant name="RIGHT" value="Vector2( 1, 0 )">
- Right unit vector.
+ Right unit vector. Represents the direction of right.
</constant>
<constant name="UP" value="Vector2( 0, -1 )">
- Up unit vector.
+ Up unit vector. Y is down in 2D, so this vector points -Y.
</constant>
<constant name="DOWN" value="Vector2( 0, 1 )">
- Down unit vector.
+ Down unit vector. Y is down in 2D, so this vector points +Y.
</constant>
</constants>
</class>
diff --git a/doc/classes/Vector2i.xml b/doc/classes/Vector2i.xml
index 2f7ca985b2..d03db712fc 100644
--- a/doc/classes/Vector2i.xml
+++ b/doc/classes/Vector2i.xml
@@ -70,22 +70,22 @@
Enumerated value for the Y axis.
</constant>
<constant name="ZERO" value="Vector2i( 0, 0 )">
- Zero vector.
+ Zero vector, a vector with all components set to [code]0[/code].
</constant>
<constant name="ONE" value="Vector2i( 1, 1 )">
- One vector.
+ One vector, a vector with all components set to [code]1[/code].
</constant>
<constant name="LEFT" value="Vector2i( -1, 0 )">
- Left unit vector.
+ Left unit vector. Represents the direction of left.
</constant>
<constant name="RIGHT" value="Vector2i( 1, 0 )">
- Right unit vector.
+ Right unit vector. Represents the direction of right.
</constant>
<constant name="UP" value="Vector2i( 0, -1 )">
- Up unit vector.
+ Up unit vector. Y is down in 2D, so this vector points -Y.
</constant>
<constant name="DOWN" value="Vector2i( 0, 1 )">
- Down unit vector.
+ Down unit vector. Y is down in 2D, so this vector points +Y.
</constant>
</constants>
</class>
diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml
index 7ba8cb5eed..776dfd929e 100644
--- a/doc/classes/Vector3.xml
+++ b/doc/classes/Vector3.xml
@@ -47,7 +47,7 @@
<argument index="0" name="to" type="Vector3">
</argument>
<description>
- Returns the minimum angle to the given vector.
+ Returns the minimum angle to the given vector, in radians.
</description>
</method>
<method name="bounce">
@@ -63,7 +63,7 @@
<return type="Vector3">
</return>
<description>
- Returns a new vector with all components rounded up.
+ Returns a new vector with all components rounded up (towards positive infinity).
</description>
</method>
<method name="cross">
@@ -72,7 +72,7 @@
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Returns the cross product with [code]b[/code].
+ Returns the cross product of this vector and [code]b[/code].
</description>
</method>
<method name="cubic_interpolate">
@@ -87,7 +87,7 @@
<argument index="3" name="t" type="float">
</argument>
<description>
- Performs a cubic interpolation between vectors [code]pre_a[/code], [code]a[/code], [code]b[/code], [code]post_b[/code] ([code]a[/code] is current), by the given amount [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], representing the amount of interpolation.
+ Performs a cubic interpolation between vectors [code]pre_a[/code], [code]a[/code], [code]b[/code], [code]post_b[/code] ([code]a[/code] is current), by the given amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
</description>
</method>
<method name="direction_to">
@@ -105,7 +105,8 @@
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Returns the squared distance to [code]b[/code]. Prefer this function over [method distance_to] if you need to sort vectors or need the squared distance for some formula.
+ Returns the squared distance between this vector and [code]b[/code].
+ This method runs faster than [method distance_to], so prefer it if you need to compare vectors or need the squared distance for some formula.
</description>
</method>
<method name="distance_to">
@@ -114,7 +115,7 @@
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Returns the distance to [code]b[/code].
+ Returns the distance between this vector and [code]b[/code].
</description>
</method>
<method name="dot">
@@ -123,7 +124,7 @@
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Returns the dot product with vector [code]b[/code]. This can be used to compare the angle between two vectors. For example, this can be used to determine whether an enemy is facing the player.
+ Returns the dot product of this vector and [code]b[/code]. This can be used to compare the angle between two vectors. For example, this can be used to determine whether an enemy is facing the player.
The dot product will be [code]0[/code] for a straight angle (90 degrees), greater than 0 for angles narrower than 90 degrees and lower than 0 for angles wider than 90 degrees.
When using unit (normalized) vectors, the result will always be between [code]-1.0[/code] (180 degree angle) when the vectors are facing opposite directions, and [code]1.0[/code] (0 degree angle) when the vectors are aligned.
[b]Note:[/b] [code]a.dot(b)[/code] is equivalent to [code]b.dot(a)[/code].
@@ -133,7 +134,7 @@
<return type="Vector3">
</return>
<description>
- Returns a new vector with all components rounded down.
+ Returns a new vector with all components rounded down (towards negative infinity).
</description>
</method>
<method name="inverse">
@@ -156,21 +157,22 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the vector is normalized.
+ Returns [code]true[/code] if the vector is normalized, and false otherwise.
</description>
</method>
<method name="length">
<return type="float">
</return>
<description>
- Returns the vector's length.
+ Returns the length (magnitude) of this vector.
</description>
</method>
<method name="length_squared">
<return type="float">
</return>
<description>
- Returns the vector's length squared. Prefer this function over [method length] if you need to sort vectors or need the squared length for some formula.
+ Returns the squared length (squared magnitude) of this vector.
+ This method runs faster than [method length], so prefer it if you need to compare vectors or need the squared distance for some formula.
</description>
</method>
<method name="lerp">
@@ -181,21 +183,21 @@
<argument index="1" name="t" type="float">
</argument>
<description>
- Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], representing the amount of interpolation..
+ Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
</description>
</method>
<method name="max_axis">
<return type="int">
</return>
<description>
- Returns the axis of the vector's largest value. See [code]AXIS_*[/code] constants.
+ 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].
</description>
</method>
<method name="min_axis">
<return type="int">
</return>
<description>
- Returns the axis of the vector's smallest value. See [code]AXIS_*[/code] constants.
+ 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].
</description>
</method>
<method name="move_toward">
@@ -206,7 +208,7 @@
<argument index="1" name="delta" type="float">
</argument>
<description>
- Moves the vector toward [code]to[/code] by the fixed [code]delta[/code] amount.
+ Moves this vector toward [code]to[/code] by the fixed [code]delta[/code] amount.
</description>
</method>
<method name="normalized">
@@ -231,7 +233,7 @@
<argument index="0" name="mod" type="float">
</argument>
<description>
- Returns a vector composed of the [code]fposmod[/code] of this vector's components and [code]mod[/code].
+ Returns a vector composed of the [method @GDScript.fposmod] of this vector's components and [code]mod[/code].
</description>
</method>
<method name="posmodv">
@@ -240,7 +242,7 @@
<argument index="0" name="modv" type="Vector3">
</argument>
<description>
- Returns a vector composed of the [code]fposmod[/code] of this vector's components and [code]modv[/code]'s components.
+ Returns a vector composed of the [method @GDScript.fposmod] of this vector's components and [code]modv[/code]'s components.
</description>
</method>
<method name="project">
@@ -249,7 +251,7 @@
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Returns the vector projected onto the vector [code]b[/code].
+ Returns this vector projected onto another vector [code]b[/code].
</description>
</method>
<method name="reflect">
@@ -258,7 +260,7 @@
<argument index="0" name="n" type="Vector3">
</argument>
<description>
- Returns the vector reflected from a plane defined by the given normal.
+ Returns this vector reflected from a plane defined by the given normal.
</description>
</method>
<method name="rotated">
@@ -269,21 +271,21 @@
<argument index="1" name="phi" type="float">
</argument>
<description>
- Rotates the vector around a given axis by [code]phi[/code] radians. The axis must be a normalized vector.
+ Rotates this vector around a given axis by [code]phi[/code] radians. The axis must be a normalized vector.
</description>
</method>
<method name="round">
<return type="Vector3">
</return>
<description>
- Returns the vector with all components rounded to the nearest integer, with halfway cases rounded away from zero.
+ Returns this vector with all components rounded to the nearest integer, with halfway cases rounded away from zero.
</description>
</method>
<method name="sign">
<return type="Vector3">
</return>
<description>
- Returns the vector with each component set to one or negative one, depending on the signs of the components.
+ Returns a vector with each component set to one or negative one, depending on the signs of this vector's components, or zero if the component is zero, by calling [method @GDScript.sign] on each component.
</description>
</method>
<method name="slerp">
@@ -294,7 +296,7 @@
<argument index="1" name="t" type="float">
</argument>
<description>
- Returns the result of spherical linear interpolation between this vector and [code]b[/code], by amount [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], representing the amount of interpolation.
+ Returns the result of spherical linear interpolation between this vector and [code]b[/code], by amount [code]t[/code]. [code]t[/code] is on the range of 0.0 to 1.0, representing the amount of interpolation.
[b]Note:[/b] Both vectors must be normalized.
</description>
</method>
@@ -304,7 +306,7 @@
<argument index="0" name="n" type="Vector3">
</argument>
<description>
- Returns the component of the vector along a plane defined by the given normal.
+ Returns this vector slid along a plane defined by the given normal.
</description>
</method>
<method name="snapped">
@@ -313,7 +315,7 @@
<argument index="0" name="by" type="Vector3">
</argument>
<description>
- Returns the vector snapped to a grid with the given size.
+ Returns this vector with each component snapped to the nearest multiple of [code]step[/code]. This can also be used to round to an arbitrary number of decimals.
</description>
</method>
<method name="to_diagonal_matrix">
@@ -321,6 +323,7 @@
</return>
<description>
Returns a diagonal matrix with the vector as main diagonal.
+ This is equivalent to a Basis with no rotation or shearing and this vector's components set as the scale.
</description>
</method>
</methods>
@@ -346,19 +349,19 @@
Enumerated value for the Z axis. Returned by [method max_axis] and [method min_axis].
</constant>
<constant name="ZERO" value="Vector3( 0, 0, 0 )">
- Zero vector.
+ Zero vector, a vector with all components set to [code]0[/code].
</constant>
<constant name="ONE" value="Vector3( 1, 1, 1 )">
- One vector.
+ One vector, a vector with all components set to [code]1[/code].
</constant>
<constant name="INF" value="Vector3( inf, inf, inf )">
- Infinity vector.
+ Infinity vector, a vector with all components set to [constant @GDScript.INF].
</constant>
<constant name="LEFT" value="Vector3( -1, 0, 0 )">
- Left unit vector.
+ Left unit vector. Represents the local direction of left, and the global direction of west.
</constant>
<constant name="RIGHT" value="Vector3( 1, 0, 0 )">
- Right unit vector.
+ Right unit vector. Represents the local direction of right, and the global direction of east.
</constant>
<constant name="UP" value="Vector3( 0, 1, 0 )">
Up unit vector.
@@ -367,10 +370,10 @@
Down unit vector.
</constant>
<constant name="FORWARD" value="Vector3( 0, 0, -1 )">
- Forward unit vector.
+ Forward unit vector. Represents the local direction of forward, and the global direction of north.
</constant>
<constant name="BACK" value="Vector3( 0, 0, 1 )">
- Back unit vector.
+ Back unit vector. Represents the local direction of back, and the global direction of south.
</constant>
</constants>
</class>
diff --git a/doc/classes/Vector3i.xml b/doc/classes/Vector3i.xml
index 91d64ea609..94551e1c2f 100644
--- a/doc/classes/Vector3i.xml
+++ b/doc/classes/Vector3i.xml
@@ -38,14 +38,14 @@
<return type="int">
</return>
<description>
- Returns the axis of the vector's largest value. See [code]AXIS_*[/code] constants.
+ 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].
</description>
</method>
<method name="min_axis">
<return type="int">
</return>
<description>
- Returns the axis of the vector's smallest value. See [code]AXIS_*[/code] constants.
+ 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].
</description>
</method>
<method name="sign">
@@ -78,16 +78,16 @@
Enumerated value for the Z axis.
</constant>
<constant name="ZERO" value="Vector3i( 0, 0, 0 )">
- Zero vector.
+ Zero vector, a vector with all components set to [code]0[/code].
</constant>
<constant name="ONE" value="Vector3i( 1, 1, 1 )">
- One vector.
+ One vector, a vector with all components set to [code]1[/code].
</constant>
<constant name="LEFT" value="Vector3i( -1, 0, 0 )">
- Left unit vector.
+ Left unit vector. Represents the local direction of left, and the global direction of west.
</constant>
<constant name="RIGHT" value="Vector3i( 1, 0, 0 )">
- Right unit vector.
+ Right unit vector. Represents the local direction of right, and the global direction of east.
</constant>
<constant name="UP" value="Vector3i( 0, 1, 0 )">
Up unit vector.
@@ -96,10 +96,10 @@
Down unit vector.
</constant>
<constant name="FORWARD" value="Vector3i( 0, 0, -1 )">
- Forward unit vector.
+ Forward unit vector. Represents the local direction of forward, and the global direction of north.
</constant>
<constant name="BACK" value="Vector3i( 0, 0, 1 )">
- Back unit vector.
+ Back unit vector. Represents the local direction of back, and the global direction of south.
</constant>
</constants>
</class>
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index 8a2c6b73d8..3294ab4cc7 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -315,7 +315,7 @@
Do not perform any antialiasing in the full screen post-process.
</constant>
<constant name="SCREEN_SPACE_AA_FXAA" value="1" enum="ScreenSpaceAA">
- Use fast approximate antialiasing. FXAA is a popular screen-space antialising method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K.
+ Use fast approximate antialiasing. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K.
</constant>
<constant name="SCREEN_SPACE_AA_MAX" value="2" enum="ScreenSpaceAA">
Represents the size of the [enum ScreenSpaceAA] enum.
diff --git a/doc/classes/VisualShaderNodeOutput.xml b/doc/classes/VisualShaderNodeOutput.xml
index 2b4aed9ae4..83da6f29f9 100644
--- a/doc/classes/VisualShaderNodeOutput.xml
+++ b/doc/classes/VisualShaderNodeOutput.xml
@@ -4,7 +4,7 @@
Represents the output shader parameters within the visual shader graph.
</brief_description>
<description>
- This visual shader node is present in all shader graphs in form of "Output" block with mutliple output value ports.
+ This visual shader node is present in all shader graphs in form of "Output" block with multiple output value ports.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeVectorRefract.xml b/doc/classes/VisualShaderNodeVectorRefract.xml
index 0fa90a69cf..178c35f49a 100644
--- a/doc/classes/VisualShaderNodeVectorRefract.xml
+++ b/doc/classes/VisualShaderNodeVectorRefract.xml
@@ -4,7 +4,7 @@
Returns the [Vector3] that points in the direction of refraction. For use within the visual shader graph.
</brief_description>
<description>
- Translated to [code]refract(I, N, eta)[/code] in the shader language, where [code]I[/code] is the incident vector, [code]N[/code] is the normal vector and [code]eta[/code] is the ratio of the indicies of the refraction.
+ Translated to [code]refract(I, N, eta)[/code] in the shader language, where [code]I[/code] is the incident vector, [code]N[/code] is the normal vector and [code]eta[/code] is the ratio of the indices of the refraction.
</description>
<tutorials>
</tutorials>
diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp
index aa742bd599..794bcee3e6 100644
--- a/drivers/vulkan/rendering_device_vulkan.cpp
+++ b/drivers/vulkan/rendering_device_vulkan.cpp
@@ -65,7 +65,7 @@ void RenderingDeviceVulkan::_free_dependencies(RID p_id) {
dependency_map.erase(E);
}
- //reverse depenencies must be unreferenced
+ //reverse dependencies must be unreferenced
E = reverse_dependency_map.find(p_id);
if (E) {
@@ -2278,8 +2278,8 @@ Error RenderingDeviceVulkan::texture_update(RID p_texture, uint32_t p_layer, con
VkBufferImageCopy buffer_image_copy;
buffer_image_copy.bufferOffset = alloc_offset;
- buffer_image_copy.bufferRowLength = 0; //tigthly packed
- buffer_image_copy.bufferImageHeight = 0; //tigthly packed
+ buffer_image_copy.bufferRowLength = 0; //tightly packed
+ buffer_image_copy.bufferImageHeight = 0; //tightly packed
buffer_image_copy.imageSubresource.aspectMask = texture->read_aspect_mask;
buffer_image_copy.imageSubresource.mipLevel = mm_i;
@@ -2726,8 +2726,8 @@ Error RenderingDeviceVulkan::texture_resolve_multisample(RID p_from_texture, RID
ERR_FAIL_COND_V_MSG(dst_tex->type != TEXTURE_TYPE_2D, ERR_INVALID_PARAMETER, "Destination texture must be 2D (or a slice of a 3D/Cube texture).");
ERR_FAIL_COND_V_MSG(dst_tex->samples != TEXTURE_SAMPLES_1, ERR_INVALID_PARAMETER, "Destination texture must not be multisampled.");
- ERR_FAIL_COND_V_MSG(src_tex->format != dst_tex->format, ERR_INVALID_PARAMETER, "Source and Destionation textures must be the same format.");
- ERR_FAIL_COND_V_MSG(src_tex->width != dst_tex->width && src_tex->height != dst_tex->height && src_tex->depth != dst_tex->depth, ERR_INVALID_PARAMETER, "Source and Destionation textures must have the same dimensions.");
+ ERR_FAIL_COND_V_MSG(src_tex->format != dst_tex->format, ERR_INVALID_PARAMETER, "Source and Destination textures must be the same format.");
+ ERR_FAIL_COND_V_MSG(src_tex->width != dst_tex->width && src_tex->height != dst_tex->height && src_tex->depth != dst_tex->depth, ERR_INVALID_PARAMETER, "Source and Destination textures must have the same dimensions.");
ERR_FAIL_COND_V_MSG(src_tex->read_aspect_mask != dst_tex->read_aspect_mask, ERR_INVALID_PARAMETER,
"Source and destination texture must be of the same type (color or depth).");
@@ -3531,7 +3531,7 @@ RID RenderingDeviceVulkan::index_buffer_create(uint32_t p_index_count, IndexBuff
const uint16_t *index16 = (const uint16_t *)r;
for (uint32_t i = 0; i < p_index_count; i++) {
if (p_use_restart_indices && index16[i] == 0xFFFF) {
- continue; //restart index, ingnore
+ continue; //restart index, ignore
}
index_buffer.max_index = MAX(index16[i], index_buffer.max_index);
}
@@ -3539,7 +3539,7 @@ RID RenderingDeviceVulkan::index_buffer_create(uint32_t p_index_count, IndexBuff
const uint32_t *index32 = (const uint32_t *)r;
for (uint32_t i = 0; i < p_index_count; i++) {
if (p_use_restart_indices && index32[i] == 0xFFFFFFFF) {
- continue; //restart index, ingnore
+ continue; //restart index, ignore
}
index_buffer.max_index = MAX(index32[i], index_buffer.max_index);
}
@@ -5594,7 +5594,7 @@ Error RenderingDeviceVulkan::_draw_list_render_pass_begin(Framebuffer *framebuff
for (int i = 0; i < p_storage_textures.size(); i++) {
Texture *texture = texture_owner.getornull(p_storage_textures[i]);
- ERR_CONTINUE_MSG(!(texture->usage_flags & TEXTURE_USAGE_STORAGE_BIT), "Supplied storage texture " + itos(i) + " for draw list ist not set to be used for storage.");
+ ERR_CONTINUE_MSG(!(texture->usage_flags & TEXTURE_USAGE_STORAGE_BIT), "Supplied storage texture " + itos(i) + " for draw list is not set to be used for storage.");
if (texture->usage_flags & TEXTURE_USAGE_SAMPLING_BIT) {
//must change layout to general
@@ -6161,9 +6161,9 @@ void RenderingDeviceVulkan::draw_list_draw(DrawListID p_list, bool p_use_indices
//make sure format is right
ERR_FAIL_COND_MSG(dl->validation.pipeline_vertex_format != dl->validation.vertex_format,
"The vertex format used to create the pipeline does not match the vertex format bound.");
- //make sure amount of instances is valid
+ //make sure number of instances is valid
ERR_FAIL_COND_MSG(p_instances > dl->validation.vertex_max_instances_allowed,
- "Amount of instances requested (" + itos(p_instances) + " is larger than the maximum amount suported by the bound vertex array (" + itos(dl->validation.vertex_max_instances_allowed) + ").");
+ "Number of instances requested (" + itos(p_instances) + " is larger than the maximum number supported by the bound vertex array (" + itos(dl->validation.vertex_max_instances_allowed) + ").");
}
if (dl->validation.pipeline_push_constant_size > 0) {
@@ -7359,7 +7359,7 @@ uint64_t RenderingDeviceVulkan::get_captured_timestamp_gpu_time(uint32_t p_index
// this sucks because timestampPeriod multiplier is a float, while the timestamp is 64 bits nanosecs.
// so, in cases like nvidia which give you enormous numbers and 1 as multiplier, multiplying is next to impossible
- // need to do 128 bits fixed point multiplication to get the rigth value
+ // need to do 128 bits fixed point multiplication to get the right value
uint64_t shift_bits = 16;
diff --git a/drivers/vulkan/rendering_device_vulkan.h b/drivers/vulkan/rendering_device_vulkan.h
index 936448dbbd..6f8bbc9c64 100644
--- a/drivers/vulkan/rendering_device_vulkan.h
+++ b/drivers/vulkan/rendering_device_vulkan.h
@@ -112,7 +112,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
/*****************/
// In Vulkan, the concept of textures does not exist,
- // intead there is the image (the memory prety much,
+ // instead there is the image (the memory pretty much,
// the view (how the memory is interpreted) and the
// sampler (how it's sampled from the shader).
//
@@ -327,7 +327,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
// Vertex buffers in Vulkan are similar to how
// they work in OpenGL, except that instead of
- // an attribtue index, there is a buffer binding
+ // an attribute index, there is a buffer binding
// index (for binding the buffers in real-time)
// and a location index (what is used in the shader).
//
@@ -869,8 +869,8 @@ class RenderingDeviceVulkan : public RenderingDevice {
List<ComputePipeline> compute_pipelines_to_dispose_of;
VkCommandPool command_pool;
- VkCommandBuffer setup_command_buffer; //used at the begining of every frame for set-up
- VkCommandBuffer draw_command_buffer; //used at the begining of every frame for set-up
+ VkCommandBuffer setup_command_buffer; //used at the beginning of every frame for set-up
+ VkCommandBuffer draw_command_buffer; //used at the beginning of every frame for set-up
struct Timestamp {
String description;
diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp
index e064a4ad6a..997ed3935f 100644
--- a/drivers/vulkan/vulkan_context.cpp
+++ b/drivers/vulkan/vulkan_context.cpp
@@ -154,7 +154,7 @@ VkBool32 VulkanContext::_check_layers(uint32_t check_count, const char **check_n
}
}
if (!found) {
- ERR_PRINT("Cant find layer: " + String(check_names[i]));
+ ERR_PRINT("Can't find layer: " + String(check_names[i]));
return 0;
}
}
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 99a2a73a75..c0c3a73957 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -674,7 +674,7 @@ CreateDialog::CreateDialog() {
favorites->connect("item_activated", callable_mp(this, &CreateDialog::_favorite_activated));
favorites->add_theme_constant_override("draw_guides", 1);
#ifndef _MSC_VER
-#warning cant forward drag data to a non control, must be fixed
+#warning cannot forward drag data to a non control, must be fixed
#endif
//favorites->set_drag_forwarding(this);
fav_vb->add_margin_child(TTR("Favorites:"), favorites, true);
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 9c0efd0881..7cff3263f2 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -6321,7 +6321,7 @@ EditorNode::EditorNode() {
right_menu_hb->add_child(video_driver);
#ifndef _MSC_VER
-#warning neeeds to be reimplemented
+#warning needs to be reimplemented
#endif
#if 0
String video_drivers = ProjectSettings::get_singleton()->get_custom_property_info()["rendering/quality/driver/driver_name"].hint_string;
diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp
index b57ea3745d..f954931cee 100644
--- a/editor/import/resource_importer_layered_texture.cpp
+++ b/editor/import/resource_importer_layered_texture.cpp
@@ -180,7 +180,7 @@ void ResourceImporterLayeredTexture::_save_tex(Vector<Ref<Image>> p_images, cons
f->store_32(0); //dataformat
f->store_32(0); //mipmap limit
- //reserverd
+ //reserved
f->store_32(0);
f->store_32(0);
f->store_32(0);
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 4f783f4e27..71830d0464 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -701,7 +701,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) {
Ref<Script> script = current->get_edited_resource();
if (p_save) {
// Do not try to save internal scripts
- if (!(script->get_path() == "" || script->get_path().find("local://") != -1 || script->get_path().find("::") != -1)) {
+ if (!script.is_valid() || !(script->get_path() == "" || script->get_path().find("local://") != -1 || script->get_path().find("::") != -1)) {
_menu_option(FILE_SAVE);
}
}
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 90747e45e4..13fb74987c 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -1217,7 +1217,6 @@ void SceneTreeDock::_node_selected() {
Node *node = scene_tree->get_selected();
if (!node) {
- editor->push_item(nullptr);
return;
}
@@ -1902,11 +1901,10 @@ void SceneTreeDock::_selection_changed() {
if (selection_size > 1) {
//automatically turn on multi-edit
_tool_selected(TOOL_MULTI_EDIT);
- } else if (selection_size == 1) {
- editor->push_item(EditorNode::get_singleton()->get_editor_selection()->get_selected_node_list()[0]);
- } else {
+ } else if (selection_size == 0) {
editor->push_item(nullptr);
}
+
_update_script_button();
}
diff --git a/modules/gdnative/gdnative/aabb.cpp b/modules/gdnative/gdnative/aabb.cpp
index 7f22c7dfe3..d5970e8004 100644
--- a/modules/gdnative/gdnative/aabb.cpp
+++ b/modules/gdnative/gdnative/aabb.cpp
@@ -81,6 +81,13 @@ godot_string GDAPI godot_aabb_as_string(const godot_aabb *p_self) {
return ret;
}
+godot_aabb GDAPI godot_aabb_abs(const godot_aabb *p_self) {
+ godot_aabb dest;
+ const AABB *self = (const AABB *)p_self;
+ *((AABB *)&dest) = self->abs();
+ return dest;
+}
+
godot_real GDAPI godot_aabb_get_area(const godot_aabb *p_self) {
const AABB *self = (const AABB *)p_self;
return self->get_area();
diff --git a/modules/gdnative/gdnative/plane.cpp b/modules/gdnative/gdnative/plane.cpp
index 663937f906..d4ed8d00f4 100644
--- a/modules/gdnative/gdnative/plane.cpp
+++ b/modules/gdnative/gdnative/plane.cpp
@@ -79,13 +79,6 @@ godot_vector3 GDAPI godot_plane_center(const godot_plane *p_self) {
return dest;
}
-godot_vector3 GDAPI godot_plane_get_any_point(const godot_plane *p_self) {
- godot_vector3 dest;
- const Plane *self = (const Plane *)p_self;
- *((Vector3 *)&dest) = self->get_any_point();
- return dest;
-}
-
godot_bool GDAPI godot_plane_is_point_over(const godot_plane *p_self, const godot_vector3 *p_point) {
const Plane *self = (const Plane *)p_self;
const Vector3 *point = (const Vector3 *)p_point;
diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json
index eb122089b6..9852928d22 100644
--- a/modules/gdnative/gdnative_api.json
+++ b/modules/gdnative/gdnative_api.json
@@ -54,6 +54,13 @@
]
},
{
+ "name": "godot_aabb_abs",
+ "return_type": "godot_aabb",
+ "arguments": [
+ ["const godot_aabb *", "p_self"]
+ ]
+ },
+ {
"name": "godot_aabb_get_area",
"return_type": "godot_real",
"arguments": [
@@ -2981,13 +2988,6 @@
]
},
{
- "name": "godot_plane_get_any_point",
- "return_type": "godot_vector3",
- "arguments": [
- ["const godot_plane *", "p_self"]
- ]
- },
- {
"name": "godot_plane_is_point_over",
"return_type": "godot_bool",
"arguments": [
diff --git a/modules/gdnative/include/gdnative/aabb.h b/modules/gdnative/include/gdnative/aabb.h
index 9f41e9d4c6..c776297944 100644
--- a/modules/gdnative/include/gdnative/aabb.h
+++ b/modules/gdnative/include/gdnative/aabb.h
@@ -69,6 +69,8 @@ void GDAPI godot_aabb_set_size(const godot_aabb *p_self, const godot_vector3 *p_
godot_string GDAPI godot_aabb_as_string(const godot_aabb *p_self);
+godot_aabb GDAPI godot_aabb_abs(const godot_aabb *p_self);
+
godot_real GDAPI godot_aabb_get_area(const godot_aabb *p_self);
godot_bool GDAPI godot_aabb_has_no_area(const godot_aabb *p_self);
diff --git a/modules/gdnative/include/gdnative/plane.h b/modules/gdnative/include/gdnative/plane.h
index b759a8cc1a..9843056489 100644
--- a/modules/gdnative/include/gdnative/plane.h
+++ b/modules/gdnative/include/gdnative/plane.h
@@ -68,8 +68,6 @@ godot_plane GDAPI godot_plane_normalized(const godot_plane *p_self);
godot_vector3 GDAPI godot_plane_center(const godot_plane *p_self);
-godot_vector3 GDAPI godot_plane_get_any_point(const godot_plane *p_self);
-
godot_bool GDAPI godot_plane_is_point_over(const godot_plane *p_self, const godot_vector3 *p_point);
godot_real GDAPI godot_plane_distance_to(const godot_plane *p_self, const godot_vector3 *p_point);
diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp
index d1b1513ac3..3a2d0b09a3 100644
--- a/modules/gdnative/register_types.cpp
+++ b/modules/gdnative/register_types.cpp
@@ -171,7 +171,7 @@ void GDNativeExportPlugin::_export_file(const String &p_path, const String &p_ty
String entry_lib_path = config->get_value("entry", key);
if (entry_lib_path.begins_with("res://") && entry_lib_path.ends_with(".a")) {
// If we find static library that was used for export
- // we should add a fake loopup table.
+ // we should add a fake lookup table.
// In case of dynamic library being used,
// this symbols will not cause any issues with library loading.
should_fake_dynamic = true;
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml
index f04cb4b4c3..36de66ea52 100644
--- a/modules/gdscript/doc_classes/@GDScript.xml
+++ b/modules/gdscript/doc_classes/@GDScript.xml
@@ -52,7 +52,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Returns the absolute value of parameter [code]s[/code] (i.e. unsigned value, works for integer and float).
+ Returns the absolute value of parameter [code]s[/code] (i.e. positive value).
[codeblock]
# a is 1
a = abs(-1)
@@ -112,7 +112,7 @@
</argument>
<description>
Returns the arc tangent of [code]s[/code] in radians. Use it to get the angle from an angle's tangent in trigonometry: [code]atan(tan(angle)) == angle[/code].
- The method cannot know in which quadrant the angle should fall. See [method atan2] if you always want an exact angle.
+ The method cannot know in which quadrant the angle should fall. See [method atan2] if you have both [code]y[code] and [code]x[/code].
[codeblock]
a = atan(0.5) # a is 0.463648
[/codeblock]
@@ -127,6 +127,7 @@
</argument>
<description>
Returns the arc tangent of [code]y/x[/code] in radians. Use to get the angle of tangent [code]y/x[/code]. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant.
+ Important note: The Y coordinate comes first, by convention.
[codeblock]
a = atan2(0, -1) # a is 3.141593
[/codeblock]
@@ -161,7 +162,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Rounds [code]s[/code] upward, returning the smallest integral value that is not less than [code]s[/code].
+ Rounds [code]s[/code] upward (towards positive infinity), returning the smallest whole number that is not less than [code]s[/code].
[codeblock]
i = ceil(1.45) # i is 2
i = ceil(1.001) # i is 2
@@ -283,7 +284,7 @@
<argument index="0" name="deg" type="float">
</argument>
<description>
- Returns degrees converted to radians.
+ Converts an angle expressed in degrees to radians.
[codeblock]
# r is 3.141593
r = deg2rad(180)
@@ -307,7 +308,7 @@
<argument index="1" name="curve" type="float">
</argument>
<description>
- Easing function, based on exponent. 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in.
+ Easing function, based on exponent. The curve values are: 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in.
</description>
</method>
<method name="exp">
@@ -330,7 +331,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Rounds [code]s[/code] to the closest smaller integer and returns it.
+ Rounds [code]s[/code] downward (towards negative infinity), returning the largest whole number that is not more than [code]s[/code].
[codeblock]
# a is 2.0
a = floor(2.99)
@@ -530,7 +531,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Returns whether [code]s[/code] is a NaN (Not-A-Number) value.
+ Returns whether [code]s[/code] is a NaN ("Not a Number" or invalid) value.
</description>
</method>
<method name="is_zero_approx">
@@ -540,6 +541,7 @@
</argument>
<description>
Returns [code]true[/code] if [code]s[/code] is zero or almost zero.
+ This method is faster than using [method is_equal_approx] with one value as zero.
</description>
</method>
<method name="len">
@@ -907,7 +909,7 @@
<argument index="0" name="rad" type="float">
</argument>
<description>
- Converts from radians to degrees.
+ Converts an angle expressed in radians to degrees.
[codeblock]
rad2deg(0.523599) # Returns 30
[/codeblock]
@@ -1026,7 +1028,7 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Returns the integral value that is nearest to [code]s[/code], with halfway cases rounded away from zero.
+ Rounds [code]s[/code] to the nearest whole number, with halfway cases rounded away from zero.
[codeblock]
round(2.6) # Returns 3
[/codeblock]
@@ -1108,10 +1110,11 @@
<argument index="0" name="s" type="float">
</argument>
<description>
- Returns the square root of [code]s[/code].
+ Returns the square root of [code]s[/code], where [code]s[/code] is a non-negative number.
[codeblock]
sqrt(9) # Returns 3
[/codeblock]
+ If you need negative inputs, use [code]System.Numerics.Complex[/code] in C#.
</description>
</method>
<method name="step_decimals">
@@ -1312,27 +1315,19 @@
Wraps float [code]value[/code] between [code]min[/code] and [code]max[/code].
Usable for creating loop-alike behavior or infinite surfaces.
[codeblock]
- # a is 0.5
- a = wrapf(10.5, 0.0, 10.0)
- [/codeblock]
- [codeblock]
- # a is 9.5
- a = wrapf(-0.5, 0.0, 10.0)
- [/codeblock]
- [codeblock]
- # Infinite loop between 0.0 and 0.99
- f = wrapf(f + 0.1, 0.0, 1.0)
+ # Infinite loop between 5.0 and 9.9
+ value = wrapf(value + 0.1, 5.0, 10.0)
[/codeblock]
[codeblock]
# Infinite rotation (in radians)
angle = wrapf(angle + 0.1, 0.0, TAU)
[/codeblock]
- [b]Note:[/b] If you just want to wrap between 0.0 and [code]n[/code] (where [code]n[/code] is a positive floating-point value), it is better for performance to use the [method fmod] method like [code]fmod(number, n)[/code].
- [code]wrapf[/code] is more flexible than using the [method fmod] approach by giving the user a simple control over the minimum value. It also fully supports negative numbers, e.g.
[codeblock]
# Infinite rotation (in radians)
angle = wrapf(angle + 0.1, -PI, PI)
[/codeblock]
+ [b]Note:[/b] If [code]min[/code] is [code]0[/code], this is equivalent to [method fposmod], so prefer using that instead.
+ [code]wrapf[/code] is more flexible than using the [method fposmod] approach by giving the user control over the minimum value.
</description>
</method>
<method name="wrapi">
@@ -1348,23 +1343,15 @@
Wraps integer [code]value[/code] between [code]min[/code] and [code]max[/code].
Usable for creating loop-alike behavior or infinite surfaces.
[codeblock]
- # a is 0
- a = wrapi(10, 0, 10)
- [/codeblock]
- [codeblock]
- # a is 9
- a = wrapi(-1, 0, 10)
- [/codeblock]
- [codeblock]
- # Infinite loop between 0 and 9
- frame = wrapi(frame + 1, 0, 10)
+ # Infinite loop between 5 and 9
+ frame = wrapi(frame + 1, 5, 10)
[/codeblock]
- [b]Note:[/b] If you just want to wrap between 0 and [code]n[/code] (where [code]n[/code] is a positive integer value), it is better for performance to use the modulo operator like [code]number % n[/code].
- [code]wrapi[/code] is more flexible than using the modulo approach by giving the user a simple control over the minimum value. It also fully supports negative numbers, e.g.
[codeblock]
# result is -2
var result = wrapi(-6, -5, -1)
[/codeblock]
+ [b]Note:[/b] If [code]min[/code] is [code]0[/code], this is equivalent to [method posmod], so prefer using that instead.
+ [code]wrapi[/code] is more flexible than using the [method posmod] approach by giving the user control over the minimum value.
</description>
</method>
<method name="yield">
@@ -1406,17 +1393,16 @@
</methods>
<constants>
<constant name="PI" value="3.141593">
- Constant that represents how many times the diameter of a circle fits around its perimeter.
+ Constant that represents how many times the diameter of a circle fits around its perimeter. This is equivalent to [code]TAU / 2[/code].
</constant>
<constant name="TAU" value="6.283185">
- The circle constant, the circumference of the unit circle.
+ The circle constant, the circumference of the unit circle in radians.
</constant>
<constant name="INF" value="inf">
- A positive infinity. (For negative infinity, use -INF).
+ Positive infinity. For negative infinity, use -INF.
</constant>
<constant name="NAN" value="nan">
- Macro constant that expands to an expression of type float that represents a NaN.
- The NaN values are used to identify undefined or non-representable values for floating-point elements, such as the square root of negative numbers or the result of 0/0.
+ "Not a Number", an invalid value. [code]NaN[/code] has special properties, including that it is not equal to itself. It is output by some invalid operations, such as dividing zero by zero.
</constant>
</constants>
</class>
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs
index 3173a21986..d851abc6d3 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs
@@ -486,7 +486,7 @@ namespace Godot
}
/// <summary>
- /// Constructs a color from RGB values on the range of 0 to 1.
+ /// Constructs a color from RGBA values on the range of 0 to 1.
/// </summary>
/// <param name="r">The color's red component, typically on the range of 0 to 1.</param>
/// <param name="g">The color's green component, typically on the range of 0 to 1.</param>
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs
index af0d474bae..3b4e749532 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs
@@ -20,8 +20,9 @@ namespace Godot
private Vector3 _normal;
/// <summary>
- /// The normal of the plane (in the plane equation: a, b, and c).
- /// The normal vector must be normalized.
+ /// The normal of the plane, which must be normalized.
+ /// In the scalar equation of the plane `ax + by + cz = d`, this is
+ /// the vector `(a, b, c)`, where `d` is the <see cref="D"/> property.
/// </summary>
/// <value>Equivalent to `x`, `y`, and `z`.</value>
public Vector3 Normal
@@ -81,6 +82,9 @@ namespace Godot
/// <summary>
/// The distance from the origin to the plane (in the direction of
/// <see cref="Normal"/>). This value is typically non-negative.
+ /// In the scalar equation of the plane `ax + by + cz = d`,
+ /// this is `d`, while the `(a, b, c)` coordinates are represented
+ /// by the <see cref="Normal"/> property.
/// </summary>
/// <value>The plane's distance from the origin.</value>
public real_t D { get; set; }
diff --git a/platform/android/android_keys_utils.h b/platform/android/android_keys_utils.h
index fb442f4c54..857bef02d1 100644
--- a/platform/android/android_keys_utils.h
+++ b/platform/android/android_keys_utils.h
@@ -148,6 +148,8 @@ enum {
AKEYCODE_BUTTON_START = 108,
AKEYCODE_BUTTON_SELECT = 109,
AKEYCODE_BUTTON_MODE = 110,
+ AKEYCODE_CONTROL_LEFT = 113,
+ AKEYCODE_CONTROL_RIGHT = 114,
// NOTE: If you add a new keycode here you must also add it to several other files.
// Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.
@@ -246,6 +248,8 @@ static _WinTranslatePair _ak_to_keycode[] = {
{ KEY_BACKSLASH, AKEYCODE_BACKSLASH },
{ KEY_BRACKETLEFT, AKEYCODE_LEFT_BRACKET },
{ KEY_BRACKETRIGHT, AKEYCODE_RIGHT_BRACKET },
+ { KEY_CONTROL, AKEYCODE_CONTROL_LEFT },
+ { KEY_CONTROL, AKEYCODE_CONTROL_RIGHT },
{ KEY_UNKNOWN, 0 }
};
/*
diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp
index 3bc9e6d876..7193519a52 100644
--- a/platform/android/display_server_android.cpp
+++ b/platform/android/display_server_android.cpp
@@ -486,17 +486,40 @@ void DisplayServerAndroid::process_joy_event(DisplayServerAndroid::JoypadEvent p
}
}
+void DisplayServerAndroid::_set_key_modifier_state(Ref<InputEventWithModifiers> ev) {
+ ev->set_shift(shift_mem);
+ ev->set_alt(alt_mem);
+ ev->set_metakey(meta_mem);
+ ev->set_control(control_mem);
+}
+
void DisplayServerAndroid::process_key_event(int p_keycode, int p_scancode, int p_unicode_char, bool p_pressed) {
Ref<InputEventKey> ev;
ev.instance();
int val = p_unicode_char;
int keycode = android_get_keysym(p_keycode);
int phy_keycode = android_get_keysym(p_scancode);
+
+ if (keycode == KEY_SHIFT) {
+ shift_mem = p_pressed;
+ }
+ if (keycode == KEY_ALT) {
+ alt_mem = p_pressed;
+ }
+ if (keycode == KEY_CONTROL) {
+ control_mem = p_pressed;
+ }
+ if (keycode == KEY_META) {
+ meta_mem = p_pressed;
+ }
+
ev->set_keycode(keycode);
ev->set_physical_keycode(phy_keycode);
ev->set_unicode(val);
ev->set_pressed(p_pressed);
+ _set_key_modifier_state(ev);
+
if (val == '\n') {
ev->set_keycode(KEY_ENTER);
} else if (val == 61448) {
@@ -629,6 +652,7 @@ void DisplayServerAndroid::process_hover(int p_type, Point2 p_pos) {
case 10: { // hover exit
Ref<InputEventMouseMotion> ev;
ev.instance();
+ _set_key_modifier_state(ev);
ev->set_position(p_pos);
ev->set_global_position(p_pos);
ev->set_relative(p_pos - hover_prev_pos);
@@ -641,6 +665,7 @@ void DisplayServerAndroid::process_hover(int p_type, Point2 p_pos) {
void DisplayServerAndroid::process_double_tap(Point2 p_pos) {
Ref<InputEventMouseButton> ev;
ev.instance();
+ _set_key_modifier_state(ev);
ev->set_position(p_pos);
ev->set_global_position(p_pos);
ev->set_pressed(false);
@@ -651,6 +676,7 @@ void DisplayServerAndroid::process_double_tap(Point2 p_pos) {
void DisplayServerAndroid::process_scroll(Point2 p_pos) {
Ref<InputEventPanGesture> ev;
ev.instance();
+ _set_key_modifier_state(ev);
ev->set_position(p_pos);
ev->set_delta(p_pos - scroll_prev_pos);
Input::get_singleton()->parse_input_event(ev);
diff --git a/platform/android/display_server_android.h b/platform/android/display_server_android.h
index d64542df58..4cae52fa76 100644
--- a/platform/android/display_server_android.h
+++ b/platform/android/display_server_android.h
@@ -63,6 +63,11 @@ public:
private:
String rendering_driver;
+ bool alt_mem = false;
+ bool shift_mem = false;
+ bool control_mem = false;
+ bool meta_mem = false;
+
bool keep_screen_on;
Vector<TouchPos> touch;
@@ -84,6 +89,8 @@ private:
static void _dispatch_input_events(const Ref<InputEvent> &p_event);
+ void _set_key_modifier_state(Ref<InputEventWithModifiers> ev);
+
public:
static DisplayServerAndroid *get_singleton();
diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotGLRenderView.java b/platform/android/java/lib/src/org/godotengine/godot/GodotGLRenderView.java
index 4da2f31250..d169f46599 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/GodotGLRenderView.java
+++ b/platform/android/java/lib/src/org/godotengine/godot/GodotGLRenderView.java
@@ -117,6 +117,11 @@ public class GodotGLRenderView extends GLSurfaceView implements GodotRenderView
godot.onBackPressed();
}
+ @Override
+ public GodotInputHandler getInputHandler() {
+ return inputHandler;
+ }
+
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent event) {
diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotRenderView.java b/platform/android/java/lib/src/org/godotengine/godot/GodotRenderView.java
index 27e63f3a66..68b8a16641 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/GodotRenderView.java
+++ b/platform/android/java/lib/src/org/godotengine/godot/GodotRenderView.java
@@ -30,6 +30,8 @@
package org.godotengine.godot;
+import org.godotengine.godot.input.GodotInputHandler;
+
import android.view.SurfaceView;
public interface GodotRenderView {
@@ -43,4 +45,6 @@ public interface GodotRenderView {
abstract public void onActivityResumed();
abstract public void onBackPressed();
+
+ abstract public GodotInputHandler getInputHandler();
}
diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotVulkanRenderView.java b/platform/android/java/lib/src/org/godotengine/godot/GodotVulkanRenderView.java
index aace593bae..65708389c3 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/GodotVulkanRenderView.java
+++ b/platform/android/java/lib/src/org/godotengine/godot/GodotVulkanRenderView.java
@@ -90,6 +90,11 @@ public class GodotVulkanRenderView extends VkSurfaceView implements GodotRenderV
godot.onBackPressed();
}
+ @Override
+ public GodotInputHandler getInputHandler() {
+ return mInputHandler;
+ }
+
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent event) {
diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java b/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java
index 7f596575a8..c0defd008e 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java
+++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java
@@ -155,14 +155,35 @@ public class GodotEditText extends EditText {
// ===========================================================
@Override
public boolean onKeyDown(final int keyCode, final KeyEvent keyEvent) {
- super.onKeyDown(keyCode, keyEvent);
-
- /* Let GlSurfaceView get focus if back key is input. */
+ /* Let SurfaceView get focus if back key is input. */
if (keyCode == KeyEvent.KEYCODE_BACK) {
mRenderView.getView().requestFocus();
}
- return true;
+ // pass event to godot in special cases
+ if (needHandlingInGodot(keyCode, keyEvent) && mRenderView.getInputHandler().onKeyDown(keyCode, keyEvent)) {
+ return true;
+ } else {
+ return super.onKeyDown(keyCode, keyEvent);
+ }
+ }
+
+ @Override
+ public boolean onKeyUp(int keyCode, KeyEvent keyEvent) {
+ if (needHandlingInGodot(keyCode, keyEvent) && mRenderView.getInputHandler().onKeyUp(keyCode, keyEvent)) {
+ return true;
+ } else {
+ return super.onKeyUp(keyCode, keyEvent);
+ }
+ }
+
+ private boolean needHandlingInGodot(int keyCode, KeyEvent keyEvent) {
+ boolean isArrowKey = keyCode == KeyEvent.KEYCODE_DPAD_UP || keyCode == KeyEvent.KEYCODE_DPAD_DOWN ||
+ keyCode == KeyEvent.KEYCODE_DPAD_LEFT || keyCode == KeyEvent.KEYCODE_DPAD_RIGHT;
+ boolean isModifiedKey = keyEvent.isAltPressed() || keyEvent.isCtrlPressed() || keyEvent.isSymPressed() ||
+ keyEvent.isFunctionPressed() || keyEvent.isMetaPressed();
+ return isArrowKey || keyCode == KeyEvent.KEYCODE_TAB || KeyEvent.isModifierKey(keyCode) ||
+ isModifiedKey;
}
// ===========================================================
diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp
index 21b3bcec30..874a3a6392 100644
--- a/platform/linuxbsd/display_server_x11.cpp
+++ b/platform/linuxbsd/display_server_x11.cpp
@@ -2372,7 +2372,7 @@ void DisplayServerX11::process_events() {
uint64_t delta = OS::get_singleton()->get_ticks_msec() - time_since_no_focus;
if (delta > 250) {
- //X11 can go between windows and have no focus for a while, when creating them or something else. Use this as safety to avoid unnecesary focus in/outs.
+ //X11 can go between windows and have no focus for a while, when creating them or something else. Use this as safety to avoid unnecessary focus in/outs.
if (OS::get_singleton()->get_main_loop()) {
OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_APPLICATION_FOCUS_OUT);
}
@@ -3332,7 +3332,7 @@ DisplayServerX11::WindowID DisplayServerX11::_create_window(WindowMode p_mode, u
if (make_utility) {
//this one seems to disable the fade animations for regular windows
//but has the drawback that will not get focus by default, so
- //we need fo force it, unless no focus requested
+ //we need to force it, unless no focus requested
Atom type_atom = XInternAtom(x11_display, "_NET_WM_WINDOW_TYPE_UTILITY", False);
Atom wt_atom = XInternAtom(x11_display, "_NET_WM_WINDOW_TYPE", False);
diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm
index baecb260b5..5e209a6e6b 100644
--- a/platform/osx/display_server_osx.mm
+++ b/platform/osx/display_server_osx.mm
@@ -2782,7 +2782,7 @@ void DisplayServerOSX::window_set_flag(WindowFlags p_flag, bool p_enabled, Windo
switch (p_flag) {
case WINDOW_FLAG_RESIZE_DISABLED: {
wd.resize_disabled = p_enabled;
- if (wd.fullscreen) { //fullscreen window should be resizable, style will be applyed on exiting fs
+ if (wd.fullscreen) { //fullscreen window should be resizable, style will be applied on exiting fs
return;
}
if (p_enabled) {
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index 0251ffe664..6ee9b6d698 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -170,7 +170,7 @@ void DisplayServerWindows::clipboard_set(const String &p_text) {
// Convert LF line endings to CRLF in clipboard content
// Otherwise, line endings won't be visible when pasted in other software
- String text = p_text.replace("\n", "\r\n");
+ String text = p_text.replace("\r\n", "\n").replace("\n", "\r\n"); // avoid \r\r\n
if (!OpenClipboard(windows[last_focused_window].hWnd)) {
ERR_FAIL_MSG("Unable to open clipboard.");
diff --git a/scene/3d/navigation_3d.cpp b/scene/3d/navigation_3d.cpp
index 07a4824c28..851966db2b 100644
--- a/scene/3d/navigation_3d.cpp
+++ b/scene/3d/navigation_3d.cpp
@@ -109,7 +109,7 @@ Navigation3D::Navigation3D() {
map = NavigationServer3D::get_singleton()->map_create();
set_cell_size(0.3);
- set_edge_connection_margin(5.0); // Five meters, depends alot on the agents radius
+ set_edge_connection_margin(5.0); // Five meters, depends a lot on the agent's radius
up = Vector3(0, 1, 0);
}
diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp
index 72ae75b236..fc021e5532 100644
--- a/scene/3d/physics_body_3d.cpp
+++ b/scene/3d/physics_body_3d.cpp
@@ -358,6 +358,7 @@ void RigidBody3D::_direct_state_changed(Object *p_state) {
set_global_transform(state->get_transform());
linear_velocity = state->get_linear_velocity();
angular_velocity = state->get_angular_velocity();
+ inverse_inertia_tensor = state->get_inverse_inertia_tensor();
if (sleeping != state->is_sleeping()) {
sleeping = state->is_sleeping();
emit_signal(SceneStringNames::get_singleton()->sleeping_state_changed);
@@ -594,6 +595,10 @@ Vector3 RigidBody3D::get_angular_velocity() const {
return angular_velocity;
}
+Basis RigidBody3D::get_inverse_inertia_tensor() {
+ return inverse_inertia_tensor;
+}
+
void RigidBody3D::set_use_custom_integrator(bool p_enable) {
if (custom_integrator == p_enable) {
return;
@@ -760,6 +765,8 @@ void RigidBody3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_angular_velocity", "angular_velocity"), &RigidBody3D::set_angular_velocity);
ClassDB::bind_method(D_METHOD("get_angular_velocity"), &RigidBody3D::get_angular_velocity);
+ ClassDB::bind_method(D_METHOD("get_inverse_inertia_tensor"), &RigidBody3D::get_inverse_inertia_tensor);
+
ClassDB::bind_method(D_METHOD("set_gravity_scale", "gravity_scale"), &RigidBody3D::set_gravity_scale);
ClassDB::bind_method(D_METHOD("get_gravity_scale"), &RigidBody3D::get_gravity_scale);
diff --git a/scene/3d/physics_body_3d.h b/scene/3d/physics_body_3d.h
index 413b587fc4..9830a55183 100644
--- a/scene/3d/physics_body_3d.h
+++ b/scene/3d/physics_body_3d.h
@@ -123,6 +123,7 @@ protected:
Vector3 linear_velocity;
Vector3 angular_velocity;
+ Basis inverse_inertia_tensor;
real_t gravity_scale;
real_t linear_damp;
real_t angular_damp;
@@ -201,6 +202,8 @@ public:
void set_angular_velocity(const Vector3 &p_velocity);
Vector3 get_angular_velocity() const override;
+ Basis get_inverse_inertia_tensor();
+
void set_gravity_scale(real_t p_gravity_scale);
real_t get_gravity_scale() const;
diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp
index 75d04dba61..191110a669 100644
--- a/scene/gui/box_container.cpp
+++ b/scene/gui/box_container.cpp
@@ -96,7 +96,7 @@ void BoxContainer::_resort() {
}
stretch_avail += stretch_diff; //available stretch space.
- /** Second, pass sucessively to discard elements that can't be stretched, this will run while stretchable
+ /** Second, pass successively to discard elements that can't be stretched, this will run while stretchable
elements exist */
bool has_stretched = false;
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 331cffed5d..5681613c04 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -2079,7 +2079,7 @@ Error StreamTextureLayered::_load_data(const String &p_path, Vector<Ref<Image>>
uint32_t df = f->get_32(); //data format
mipmap_limit = int(f->get_32());
- //reserverd
+ //reserved
f->get_32();
f->get_32();
f->get_32();
diff --git a/servers/display_server.cpp b/servers/display_server.cpp
index 65db0de001..f46e56cd5a 100644
--- a/servers/display_server.cpp
+++ b/servers/display_server.cpp
@@ -223,7 +223,7 @@ void DisplayServer::virtual_keyboard_hide() {
// returns height of the currently shown keyboard (0 if keyboard is hidden)
int DisplayServer::virtual_keyboard_get_height() const {
- ERR_FAIL_V_MSG(0, "Virtual keyboad not supported by this display server.");
+ ERR_FAIL_V_MSG(0, "Virtual keyboard not supported by this display server.");
}
void DisplayServer::cursor_set_shape(CursorShape p_shape) {
diff --git a/servers/rendering/rasterizer_rd/rasterizer_effects_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_effects_rd.cpp
index 3f594ab264..e620ad954d 100644
--- a/servers/rendering/rasterizer_rd/rasterizer_effects_rd.cpp
+++ b/servers/rendering/rasterizer_rd/rasterizer_effects_rd.cpp
@@ -508,7 +508,7 @@ void RasterizerEffectsRD::screen_space_reflection(RID p_diffuse, RID p_normal_ro
}
if (p_roughness_quality != RS::ENV_SSR_ROUGNESS_QUALITY_DISABLED) {
- //blurr
+ //blur
RD::get_singleton()->compute_list_add_barrier(compute_list);
diff --git a/servers/rendering/rasterizer_rd/rasterizer_scene_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_scene_rd.cpp
index 495513d019..3854f4c2a4 100644
--- a/servers/rendering/rasterizer_rd/rasterizer_scene_rd.cpp
+++ b/servers/rendering/rasterizer_rd/rasterizer_scene_rd.cpp
@@ -925,7 +925,7 @@ void RasterizerSceneRD::sdfgi_update(RID p_render_buffers, RID p_environment, co
if (i < sdfgi->cascades.size() - 1) {
parent_average = sdfgi->cascades[i + 1].lightprobe_average_tex;
} else {
- parent_average = sdfgi->cascades[i - 1].lightprobe_average_tex; //to use something, but it wont be used
+ parent_average = sdfgi->cascades[i - 1].lightprobe_average_tex; //to use something, but it won't be used
}
u.ids.push_back(parent_average);
uniforms.push_back(u);
@@ -1881,7 +1881,7 @@ void RasterizerSceneRD::_update_dirty_skys() {
texture_set_dirty = true;
}
- // Create subpass buffers if they havent been created already
+ // Create subpass buffers if they haven't been created already
if (sky->half_res_pass.is_null() && !RD::get_singleton()->texture_is_valid(sky->half_res_pass) && sky->screen_size.x >= 4 && sky->screen_size.y >= 4) {
RD::TextureFormat tformat;
tformat.format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT;
@@ -5962,7 +5962,7 @@ void RasterizerSceneRD::render_sdfgi(RID p_render_buffers, int p_region, Instanc
uint32_t dispatch_indirct_data[4] = { 0, 0, 0, 0 };
RD::get_singleton()->buffer_update(rb->sdfgi->cascades[cascade].solid_cell_dispatch_buffer, 0, sizeof(uint32_t) * 4, dispatch_indirct_data, true);
- bool half_size = true; //much faster, very little differnce
+ bool half_size = true; //much faster, very little difference
static const int optimized_jf_group_size = 8;
if (half_size) {
@@ -6112,7 +6112,7 @@ void RasterizerSceneRD::render_sdfgi(RID p_render_buffers, int p_region, Instanc
push_constant.occlusion_index = i;
RD::get_singleton()->compute_list_set_push_constant(compute_list, &push_constant, sizeof(SDGIShader::PreprocessPushConstant));
- Vector3i groups = Vector3i(probe_size + 1, probe_size + 1, probe_size + 1) - offset; //if offseted, its one less probe per axis to compute
+ Vector3i groups = Vector3i(probe_size + 1, probe_size + 1, probe_size + 1) - offset; //if offset, it's one less probe per axis to compute
RD::get_singleton()->compute_list_dispatch(compute_list, groups.x, groups.y, groups.z);
}
RD::get_singleton()->compute_list_add_barrier(compute_list);
diff --git a/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp
index 8f3e2c25f9..102e0e2eed 100644
--- a/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp
+++ b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp
@@ -899,10 +899,10 @@ Ref<Image> RasterizerStorageRD::texture_3d_slice_get(RID p_texture, int p_depth,
void RasterizerStorageRD::texture_replace(RID p_texture, RID p_by_texture) {
Texture *tex = texture_owner.getornull(p_texture);
ERR_FAIL_COND(!tex);
- ERR_FAIL_COND(tex->proxy_to.is_valid()); //cant replace proxy
+ ERR_FAIL_COND(tex->proxy_to.is_valid()); //can't replace proxy
Texture *by_tex = texture_owner.getornull(p_by_texture);
ERR_FAIL_COND(!by_tex);
- ERR_FAIL_COND(by_tex->proxy_to.is_valid()); //cant replace proxy
+ ERR_FAIL_COND(by_tex->proxy_to.is_valid()); //can't replace proxy
if (tex == by_tex) {
return;
@@ -5276,7 +5276,7 @@ void RasterizerStorageRD::global_variable_add(const StringName &p_name, RS::Glob
if (p_type >= RS::GLOBAL_VAR_TYPE_SAMPLER2D) {
//is texture
- global_variables.must_update_texture_materials = true; //normally ther are no
+ global_variables.must_update_texture_materials = true; //normally there are none
} else {
gv.buffer_elements = 1;
if (p_type == RS::GLOBAL_VAR_TYPE_COLOR || p_type == RS::GLOBAL_VAR_TYPE_MAT2) {
@@ -5299,7 +5299,7 @@ void RasterizerStorageRD::global_variable_add(const StringName &p_name, RS::Glob
_global_variable_store_in_buffer(gv.buffer_index, gv.type, gv.value);
_global_variable_mark_buffer_dirty(gv.buffer_index, gv.buffer_elements);
- global_variables.must_update_buffer_materials = true; //normally ther are no
+ global_variables.must_update_buffer_materials = true; //normally there are none
}
global_variables.variables[p_name] = gv;
diff --git a/servers/rendering/rendering_device_binds.cpp b/servers/rendering/rendering_device_binds.cpp
index 0400cebfdc..af9ecef0dd 100644
--- a/servers/rendering/rendering_device_binds.cpp
+++ b/servers/rendering/rendering_device_binds.cpp
@@ -135,7 +135,7 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, const String
//process include
String include = line.replace("#include", "").strip_edges();
if (!include.begins_with("\"") || !include.ends_with("\"")) {
- base_error = "Malformed #include syntax, expected #include \"<path>\", found instad: " + include;
+ base_error = "Malformed #include syntax, expected #include \"<path>\", found instead: " + include;
break;
}
include = include.substr(1, include.length() - 2).strip_edges();