From 9f3ae0adcd734a16c299cd0f023212478b3960d3 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Tue, 20 Jul 2021 23:32:00 -0400 Subject: Move code for looking_at to Basis --- doc/classes/Basis.xml | 9 +++++++++ doc/classes/Node3D.xml | 7 ++++--- doc/classes/Transform3D.xml | 5 ++--- 3 files changed, 15 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index 9a4dd15c63..8fab84d885 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -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. + + + + + + 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. + + diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml index 983d8961fb..49901dc4d9 100644 --- a/doc/classes/Node3D.xml +++ b/doc/classes/Node3D.xml @@ -113,8 +113,9 @@ - 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. @@ -124,7 +125,7 @@ - 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. diff --git a/doc/classes/Transform3D.xml b/doc/classes/Transform3D.xml index 53cdfd53c9..1c906f6a51 100644 --- a/doc/classes/Transform3D.xml +++ b/doc/classes/Transform3D.xml @@ -79,9 +79,8 @@ - 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. -- cgit v1.2.3