LookAtModifier3D

package
v0.0.0-...-fa94a0d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 28 Imported by: 0

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

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 Any

type Any interface {
	gd.IsClass
	AsLookAtModifier3D() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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 (self *Extension[T]) AsLookAtModifier3D() Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode3D

func (self *Extension[T]) AsNode3D() Node3D.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsSkeletonModifier3D

func (self *Extension[T]) AsSkeletonModifier3D() SkeletonModifier3D.Instance

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

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 New

func New() Instance

func (Instance) AsLookAtModifier3D

func (self Instance) AsLookAtModifier3D() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode3D

func (self Instance) AsNode3D() Node3D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsSkeletonModifier3D

func (self Instance) AsSkeletonModifier3D() SkeletonModifier3D.Instance

func (Instance) Bone

func (self Instance) Bone() int

func (Instance) BoneName

func (self Instance) BoneName() string

func (Instance) Duration

func (self Instance) Duration() Float.X

func (Instance) EaseType

func (self Instance) EaseType() Tween.EaseType

func (Instance) ForwardAxis

func (self Instance) ForwardAxis() SkeletonModifier3D.BoneAxis

func (Instance) GetInterpolationRemaining

func (self Instance) GetInterpolationRemaining() Float.X

Returns the remaining seconds of the time-based interpolation.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IsInterpolating

func (self Instance) IsInterpolating() bool

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

func (self Instance) IsTargetWithinLimitation() bool

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 (self Instance) OriginBone() int

func (Instance) OriginBoneName

func (self Instance) OriginBoneName() string

func (Instance) OriginExternalNode

func (self Instance) OriginExternalNode() string

func (Instance) OriginFrom

func (self Instance) OriginFrom() OriginFrom

func (Instance) OriginOffset

func (self Instance) OriginOffset() Vector3.XYZ

func (Instance) OriginSafeMargin

func (self Instance) OriginSafeMargin() Float.X

func (Instance) PrimaryDampThreshold

func (self Instance) PrimaryDampThreshold() Float.X

func (Instance) PrimaryLimitAngle

func (self Instance) PrimaryLimitAngle() Angle.Radians

func (Instance) PrimaryNegativeDampThreshold

func (self Instance) PrimaryNegativeDampThreshold() Float.X

func (Instance) PrimaryNegativeLimitAngle

func (self Instance) PrimaryNegativeLimitAngle() Angle.Radians

func (Instance) PrimaryPositiveDampThreshold

func (self Instance) PrimaryPositiveDampThreshold() Float.X

func (Instance) PrimaryPositiveLimitAngle

func (self Instance) PrimaryPositiveLimitAngle() Angle.Radians

func (Instance) PrimaryRotationAxis

func (self Instance) PrimaryRotationAxis() Vector3.Axis

func (Instance) SecondaryDampThreshold

func (self Instance) SecondaryDampThreshold() Float.X

func (Instance) SecondaryLimitAngle

func (self Instance) SecondaryLimitAngle() Angle.Radians

func (Instance) SecondaryNegativeDampThreshold

func (self Instance) SecondaryNegativeDampThreshold() Float.X

func (Instance) SecondaryNegativeLimitAngle

func (self Instance) SecondaryNegativeLimitAngle() Angle.Radians

func (Instance) SecondaryPositiveDampThreshold

func (self Instance) SecondaryPositiveDampThreshold() Float.X

func (Instance) SecondaryPositiveLimitAngle

func (self Instance) SecondaryPositiveLimitAngle() Angle.Radians

func (Instance) SetBone

func (self Instance) SetBone(value int)

func (Instance) SetBoneName

func (self Instance) SetBoneName(value string)

func (Instance) SetDuration

func (self Instance) SetDuration(value Float.X)

func (Instance) SetEaseType

func (self Instance) SetEaseType(value Tween.EaseType)

func (Instance) SetForwardAxis

func (self Instance) SetForwardAxis(value SkeletonModifier3D.BoneAxis)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetOriginBone

func (self Instance) SetOriginBone(value int)

func (Instance) SetOriginBoneName

func (self Instance) SetOriginBoneName(value string)

func (Instance) SetOriginExternalNode

func (self Instance) SetOriginExternalNode(value string)

func (Instance) SetOriginFrom

func (self Instance) SetOriginFrom(value OriginFrom)

func (Instance) SetOriginOffset

func (self Instance) SetOriginOffset(value Vector3.XYZ)

func (Instance) SetOriginSafeMargin

func (self Instance) SetOriginSafeMargin(value Float.X)

func (Instance) SetPrimaryDampThreshold

func (self Instance) SetPrimaryDampThreshold(value Float.X)

func (Instance) SetPrimaryLimitAngle

func (self Instance) SetPrimaryLimitAngle(value Angle.Radians)

func (Instance) SetPrimaryNegativeDampThreshold

func (self Instance) SetPrimaryNegativeDampThreshold(value Float.X)

func (Instance) SetPrimaryNegativeLimitAngle

func (self Instance) SetPrimaryNegativeLimitAngle(value Angle.Radians)

func (Instance) SetPrimaryPositiveDampThreshold

func (self Instance) SetPrimaryPositiveDampThreshold(value Float.X)

func (Instance) SetPrimaryPositiveLimitAngle

func (self Instance) SetPrimaryPositiveLimitAngle(value Angle.Radians)

func (Instance) SetPrimaryRotationAxis

func (self Instance) SetPrimaryRotationAxis(value Vector3.Axis)

func (Instance) SetSecondaryDampThreshold

func (self Instance) SetSecondaryDampThreshold(value Float.X)

func (Instance) SetSecondaryLimitAngle

func (self Instance) SetSecondaryLimitAngle(value Angle.Radians)

func (Instance) SetSecondaryNegativeDampThreshold

func (self Instance) SetSecondaryNegativeDampThreshold(value Float.X)

func (Instance) SetSecondaryNegativeLimitAngle

func (self Instance) SetSecondaryNegativeLimitAngle(value Angle.Radians)

func (Instance) SetSecondaryPositiveDampThreshold

func (self Instance) SetSecondaryPositiveDampThreshold(value Float.X)

func (Instance) SetSecondaryPositiveLimitAngle

func (self Instance) SetSecondaryPositiveLimitAngle(value Angle.Radians)

func (Instance) SetSymmetryLimitation

func (self Instance) SetSymmetryLimitation(value bool)

func (Instance) SetTargetNode

func (self Instance) SetTargetNode(value string)

func (Instance) SetTransitionType

func (self Instance) SetTransitionType(value Tween.TransitionType)

func (Instance) SetUseAngleLimitation

func (self Instance) SetUseAngleLimitation(value bool)

func (Instance) SetUseSecondaryRotation

func (self Instance) SetUseSecondaryRotation(value bool)

func (Instance) SymmetryLimitation

func (self Instance) SymmetryLimitation() bool

func (Instance) TargetNode

func (self Instance) TargetNode() string

func (Instance) TransitionType

func (self Instance) TransitionType() Tween.TransitionType

func (Instance) UseAngleLimitation

func (self Instance) UseAngleLimitation() bool

func (Instance) UseSecondaryRotation

func (self Instance) UseSecondaryRotation() bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL