mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-08 10:10:54 +03:00
Update tutorials: Rename Transform to Transform3D (#5603)
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user