Documentation
¶
Overview ¶
SkeletonIK3D is used to rotate all bones of a graphics.gd/classdb/Skeleton3D bone chain a way that places the end bone at a desired 3D position. A typical scenario for IK in games is to place a character's feet on the ground or a character's hands on a currently held object. SkeletonIK uses FabrikInverseKinematic internally to solve the bone chain and applies the results to the graphics.gd/classdb/Skeleton3D bones_global_pose_override property for all affected bones in the chain. If fully applied, this overwrites any bone transform from [graphics.gd/classdb/Animation]s or bone custom poses set by users. The applied amount can be controlled with the graphics.gd/classdb/SkeletonModifier3D.Instance.Influence property.
package main import "graphics.gd/classdb/SkeletonIK3D" func ExampleSkeletonIK3D(skeleton_ik_node SkeletonIK3D.Instance) { // Apply IK effect automatically on every new frame (not the current) skeleton_ik_node.Start() // Apply IK effect only on the current frame SkeletonIK3D.Expanded(skeleton_ik_node).Start(true) // Stop IK effect and reset bones_global_pose_override on Skeleton skeleton_ik_node.Stop() // Apply full IK effect skeleton_ik_node.AsSkeletonModifier3D().SetInfluence(1.0) // Apply half IK effect skeleton_ik_node.AsSkeletonModifier3D().SetInfluence(0.5) // Apply zero IK effect (a value at or below 0.01 also removes bones_global_pose_override on Skeleton) skeleton_ik_node.AsSkeletonModifier3D().SetInfluence(0.0) }
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsSkeletonIK3D() Instance
- func (self Instance) AsSkeletonModifier3D() SkeletonModifier3D.Instance
- func (self Instance) GetParentSkeleton() Skeleton3D.Instance
- func (self Instance) ID() ID
- func (self Instance) Interpolation() Float.X
- func (self Instance) IsRunning() bool
- func (self Instance) Magnet() Vector3.XYZ
- func (self Instance) MaxIterations() int
- func (self Instance) MinDistance() Float.X
- func (self Instance) OverrideTipBasis() bool
- func (self Instance) RootBone() string
- func (self Instance) SetInterpolation(value Float.X)
- func (self Instance) SetMagnet(value Vector3.XYZ)
- func (self Instance) SetMaxIterations(value int)
- func (self Instance) SetMinDistance(value Float.X)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOverrideTipBasis(value bool)
- func (self Instance) SetRootBone(value string)
- func (self Instance) SetTarget(value Transform3D.BasisOrigin)
- func (self Instance) SetTargetNode(value string)
- func (self Instance) SetTipBone(value string)
- func (self Instance) SetUseMagnet(value bool)
- func (self Instance) Start()
- func (self Instance) Stop()
- func (self Instance) Target() Transform3D.BasisOrigin
- func (self Instance) TargetNode() string
- func (self Instance) TipBone() string
- func (self Instance) UseMagnet() bool
- func (self Instance) Virtual(name string) reflect.Value
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 Expanded ¶
type Expanded [1]gdclass.SkeletonIK3D
func (Expanded) Start ¶
Starts applying IK effects on each frame to the graphics.gd/classdb/Skeleton3D bones but will only take effect starting on the next frame. If 'one_time' is true, this will take effect immediately but also reset on the next frame.
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]) AsSkeletonIK3D ¶
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.SkeletonIK3D
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) AsSkeletonIK3D ¶
func (Instance) AsSkeletonModifier3D ¶
func (self Instance) AsSkeletonModifier3D() SkeletonModifier3D.Instance
func (Instance) GetParentSkeleton ¶
func (self Instance) GetParentSkeleton() Skeleton3D.Instance
Returns the parent graphics.gd/classdb/Skeleton3D node that was present when SkeletonIK entered the scene tree. Returns null if the parent node was not a graphics.gd/classdb/Skeleton3D node when SkeletonIK3D entered the scene tree.
func (Instance) Interpolation ¶
func (Instance) IsRunning ¶
Returns true if SkeletonIK is applying IK effects on continues frames to the graphics.gd/classdb/Skeleton3D bones. Returns false if SkeletonIK is stopped or Instance.Start was used with the one_time parameter set to true.
func (Instance) MaxIterations ¶
func (Instance) MinDistance ¶
func (Instance) OverrideTipBasis ¶
func (Instance) SetInterpolation ¶
func (Instance) SetMaxIterations ¶
func (Instance) SetMinDistance ¶
func (Instance) SetOverrideTipBasis ¶
func (Instance) SetRootBone ¶
func (Instance) SetTarget ¶
func (self Instance) SetTarget(value Transform3D.BasisOrigin)
func (Instance) SetTargetNode ¶
func (Instance) SetTipBone ¶
func (Instance) SetUseMagnet ¶
func (Instance) Start ¶
func (self Instance) Start()
Starts applying IK effects on each frame to the graphics.gd/classdb/Skeleton3D bones but will only take effect starting on the next frame. If 'one_time' is true, this will take effect immediately but also reset on the next frame.
func (Instance) Stop ¶
func (self Instance) Stop()
Stops applying IK effects on each frame to the graphics.gd/classdb/Skeleton3D bones and also calls graphics.gd/classdb/Skeleton3D.Instance.ClearBonesGlobalPoseOverride to remove existing overrides on all bones.
func (Instance) Target ¶
func (self Instance) Target() Transform3D.BasisOrigin