Merge pull request #92117 from mart3323/godot-docs-basis-op-mul-vector
Fix example for Basis * Vector3 in documentation
This commit is contained in:
commit
3d9ee2d0d7
1 changed files with 6 additions and 4 deletions
|
@ -444,12 +444,14 @@
|
||||||
Transforms (multiplies) the [param right] vector by this basis, returning a [Vector3].
|
Transforms (multiplies) the [param right] vector by this basis, returning a [Vector3].
|
||||||
[codeblocks]
|
[codeblocks]
|
||||||
[gdscript]
|
[gdscript]
|
||||||
var my_basis = Basis(Vector3(1, 1, 1), Vector3(1, 1, 1), Vector3(0, 2, 5))
|
# Basis that swaps the X/Z axes and doubles the scale.
|
||||||
print(my_basis * Vector3(1, 2, 3)) # Prints (7, 3, 16)
|
var my_basis = Basis(Vector3(0, 2, 0), Vector3(2, 0, 0), Vector3(0, 0, 2))
|
||||||
|
print(my_basis * Vector3(1, 2, 3)) # Prints (4, 2, 6)
|
||||||
[/gdscript]
|
[/gdscript]
|
||||||
[csharp]
|
[csharp]
|
||||||
var myBasis = new Basis(new Vector3(1, 1, 1), new Vector3(1, 1, 1), new Vector3(0, 2, 5));
|
// Basis that swaps the X/Z axes and doubles the scale.
|
||||||
GD.Print(my_basis * new Vector3(1, 2, 3)); // Prints (7, 3, 16)
|
var myBasis = new Basis(new Vector3(0, 2, 0), new Vector3(2, 0, 0), new Vector3(0, 0, 2));
|
||||||
|
GD.Print(myBasis * new Vector3(1, 2, 3)); // Prints (4, 2, 6)
|
||||||
[/csharp]
|
[/csharp]
|
||||||
[/codeblocks]
|
[/codeblocks]
|
||||||
</description>
|
</description>
|
||||||
|
|
Loading…
Reference in a new issue