From aaf6b3e504025fc02bd2e727274dc8dfa8aea92b Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Mon, 14 Feb 2022 13:27:37 +0100 Subject: [PATCH] Update tutorials: Rename Transform to Transform3D (#5603) --- _extensions/gdscript.py | 2 +- tutorials/3d/introduction_to_3d.rst | 2 +- tutorials/3d/using_transforms.rst | 2 +- tutorials/performance/using_multimesh.rst | 4 ++-- tutorials/performance/using_servers.rst | 2 +- .../vertex_animation/animating_thousands_of_fish.rst | 2 +- tutorials/physics/rigid_body.rst | 2 +- tutorials/scripting/gdscript/gdscript_basics.rst | 2 +- tutorials/shaders/shader_reference/shading_language.rst | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/_extensions/gdscript.py b/_extensions/gdscript.py index 390b4b0a0..ec69e78f7 100644 --- a/_extensions/gdscript.py +++ b/_extensions/gdscript.py @@ -265,7 +265,7 @@ class GDScriptLexer(RegexLexer): "Plane", "Quat", "Basis", - "Transform", + "Transform3D", "Color", "RID", "Object", diff --git a/tutorials/3d/introduction_to_3d.rst b/tutorials/3d/introduction_to_3d.rst index 3900c2d1f..33d520875 100644 --- a/tutorials/3d/introduction_to_3d.rst +++ b/tutorials/3d/introduction_to_3d.rst @@ -29,7 +29,7 @@ node for everything 3D. Spatial nodes have a local transform, which is relative to the parent node (as long as the parent node is also of **or inherits from** the type Spatial). This transform can be accessed as a 4×3 -:ref:`Transform `, or as 3 :ref:`Vector3 ` +:ref:`Transform3D `, or as 3 :ref:`Vector3 ` members representing location, Euler rotation (X, Y and Z angles) and scale. diff --git a/tutorials/3d/using_transforms.rst b/tutorials/3d/using_transforms.rst index 642292d54..19498867a 100644 --- a/tutorials/3d/using_transforms.rst +++ b/tutorials/3d/using_transforms.rst @@ -341,7 +341,7 @@ Example of looking around, FPS style: _rotationY += mouseMotion.Relative.y * LookAroundSpeed; // reset rotation - Transform transform = Transform; + Transform3D transform = Transform; transform.basis = Basis.Identity; Transform = transform; diff --git a/tutorials/performance/using_multimesh.rst b/tutorials/performance/using_multimesh.rst index 2acf529bb..e658985f1 100644 --- a/tutorials/performance/using_multimesh.rst +++ b/tutorials/performance/using_multimesh.rst @@ -70,7 +70,7 @@ efficient for millions of objects, but for a few thousands, GDScript should be f # Set the transform of the instances. for i in multimesh.visible_instance_count: - multimesh.set_instance_transform(i, Transform(Basis(), Vector3(i * 20, 0, 0))) + multimesh.set_instance_transform(i, Transform3D(Basis(), Vector3(i * 20, 0, 0))) .. code-tab:: csharp C# @@ -95,7 +95,7 @@ efficient for millions of objects, but for a few thousands, GDScript should be f // Set the transform of the instances. for (int i = 0; i < Multimesh.VisibleInstanceCount; i++) { - Multimesh.SetInstanceTransform(i, new Transform(Basis.Identity, new Vector3(i * 20, 0, 0))); + Multimesh.SetInstanceTransform(i, new Transform3D(Basis.Identity, new Vector3(i * 20, 0, 0))); } } } diff --git a/tutorials/performance/using_servers.rst b/tutorials/performance/using_servers.rst index 08fc86014..0cf0dda17 100644 --- a/tutorials/performance/using_servers.rst +++ b/tutorials/performance/using_servers.rst @@ -151,7 +151,7 @@ The 3D APIs are different from the 2D ones, so the instantiation API must be use mesh = load("res://mymesh.obj") RenderingServer.instance_set_base(instance, mesh) # Move the mesh around. - var xform = Transform(Basis(), Vector3(20, 100, 0)) + var xform = Transform3D(Basis(), Vector3(20, 100, 0)) RenderingServer.instance_set_transform(instance, xform) Creating a 2D RigidBody and moving a sprite with it diff --git a/tutorials/performance/vertex_animation/animating_thousands_of_fish.rst b/tutorials/performance/vertex_animation/animating_thousands_of_fish.rst index f0d4c3a67..0394dabd4 100644 --- a/tutorials/performance/vertex_animation/animating_thousands_of_fish.rst +++ b/tutorials/performance/vertex_animation/animating_thousands_of_fish.rst @@ -220,7 +220,7 @@ to loop over all the instances and set their transform to a random position. :: for i in range($School.multimesh.instance_count): - var position = Transform() + var position = Transform3D() position = position.translated(Vector3(randf() * 100 - 50, randf() * 50 - 25, randf() * 50 - 25)) $School.multimesh.set_instance_transform(i, position) diff --git a/tutorials/physics/rigid_body.rst b/tutorials/physics/rigid_body.rst index 8ba9572b7..862c7bb25 100644 --- a/tutorials/physics/rigid_body.rst +++ b/tutorials/physics/rigid_body.rst @@ -52,7 +52,7 @@ Here is a custom ``look_at()`` method that will work reliably with rigid bodies: class Body : RigidBody { - private void LookFollow(PhysicsDirectBodyState state, Transform currentTransform, Vector3 targetPosition) + private void LookFollow(PhysicsDirectBodyState state, Transform3D currentTransform, Vector3 targetPosition) { var upDir = new Vector3(0, 1, 0); var curDir = currentTransform.basis.Xform(new Vector3(0, 0, 1)); diff --git a/tutorials/scripting/gdscript/gdscript_basics.rst b/tutorials/scripting/gdscript/gdscript_basics.rst index 2d13b0af2..84540e0f7 100644 --- a/tutorials/scripting/gdscript/gdscript_basics.rst +++ b/tutorials/scripting/gdscript/gdscript_basics.rst @@ -549,7 +549,7 @@ and ``size``. Also contains an ``end`` field which is (``x``, ``y`` and ``z``) and can also be accessed as an array of 3D vectors. -:ref:`Transform ` +:ref:`Transform3D ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3D Transform contains a Basis field ``basis`` and a Vector3 field diff --git a/tutorials/shaders/shader_reference/shading_language.rst b/tutorials/shaders/shader_reference/shading_language.rst index faf092252..c32e5ee0c 100644 --- a/tutorials/shaders/shader_reference/shading_language.rst +++ b/tutorials/shaders/shader_reference/shading_language.rst @@ -797,7 +797,7 @@ table of the corresponding types: +-----------------+-----------+ | **Color** | **vec4** | +-----------------+-----------+ -| **Transform** | **mat4** | +| **Transform3D** | **mat4** | +-----------------+-----------+ | **Transform2D** | **mat4** | +-----------------+-----------+