Merge pull request #83461 from kleonc/docs-multiplication-operators-doing-xform_inv

Clarify docs for operators performing `xform_inv`
This commit is contained in:
Rémi Verschelde 2023-10-17 16:13:09 +02:00
commit 8ff8d41f0b
No known key found for this signature in database
GPG Key ID: C3336907360768E1
10 changed files with 32 additions and 13 deletions

View File

@ -245,7 +245,9 @@
<return type="AABB" /> <return type="AABB" />
<param index="0" name="right" type="Transform3D" /> <param index="0" name="right" type="Transform3D" />
<description> <description>
Inversely transforms (multiplies) the [AABB] by the given [Transform3D] transformation matrix. Inversely transforms (multiplies) the [AABB] by the given [Transform3D] transformation matrix, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
[code]aabb * transform[/code] is equivalent to [code]transform.inverse() * aabb[/code]. See [method Transform3D.inverse].
For transforming by inverse of an affine transformation (e.g. with scaling) [code]transform.affine_inverse() * aabb[/code] can be used instead. See [method Transform3D.affine_inverse].
</description> </description>
</operator> </operator>
<operator name="operator =="> <operator name="operator ==">

View File

@ -204,7 +204,9 @@
<return type="PackedVector2Array" /> <return type="PackedVector2Array" />
<param index="0" name="right" type="Transform2D" /> <param index="0" name="right" type="Transform2D" />
<description> <description>
Transforms (multiplies) all vectors in the array by the [Transform2D] matrix. Returns a new [PackedVector2Array] with all vectors in this array inversely transformed (multiplied) by the given [Transform2D] transformation matrix, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
[code]array * transform[/code] is equivalent to [code]transform.inverse() * array[/code]. See [method Transform2D.inverse].
For transforming by inverse of an affine transformation (e.g. with scaling) [code]transform.affine_inverse() * array[/code] can be used instead. See [method Transform2D.affine_inverse].
</description> </description>
</operator> </operator>
<operator name="operator +"> <operator name="operator +">

View File

@ -203,7 +203,9 @@
<return type="PackedVector3Array" /> <return type="PackedVector3Array" />
<param index="0" name="right" type="Transform3D" /> <param index="0" name="right" type="Transform3D" />
<description> <description>
Transforms (multiplies) all vectors in the array by the [Transform3D] matrix. Returns a new [PackedVector3Array] with all vectors in this array inversely transformed (multiplied) by the given [Transform3D] transformation matrix, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
[code]array * transform[/code] is equivalent to [code]transform.inverse() * array[/code]. See [method Transform3D.inverse].
For transforming by inverse of an affine transformation (e.g. with scaling) [code]transform.affine_inverse() * array[/code] can be used instead. See [method Transform3D.affine_inverse].
</description> </description>
</operator> </operator>
<operator name="operator +"> <operator name="operator +">

View File

@ -193,6 +193,7 @@
<param index="0" name="right" type="Transform3D" /> <param index="0" name="right" type="Transform3D" />
<description> <description>
Inversely transforms (multiplies) the [Plane] by the given [Transform3D] transformation matrix. Inversely transforms (multiplies) the [Plane] by the given [Transform3D] transformation matrix.
[code]plane * transform[/code] is equivalent to [code]transform.affine_inverse() * plane[/code]. See [method Transform3D.affine_inverse].
</description> </description>
</operator> </operator>
<operator name="operator =="> <operator name="operator ==">

View File

@ -237,7 +237,9 @@
<return type="Rect2" /> <return type="Rect2" />
<param index="0" name="right" type="Transform2D" /> <param index="0" name="right" type="Transform2D" />
<description> <description>
Inversely transforms (multiplies) the [Rect2] by the given [Transform2D] transformation matrix. Inversely transforms (multiplies) the [Rect2] by the given [Transform2D] transformation matrix, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
[code]rect * transform[/code] is equivalent to [code]transform.inverse() * rect[/code]. See [method Transform2D.inverse].
For transforming by inverse of an affine transformation (e.g. with scaling) [code]transform.affine_inverse() * rect[/code] can be used instead. See [method Transform2D.affine_inverse].
</description> </description>
</operator> </operator>
<operator name="operator =="> <operator name="operator ==">

View File

@ -59,7 +59,7 @@
<method name="affine_inverse" qualifiers="const"> <method name="affine_inverse" qualifiers="const">
<return type="Transform2D" /> <return type="Transform2D" />
<description> <description>
Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling and translation. Returns the inverse of the transform, under the assumption that the basis is invertible (must have non-zero determinant).
</description> </description>
</method> </method>
<method name="basis_xform" qualifiers="const"> <method name="basis_xform" qualifiers="const">
@ -74,8 +74,10 @@
<return type="Vector2" /> <return type="Vector2" />
<param index="0" name="v" type="Vector2" /> <param index="0" name="v" type="Vector2" />
<description> <description>
Returns a vector transformed (multiplied) by the inverse basis matrix. Returns a vector transformed (multiplied) by the inverse basis matrix, under the assumption that the basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
This method does not account for translation (the origin vector). This method does not account for translation (the origin vector).
[code]transform.basis_xform_inv(vector)[/code] is equivalent to [code]transform.inverse().basis_xform(vector)[/code]. See [method inverse].
For non-orthonormal transforms (e.g. with scaling) use [code]transform.affine_inverse().basis_xform(vector)[/code] instead. See [method affine_inverse].
</description> </description>
</method> </method>
<method name="determinant" qualifiers="const"> <method name="determinant" qualifiers="const">
@ -120,7 +122,7 @@
<method name="inverse" qualifiers="const"> <method name="inverse" qualifiers="const">
<return type="Transform2D" /> <return type="Transform2D" />
<description> <description>
Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use [method affine_inverse] for transforms with scaling). Returns the inverse of the transform, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not). Use [method affine_inverse] for non-orthonormal transforms (e.g. with scaling).
</description> </description>
</method> </method>
<method name="is_conformal" qualifiers="const"> <method name="is_conformal" qualifiers="const">

