Merge pull request #63698 from PrecisionRender/plane-operator-asterisk

Add operator `*` to `Plane`
This commit is contained in:
Rémi Verschelde 2022-08-06 00:38:59 +02:00 committed by GitHub
commit dc04050cfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View file

@ -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);

View file

@ -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" />

View file

@ -215,6 +215,13 @@
Transforms (multiplies) each element of the [Vector3] array by the given [Transform3D] matrix.
</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" />