Documentation
¶
Overview ¶
This SkeletonModifier3D rotates a bone to look at a target. This is helpful for moving a character's head to look at the player, rotating a turret to look at a target, or any other case where you want to make a bone rotate towards something quickly and easily.
When applying multiple LookAtModifier3Ds, the LookAtModifier3D assigned to the parent bone must be put above the LookAtModifier3D assigned to the child bone in the list in order for the child bone results to be correct.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AsLookAtModifier3D() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsSkeletonModifier3D() SkeletonModifier3D.Instance
- func (self Instance) Bone() int
- func (self Instance) BoneName() string
- func (self Instance) Duration() Float.X
- func (self Instance) EaseType() Tween.EaseType
- func (self Instance) ForwardAxis() SkeletonModifier3D.BoneAxis
- func (self Instance) GetInterpolationRemaining() Float.X
- func (self Instance) ID() ID
- func (self Instance) IsInterpolating() bool
- func (self Instance) IsTargetWithinLimitation() bool
- func (self Instance) OriginBone() int
- func (self Instance) OriginBoneName() string
- func (self Instance) OriginExternalNode() string
- func (self Instance) OriginFrom() OriginFrom
- func (self Instance) OriginOffset() Vector3.XYZ
- func (self Instance) OriginSafeMargin() Float.X
- func (self Instance) PrimaryDampThreshold() Float.X
- func (self Instance) PrimaryLimitAngle() Angle.Radians
- func (self Instance) PrimaryNegativeDampThreshold() Float.X
- func (self Instance) PrimaryNegativeLimitAngle() Angle.Radians
- func (self Instance) PrimaryPositiveDampThreshold() Float.X
- func (self Instance) PrimaryPositiveLimitAngle() Angle.Radians
- func (self Instance) PrimaryRotationAxis() Vector3.Axis
- func (self Instance) SecondaryDampThreshold() Float.X
- func (self Instance) SecondaryLimitAngle() Angle.Radians
- func (self Instance) SecondaryNegativeDampThreshold() Float.X
- func (self Instance) SecondaryNegativeLimitAngle() Angle.Radians
- func (self Instance) SecondaryPositiveDampThreshold() Float.X
- func (self Instance) SecondaryPositiveLimitAngle() Angle.Radians
- func (self Instance) SetBone(value int)
- func (self Instance) SetBoneName(value string)
- func (self Instance) SetDuration(value Float.X)
- func (self Instance) SetEaseType(value Tween.EaseType)
- func (self Instance) SetForwardAxis(value SkeletonModifier3D.BoneAxis)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOriginBone(value int)
- func (self Instance) SetOriginBoneName(value string)
- func (self Instance) SetOriginExternalNode(value string)
- func (self Instance) SetOriginFrom(value OriginFrom)
- func (self Instance) SetOriginOffset(value Vector3.XYZ)
- func (self Instance) SetOriginSafeMargin(value Float.X)
- func (self Instance) SetPrimaryDampThreshold(value Float.X)
- func (self Instance) SetPrimaryLimitAngle(value Angle.Radians)
- func (self Instance) SetPrimaryNegativeDampThreshold(value Float.X)
- func (self Instance) SetPrimaryNegativeLimitAngle(value Angle.Radians)
- func (self Instance) SetPrimaryPositiveDampThreshold(value Float.X)
- func (self Instance) SetPrimaryPositiveLimitAngle(value Angle.Radians)
- func (self Instance) SetPrimaryRotationAxis(value Vector3.Axis)
- func (self Instance) SetSecondaryDampThreshold(value Float.X)
- func (self Instance) SetSecondaryLimitAngle(value Angle.Radians)
- func (self Instance) SetSecondaryNegativeDampThreshold(value Float.X)
- func (self Instance) SetSecondaryNegativeLimitAngle(value Angle.Radians)
- func (self Instance) SetSecondaryPositiveDampThreshold(value Float.X)
- func (self Instance) SetSecondaryPositiveLimitAngle(value Angle.Radians)
- func (self Instance) SetSymmetryLimitation(value bool)
- func (self Instance) SetTargetNode(value string)
- func (self Instance) SetTransitionType(value Tween.TransitionType)
- func (self Instance) SetUseAngleLimitation(value bool)
- func (self Instance) SetUseSecondaryRotation(value bool)
- func (self Instance) SymmetryLimitation() bool
- func (self Instance) TargetNode() string
- func (self Instance) TransitionType() Tween.TransitionType
- func (self Instance) UseAngleLimitation() bool
- func (self Instance) UseSecondaryRotation() bool
- func (self Instance) Virtual(name string) reflect.Value
- type OriginFrom
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsLookAtModifier3D ¶
func (*Extension[T]) AsSkeletonModifier3D ¶
func (self *Extension[T]) AsSkeletonModifier3D() SkeletonModifier3D.Instance
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.LookAtModifier3D
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsLookAtModifier3D ¶
func (Instance) AsSkeletonModifier3D ¶
func (self Instance) AsSkeletonModifier3D() SkeletonModifier3D.Instance
func (Instance) ForwardAxis ¶
func (self Instance) ForwardAxis() SkeletonModifier3D.BoneAxis
func (Instance) GetInterpolationRemaining ¶
Returns the remaining seconds of the time-based interpolation.
func (Instance) IsInterpolating ¶
Returns true if time-based interpolation is running. If true, it is equivalent to GetInterpolationRemaining returning 0.0.
This is useful to determine whether a LookAtModifier3D can be removed safely.
func (Instance) IsTargetWithinLimitation ¶
Returns whether the target is within the angle limitations. It is useful for unsetting the TargetNode when the target is outside of the angle limitations.
Note: The value is updated after SkeletonModifier3D.ProcessModification. To retrieve this value correctly, we recommend using the signal OnSkeletonmodifier3d.ModificationProcessed.
func (Instance) OriginBone ¶
func (Instance) OriginBoneName ¶
func (Instance) OriginExternalNode ¶
func (Instance) OriginFrom ¶
func (self Instance) OriginFrom() OriginFrom
func (Instance) OriginOffset ¶
func (Instance) OriginSafeMargin ¶
func (Instance) PrimaryDampThreshold ¶
func (Instance) PrimaryLimitAngle ¶
func (Instance) PrimaryNegativeDampThreshold ¶
func (Instance) PrimaryNegativeLimitAngle ¶
func (Instance) PrimaryPositiveDampThreshold ¶
func (Instance) PrimaryPositiveLimitAngle ¶
func (Instance) PrimaryRotationAxis ¶
func (Instance) SecondaryDampThreshold ¶
func (Instance) SecondaryLimitAngle ¶
func (Instance) SecondaryNegativeDampThreshold ¶
func (Instance) SecondaryNegativeLimitAngle ¶
func (Instance) SecondaryPositiveDampThreshold ¶
func (Instance) SecondaryPositiveLimitAngle ¶
func (Instance) SetBoneName ¶
func (Instance) SetDuration ¶
func (Instance) SetEaseType ¶
func (Instance) SetForwardAxis ¶
func (self Instance) SetForwardAxis(value SkeletonModifier3D.BoneAxis)
func (Instance) SetOriginBone ¶
func (Instance) SetOriginBoneName ¶
func (Instance) SetOriginExternalNode ¶
func (Instance) SetOriginFrom ¶
func (self Instance) SetOriginFrom(value OriginFrom)
func (Instance) SetOriginOffset ¶
func (Instance) SetOriginSafeMargin ¶
func (Instance) SetPrimaryDampThreshold ¶
func (Instance) SetPrimaryLimitAngle ¶
func (Instance) SetPrimaryNegativeDampThreshold ¶
func (Instance) SetPrimaryNegativeLimitAngle ¶
func (Instance) SetPrimaryPositiveDampThreshold ¶
func (Instance) SetPrimaryPositiveLimitAngle ¶
func (Instance) SetPrimaryRotationAxis ¶
func (Instance) SetSecondaryDampThreshold ¶
func (Instance) SetSecondaryLimitAngle ¶
func (Instance) SetSecondaryNegativeDampThreshold ¶
func (Instance) SetSecondaryNegativeLimitAngle ¶
func (Instance) SetSecondaryPositiveDampThreshold ¶
func (Instance) SetSecondaryPositiveLimitAngle ¶
func (Instance) SetSymmetryLimitation ¶
func (Instance) SetTargetNode ¶
func (Instance) SetTransitionType ¶
func (self Instance) SetTransitionType(value Tween.TransitionType)
func (Instance) SetUseAngleLimitation ¶
func (Instance) SetUseSecondaryRotation ¶
func (Instance) SymmetryLimitation ¶
func (Instance) TargetNode ¶
func (Instance) TransitionType ¶
func (self Instance) TransitionType() Tween.TransitionType
func (Instance) UseAngleLimitation ¶
func (Instance) UseSecondaryRotation ¶
type OriginFrom ¶
type OriginFrom int //gd:LookAtModifier3D.OriginFrom
const ( // The bone rest position of the bone specified in [Bone] is used as origin. // // [Bone]: https://pkg.go.dev/graphics.gd/classdb/#Instance.Bone OriginFromSelf OriginFrom = 0 // The bone global pose position of the bone specified in [OriginBone] is used as origin. // // Note: It is recommended that you select only the parent bone unless you are familiar with the bone processing process. The specified bone pose at the time the [LookAtModifier3D] is processed is used as a reference. In other words, if you specify a child bone and the [LookAtModifier3D] causes the child bone to move, the rendered result and direction will not match. // // [LookAtModifier3D]: https://pkg.go.dev/graphics.gd/classdb/LookAtModifier3D // [OriginBone]: https://pkg.go.dev/graphics.gd/classdb/#Instance.OriginBone OriginFromSpecificBone OriginFrom = 1 // The global position of the [Node3D] specified in [OriginExternalNode] is used as origin. // // Note: Same as [OriginFromSpecificBone], when specifying a [BoneAttachment3D] with a child bone assigned, the rendered result and direction will not match. // // [BoneAttachment3D]: https://pkg.go.dev/graphics.gd/classdb/BoneAttachment3D // [Node3D]: https://pkg.go.dev/graphics.gd/classdb/Node3D // [OriginExternalNode]: https://pkg.go.dev/graphics.gd/classdb/#Instance.OriginExternalNode OriginFromExternalNode OriginFrom = 2 )