Skip to content

Commit 509cf61

Browse files
committed
Add note for some usages of Plane in APIs
Some old APIs that may expect a Vector4 instead require a Plane: this is pretty confusing especially with tangents as one could interpret the API as wanting a value directly representing the tangent plane when in reality the Plane type is just used to carry one Vector3 and one extra sign component. This commit attempts to clear any potential confusion by adding a note to the APIs using Planes in such a way.
1 parent 2b832e9 commit 509cf61

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

doc/classes/ImmediateMesh.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
<param index="0" name="tangent" type="Plane" />
8484
<description>
8585
Set the tangent attribute that will be pushed with the next vertex.
86+
[b]Note:[/b] Even though [param tangent] is a [Plane], it does not directly represent the tangent plane. Its [member Plane.x], [member Plane.y], and [member Plane.z] represent the tangent vector and [member Plane.d] should be either [code]-1[/code] or [code]1[/code]. See also [constant Mesh.ARRAY_TANGENT].
8687
</description>
8788
</method>
8889
<method name="surface_set_uv">

doc/classes/MeshDataTool.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@
318318
<param index="1" name="tangent" type="Plane" />
319319
<description>
320320
Sets the tangent of the given vertex.
321+
[b]Note:[/b] Even though [param tangent] is a [Plane], it does not directly represent the tangent plane. Its [member Plane.x], [member Plane.y], and [member Plane.z] represent the tangent vector and [member Plane.d] should be either [code]-1[/code] or [code]1[/code]. See also [constant Mesh.ARRAY_TANGENT].
321322
</description>
322323
</method>
323324
<method name="set_vertex_uv">

doc/classes/SurfaceTool.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@
258258
<param index="0" name="tangent" type="Plane" />
259259
<description>
260260
Specifies a tangent to use for the [i]next[/i] vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all.
261+
[b]Note:[/b] Even though [param tangent] is a [Plane], it does not directly represent the tangent plane. Its [member Plane.x], [member Plane.y], and [member Plane.z] represent the tangent vector and [member Plane.d] should be either [code]-1[/code] or [code]1[/code]. See also [constant Mesh.ARRAY_TANGENT].
261262
</description>
262263
</method>
263264
<method name="set_uv">

0 commit comments

Comments
 (0)