Update tutorials: Rename Transform to Transform3D (#5603)

This commit is contained in:
Markus Sauermann
2022-02-14 13:27:37 +01:00
committed by GitHub
parent 332401aac8
commit aaf6b3e504
9 changed files with 10 additions and 10 deletions

View File

@@ -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)));
}
}
}

View File

@@ -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

View File

@@ -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)