From a60ab49aac6e5b624ba292c35b64766f050c67ba Mon Sep 17 00:00:00 2001 From: Paul Joannon Date: Sat, 21 Oct 2023 21:20:44 +0200 Subject: [PATCH] Fix some forgotten lowercase x/y/z --- getting_started/first_3d_game/09.adding_animations.rst | 2 +- tutorials/3d/using_transforms.rst | 4 ++++ tutorials/math/matrices_and_transforms.rst | 6 +++--- tutorials/math/vectors_advanced.rst | 4 ++-- tutorials/ui/size_and_anchors.rst | 8 ++++---- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/getting_started/first_3d_game/09.adding_animations.rst b/getting_started/first_3d_game/09.adding_animations.rst index 63235aecc..154ab3ed1 100644 --- a/getting_started/first_3d_game/09.adding_animations.rst +++ b/getting_started/first_3d_game/09.adding_animations.rst @@ -459,7 +459,7 @@ Here's the *Player* script. // Jumping. if (IsOnFloor() && Input.IsActionJustPressed("jump")) { - _targetVelocity.y += JumpImpulse; + _targetVelocity.Y += JumpImpulse; } // Iterate through all collisions that occurred this frame. diff --git a/tutorials/3d/using_transforms.rst b/tutorials/3d/using_transforms.rst index 3d7176178..c3e9f1136 100644 --- a/tutorials/3d/using_transforms.rst +++ b/tutorials/3d/using_transforms.rst @@ -158,13 +158,17 @@ It is possible to rotate a transform, either by multiplying its basis by another .. code-tab:: csharp + Transform3D transform = Transform; Vector3 axis = new Vector3(1, 0, 0); // Or Vector3.Right float rotationAmount = 0.1f; + // Rotate the transform around the X axis by 0.1 radians. transform.Basis = new Basis(axis, rotationAmount) * transform.Basis; // shortened transform.Basis = transform.Basis.Rotated(axis, rotationAmount); + Transform = transform; + A method in Node3D simplifies this: .. tabs:: diff --git a/tutorials/math/matrices_and_transforms.rst b/tutorials/math/matrices_and_transforms.rst index 3bc6fb12d..8d8bff775 100644 --- a/tutorials/math/matrices_and_transforms.rst +++ b/tutorials/math/matrices_and_transforms.rst @@ -85,8 +85,8 @@ To do this in code, we multiply each of the vectors: Transform2D t = Transform2D.Identity; // Scale - t.x *= 2; - t.y *= 2; + t.X *= 2; + t.Y *= 2; Transform = t; // Change the node's transform to what we calculated. If we wanted to return it to its original scale, we can multiply @@ -324,7 +324,7 @@ As an example, let's set Y to (1, 1): Transform2D t = Transform2D.Identity; // Shear by setting Y to (1, 1) - t.y = Vector2.One; + t.Y = Vector2.One; Transform = t; // Change the node's transform to what we calculated. .. note:: You can't set the raw values of a Transform2D in the editor, diff --git a/tutorials/math/vectors_advanced.rst b/tutorials/math/vectors_advanced.rst index 9bf304f25..f524fa9fb 100644 --- a/tutorials/math/vectors_advanced.rst +++ b/tutorials/math/vectors_advanced.rst @@ -189,9 +189,9 @@ degrees to either side: // Calculate vector from `a` to `b`. var dvec = pointA.DirectionTo(pointB); // Rotate 90 degrees. - var normal = new Vector2(dvec.y, -dvec.x); + var normal = new Vector2(dvec.Y, -dvec.X); // Alternatively (depending the desired side of the normal): - // var normal = new Vector2(-dvec.y, dvec.x); + // var normal = new Vector2(-dvec.Y, dvec.X); The rest is the same as the previous example. Either point_a or point_b will work, as they are in the same plane: diff --git a/tutorials/ui/size_and_anchors.rst b/tutorials/ui/size_and_anchors.rst index 38940cfbd..889f1a7dc 100644 --- a/tutorials/ui/size_and_anchors.rst +++ b/tutorials/ui/size_and_anchors.rst @@ -93,10 +93,10 @@ a TextureRect can be centered in its parent: var textureSize = rect.Texture.GetSize(); - rect.OffsetLeft = -textureSize.x / 2; - rect.OffsetRight = textureSize.x / 2; - rect.OffsetTop = -textureSize.y / 2; - rect.OffsetBottom = textureSize.y / 2; + rect.OffsetLeft = -textureSize.X / 2; + rect.OffsetRight = textureSize.X / 2; + rect.OffsetTop = -textureSize.Y / 2; + rect.OffsetBottom = textureSize.Y / 2; AddChild(rect); Setting each anchor to 0.5 moves the reference point for the margins to