View File

@ -59,7 +59,7 @@
<method name="affine_inverse" qualifiers="const"> <method name="affine_inverse" qualifiers="const">
<return type="Transform3D" /> <return type="Transform3D" />
<description> <description>
Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling and translation. Returns the inverse of the transform, under the assumption that the basis is invertible (must have non-zero determinant).
</description> </description>
</method> </method>
<method name="interpolate_with" qualifiers="const"> <method name="interpolate_with" qualifiers="const">
@ -73,7 +73,7 @@
<method name="inverse" qualifiers="const"> <method name="inverse" qualifiers="const">
<return type="Transform3D" /> <return type="Transform3D" />
<description> <description>
Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use [method affine_inverse] for transforms with scaling). Returns the inverse of the transform, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not). Use [method affine_inverse] for non-orthonormal transforms (e.g. with scaling).
</description> </description>
</method> </method>
<method name="is_equal_approx" qualifiers="const"> <method name="is_equal_approx" qualifiers="const">

View File

@ -419,7 +419,9 @@
<return type="Vector2" /> <return type="Vector2" />
<param index="0" name="right" type="Transform2D" /> <param index="0" name="right" type="Transform2D" />
<description> <description>
Inversely transforms (multiplies) the [Vector2] by the given [Transform2D] transformation matrix. Inversely transforms (multiplies) the [Vector2] by the given [Transform2D] transformation matrix, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
[code]vector * transform[/code] is equivalent to [code]transform.inverse() * vector[/code]. See [method Transform2D.inverse].
For transforming by inverse of an affine transformation (e.g. with scaling) [code]transform.affine_inverse() * vector[/code] can be used instead. See [method Transform2D.affine_inverse].
</description> </description>
</operator> </operator>
<operator name="operator *"> <operator name="operator *">

View File

@ -442,7 +442,9 @@
<return type="Vector3" /> <return type="Vector3" />
<param index="0" name="right" type="Basis" /> <param index="0" name="right" type="Basis" />
<description> <description>
Inversely transforms (multiplies) the [Vector3] by the given [Basis] matrix. Inversely transforms (multiplies) the [Vector3] by the given [Basis] matrix, under the assumption that the basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
[code]vector * basis[/code] is equivalent to [code]basis.transposed() * vector[/code]. See [method Basis.transposed].
For transforming by inverse of a non-orthonormal basis [code]basis.inverse() * vector[/code] can be used instead. See [method Basis.inverse].
</description> </description>
</operator> </operator>
<operator name="operator *"> <operator name="operator *">
@ -450,13 +452,16 @@
<param index="0" name="right" type="Quaternion" /> <param index="0" name="right" type="Quaternion" />
<description> <description>
Inversely transforms (multiplies) the [Vector3] by the given [Quaternion]. Inversely transforms (multiplies) the [Vector3] by the given [Quaternion].
[code]vector * quaternion[/code] is equivalent to [code]quaternion.inverse() * vector[/code]. See [method Quaternion.inverse].
</description> </description>
</operator> </operator>
<operator name="operator *"> <operator name="operator *">
<return type="Vector3" /> <return type="Vector3" />
<param index="0" name="right" type="Transform3D" /> <param index="0" name="right" type="Transform3D" />
<description> <description>
Inversely transforms (multiplies) the [Vector3] by the given [Transform3D] transformation matrix. Inversely transforms (multiplies) the [Vector3] by the given [Transform3D] transformation matrix, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
[code]vector * transform[/code] is equivalent to [code]transform.inverse() * vector[/code]. See [method Transform3D.inverse].
For transforming by inverse of an affine transformation (e.g. with scaling) [code]transform.affine_inverse() * vector[/code] can be used instead. See [method Transform3D.affine_inverse].
</description> </description>
</operator> </operator>
<operator name="operator *"> <operator name="operator *">

View File

@ -280,7 +280,8 @@
<return type="Vector4" /> <return type="Vector4" />
<param index="0" name="right" type="Projection" /> <param index="0" name="right" type="Projection" />
<description> <description>
Inversely transforms (multiplies) the [Vector4] by the given [Projection] matrix. Transforms (multiplies) the [Vector4] by the transpose of the given [Projection] matrix.
For transforming by inverse of a projection [code]projection.inverse() * vector[/code] can be used instead. See [method Projection.inverse].
</description> </description>
</operator> </operator>
<operator name="operator *"> <operator name="operator *">