Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
RotationEditMode
Node3D.swift:25enum RotationEditMode
Cases
case euler
The rotation is edited using
Vector3
Euler angles.case quaternion
The rotation is edited using a
Quaternion
.case basis
The rotation is edited using a
Basis
. In this mode,scale
can’t be edited separately.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (60) members.
Type members
static let notificationEnterWorld: Int
Node3D
nodes receive this notification when they are registered to newWorld3D
resource.static let notificationExitWorld: Int
Node3D
nodes receive this notification when they are unregistered from currentWorld3D
resource.static let notificationLocalTransformChanged: Int
Node3D
nodes receive this notification when their local transform changes. This is not received when the transform of a parent node is changed.static let notificationTransformChanged: Int
Node3D
nodes receive this notification when their global transform changes. This means that either the current or a parent node changed its transform.static let notificationVisibilityChanged: Int
Node3D
nodes receive this notification when their visibility changes.class var godotClassName: StringName
Instance members
var basis: Basis
Direct access to the 3x3 basis of the
transform
property.var globalBasis: Basis
Global basis of this node. This is equivalent to
global_transform.basis
.var globalPosition: Vector3
Global position of this node. This is equivalent to
global_transform.origin
.var globalRotation: Vector3
Rotation part of the global transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle).
var globalRotationDegrees: Vector3
Helper property to access
globalRotation
in degrees instead of radians.var globalTransform: Transform3D
World3D space (global)
Transform3D
of this node.var position: Vector3
Local position or translation of this node relative to the parent. This is equivalent to
transform.origin
.var quaternion: Quaternion
Access to the node rotation as a
Quaternion
. This property is ideal for tweening complex rotations.var rotation: Vector3
Rotation part of the local transformation in radians, specified in terms of Euler angles. The angles construct a rotation in the order specified by the
rotationOrder
property.var rotationDegrees: Vector3
Helper property to access
rotation
in degrees instead of radians.var rotationEditMode: Node3D.RotationEditMode
Specify how rotation (and scale) will be presented in the editor.
var rotationOrder: EulerOrder
Specify the axis rotation order of the
rotation
property. The final orientation is constructed by rotating the Euler angles in the order specified by this property.var scale: Vector3
Scale part of the local transformation.
var topLevel: Bool
If
true
, the node will not inherit its transformations from its parent. Node transformations are only in global space.var transform: Transform3D
Local space
Transform3D
of this node, with respect to the parent node.var visibilityChanged: SimpleSignal
Emitted when node visibility changes.
var visibilityParent: NodePath
Defines the visibility range parent for this node and its subtree. The visibility parent must be a GeometryInstance3D. Any visual instance will only be visible if the visibility parent (and all of its visibility ancestors) is hidden by being closer to the camera than its own
visibilityRangeBegin
. Nodes hidden via thevisible
property are essentially removed from the visibility dependency tree, so dependent instances will not take the hidden node or its ancestors into account.var visible: Bool
If
true
, this node is drawn. The node is only visible if all of its ancestors are visible as well (in other words,isVisibleInTree
must returntrue
).func addGizmo(Node3DGizmo?
) Attach an editor gizmo to this
Node3D
.func clearGizmos(
) Clear all gizmos attached to this
Node3D
.func clearSubgizmoSelection(
) Clears subgizmo selection for this node in the editor. Useful when subgizmo IDs become invalid after a property change.
func forceUpdateTransform(
) Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations.
func getGizmos(
) -> ObjectCollection<Node3DGizmo> Returns all the gizmos attached to this
Node3D
.func getParentNode3d(
) -> Node3D? Returns the parent
Node3D
, or an emptyObject
if no parent exists or parent is not of typeNode3D
.func getWorld3d(
) -> World3D? Returns the current
World3D
resource thisNode3D
node is registered to.func globalRotate(axis: Vector3, angle: Double
) Rotates the global (world) transformation around axis, a unit
Vector3
, by specified angle in radians. The rotation axis is in global coordinate system.func globalScale(Vector3
) Scales the global (world) transformation by the given
Vector3
scale factors.func globalTranslate(offset: Vector3
) Moves the global (world) transformation by
Vector3
offset. The offset is in global coordinate system.func hide(
) Disables rendering of this node. Changes
visible
tofalse
.func isLocalTransformNotificationEnabled(
) -> Bool Returns whether node notifies about its local transformation changes.
Node3D
will not propagate this by default.func isScaleDisabled(
) -> Bool Returns whether this node uses a scale of
(1, 1, 1)
or its local transformation scale.func isTransformNotificationEnabled(
) -> Bool Returns whether the node notifies about its global and local transformation changes.
Node3D
will not propagate this by default.func isVisibleInTree(
) -> Bool Returns
true
if the node is present in theSceneTree
, itsvisible
property istrue
and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree.func lookAt(target: Vector3, up: Vector3, useModelFront: Bool
) Rotates the node so that the local forward axis (-Z,
Vector3.FORWARD
) points toward thetarget
position.func lookAtFromPosition(Vector3, target: Vector3, up: Vector3, useModelFront: Bool
) Moves the node to the specified
position
, and then rotates the node to point toward thetarget
as perlookAt(target:up:useModelFront:)
. Operations take place in global space.func orthonormalize(
) Resets this node’s transformations (like scale, skew and taper) preserving its rotation and translation by performing Gram-Schmidt orthonormalization on this node’s
Transform3D
.func rotate(axis: Vector3, angle: Double
) Rotates the local transformation around axis, a unit
Vector3
, by specified angle in radians.func rotateObjectLocal(axis: Vector3, angle: Double
) Rotates the local transformation around axis, a unit
Vector3
, by specified angle in radians. The rotation axis is in object-local coordinate system.func rotateX(angle: Double
) Rotates the local transformation around the X axis by angle in radians.
func rotateY(angle: Double
) Rotates the local transformation around the Y axis by angle in radians.
func rotateZ(angle: Double
) Rotates the local transformation around the Z axis by angle in radians.
func scaleObjectLocal(scale: Vector3
) Scales the local transformation by given 3D scale factors in object-local coordinate system.
func setDisableScale(disable: Bool
) Sets whether the node uses a scale of
(1, 1, 1)
or its local transformation scale. Changes to the local transformation scale are preserved.func setIdentity(
) Reset all transformations for this node (sets its
Transform3D
to the identity matrix).func setIgnoreTransformNotification(enabled: Bool
) Sets whether the node ignores notification that its transformation (global or local) changed.
func setNotifyLocalTransform(enable: Bool
) Sets whether the node notifies about its local transformation changes.
Node3D
will not propagate this by default.func setNotifyTransform(enable: Bool
) Sets whether the node notifies about its global and local transformation changes.
Node3D
will not propagate this by default, unless it is in the editor context and it has a valid gizmo.func setSubgizmoSelection(gizmo: Node3DGizmo?, id: Int32, transform: Transform3D
) Set subgizmo selection for this node in the editor.
func show(
) Enables rendering of this node. Changes
visible
totrue
.func toGlobal(localPoint: Vector3
) -> Vector3 Transforms
localPoint
from this node’s local space to world space.func toLocal(globalPoint: Vector3
) -> Vector3 Transforms
globalPoint
from world space to this node’s local space.func translate(offset: Vector3
) Changes the node’s position by the given offset
Vector3
.func translateObjectLocal(offset: Vector3
) Changes the node’s position by the given offset
Vector3
in local space.func updateGizmos(
) Updates all the
Node3D
gizmos attached to this node.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.