diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-06 00:38:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-06 00:38:59 +0200 |
commit | dc04050cfd187aed844654fed52b6cfcafa099c0 (patch) | |
tree | c66c329567991178ddd0678e18a319960485f79f | |
parent | 9e361bfaaf0cd9ca54f026b11a602702d7d6c418 (diff) | |
parent | 2adb67c3c5e2038dc9841f2166e33313c71f4502 (diff) |
Merge pull request #63698 from PrecisionRender/plane-operator-asterisk
Add operator `*` to `Plane`
-rw-r--r-- | core/variant/variant_op.cpp | 2 | ||||
-rw-r--r-- | doc/classes/Plane.xml | 7 | ||||
-rw-r--r-- | doc/classes/Transform3D.xml | 7 |
3 files changed, 16 insertions, 0 deletions
diff --git a/core/variant/variant_op.cpp b/core/variant/variant_op.cpp index 669e18b5f7..6cca7955ae 100644 --- a/core/variant/variant_op.cpp +++ b/core/variant/variant_op.cpp @@ -341,6 +341,8 @@ void Variant::_register_variant_operators() { register_op<OperatorEvaluatorXFormInv<Vector3, Vector3, Transform3D>>(Variant::OP_MULTIPLY, Variant::VECTOR3, Variant::TRANSFORM3D); register_op<OperatorEvaluatorXForm<::AABB, Transform3D, ::AABB>>(Variant::OP_MULTIPLY, Variant::TRANSFORM3D, Variant::AABB); register_op<OperatorEvaluatorXFormInv<::AABB, ::AABB, Transform3D>>(Variant::OP_MULTIPLY, Variant::AABB, Variant::TRANSFORM3D); + register_op<OperatorEvaluatorXForm<Plane, Transform3D, Plane>>(Variant::OP_MULTIPLY, Variant::TRANSFORM3D, Variant::PLANE); + register_op<OperatorEvaluatorXFormInv<Plane, Plane, Transform3D>>(Variant::OP_MULTIPLY, Variant::PLANE, Variant::TRANSFORM3D); register_op<OperatorEvaluatorXForm<Vector<Vector3>, Transform3D, Vector<Vector3>>>(Variant::OP_MULTIPLY, Variant::TRANSFORM3D, Variant::PACKED_VECTOR3_ARRAY); register_op<OperatorEvaluatorXFormInv<Vector<Vector3>, Vector<Vector3>, Transform3D>>(Variant::OP_MULTIPLY, Variant::PACKED_VECTOR3_ARRAY, Variant::TRANSFORM3D); diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index 32eb71f1c7..df9d25902b 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -179,6 +179,13 @@ [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable. </description> </operator> + <operator name="operator *"> + <return type="Plane" /> + <argument index="0" name="right" type="Transform3D" /> + <description> + Inversely transforms (multiplies) the [Plane] by the given [Transform3D] transformation matrix. + </description> + </operator> <operator name="operator =="> <return type="bool" /> <argument index="0" name="right" type="Plane" /> diff --git a/doc/classes/Transform3D.xml b/doc/classes/Transform3D.xml index 9b673701ae..cefc74867c 100644 --- a/doc/classes/Transform3D.xml +++ b/doc/classes/Transform3D.xml @@ -216,6 +216,13 @@ </description> </operator> <operator name="operator *"> + <return type="Plane" /> + <argument index="0" name="right" type="Plane" /> + <description> + Transforms (multiplies) the [Plane] by the given [Transform3D] transformation matrix. + </description> + </operator> + <operator name="operator *"> <return type="Transform3D" /> <argument index="0" name="right" type="Transform3D" /> <description> |