Move code for looking_at to Basis
This commit is contained in:
@@ -109,6 +109,15 @@
|
||||
Returns [code]true[/code] if this basis and [code]b[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
|
||||
</description>
|
||||
</method>
|
||||
<method name="looking_at" qualifiers="static">
|
||||
<return type="Basis" />
|
||||
<argument index="0" name="target" type="Vector3" />
|
||||
<argument index="1" name="up" type="Vector3" default="Vector3(0, 1, 0)" />
|
||||
<description>
|
||||
Creates a Basis with a rotation such that the forward axis (-Z) points towards the [code]target[/code] position.
|
||||
The up axis (+Y) points as close to the [code]up[/code] vector as possible while staying perpendicular to the forward axis. The resulting Basis is orthonormalized. The [code]target[/code] and [code]up[/code] vectors cannot be zero, and cannot be parallel to each other.
|
||||
</description>
|
||||
</method>
|
||||
<method name="operator !=" qualifiers="operator">
|
||||
<return type="bool" />
|
||||
<argument index="0" name="right" type="Basis" />
|
||||
|
||||
@@ -113,8 +113,9 @@
|
||||
<argument index="0" name="target" type="Vector3" />
|
||||
<argument index="1" name="up" type="Vector3" default="Vector3(0, 1, 0)" />
|
||||
<description>
|
||||
Rotates itself so that the local -Z axis points towards the [code]target[/code] position.
|
||||
The transform will first be rotated around the given [code]up[/code] vector, and then fully aligned to the target by a further rotation around an axis perpendicular to both the [code]target[/code] and [code]up[/code] vectors.
|
||||
Rotates the node so that the local forward axis (-Z) points toward the [code]target[/code] position.
|
||||
The local up axis (+Y) points as close to the [code]up[/code] vector as possible while staying perpendicular to the local forward axis. The resulting transform is orthogonal, and the scale is preserved. Non-uniform scaling may not work correctly.
|
||||
The [code]target[/code] position cannot be the same as the node's position, the [code]up[/code] vector cannot be zero, and the direction from the node's position to the [code]target[/code] vector cannot be parallel to the [code]up[/code] vector.
|
||||
Operations take place in global space.
|
||||
</description>
|
||||
</method>
|
||||
@@ -124,7 +125,7 @@
|
||||
<argument index="1" name="target" type="Vector3" />
|
||||
<argument index="2" name="up" type="Vector3" default="Vector3(0, 1, 0)" />
|
||||
<description>
|
||||
Moves the node to the specified [code]position[/code], and then rotates itself to point toward the [code]target[/code] as per [method look_at]. Operations take place in global space.
|
||||
Moves the node to the specified [code]position[/code], and then rotates the node to point toward the [code]target[/code] as per [method look_at]. Operations take place in global space.
|
||||
</description>
|
||||
</method>
|
||||
<method name="orthonormalize">
|
||||
|
||||
@@ -79,9 +79,8 @@
|
||||
<argument index="0" name="target" type="Vector3" />
|
||||
<argument index="1" name="up" type="Vector3" default="Vector3(0, 1, 0)" />
|
||||
<description>
|
||||
Returns a copy of the transform rotated such that its -Z axis points towards the [code]target[/code] position.
|
||||
The transform will first be rotated around the given [code]up[/code] vector, and then fully aligned to the target by a further rotation around an axis perpendicular to both the [code]target[/code] and [code]up[/code] vectors.
|
||||
Operations take place in global space.
|
||||
Returns a copy of the transform rotated such that the forward axis (-Z) points towards the [code]target[/code] position.
|
||||
The up axis (+Y) points as close to the [code]up[/code] vector as possible while staying perpendicular to the forward axis. The resulting transform is orthonormalized. The existing rotation, scale, and skew information from the original transform is discarded. The [code]target[/code] and [code]up[/code] vectors cannot be zero, cannot be parallel to each other, and are defined in global/parent space.
|
||||
</description>
|
||||
</method>
|
||||
<method name="operator !=" qualifiers="operator">
|
||||
|
||||
Reference in New Issue
Block a user