SkeletonIK3D

package
v0.0.0-...-535787f Latest Latest
Warning

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

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

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

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
	AsSkeletonIK3D() Instance
}

type Expanded

type Expanded [1]gdclass.SkeletonIK3D

func (Expanded) Start

func (self Expanded) Start(one_time bool)

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

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]) 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]) AsSkeletonIK3D

func (self *Extension[T]) AsSkeletonIK3D() Instance

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.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 New

func New() 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) AsSkeletonIK3D

func (self Instance) AsSkeletonIK3D() Instance

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) ID

func (self Instance) ID() ID

func (Instance) Interpolation

func (self Instance) Interpolation() Float.X

func (Instance) IsRunning

func (self Instance) IsRunning() bool

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) Magnet

func (self Instance) Magnet() Vector3.XYZ

func (Instance) MaxIterations

func (self Instance) MaxIterations() int

func (Instance) MinDistance

func (self Instance) MinDistance() Float.X

func (Instance) OverrideTipBasis

func (self Instance) OverrideTipBasis() bool

func (Instance) RootBone

func (self Instance) RootBone() string

func (Instance) SetInterpolation

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

func (Instance) SetMagnet

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

func (Instance) SetMaxIterations

func (self Instance) SetMaxIterations(value int)

func (Instance) SetMinDistance

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

func (*Instance) SetObject

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

func (Instance) SetOverrideTipBasis

func (self Instance) SetOverrideTipBasis(value bool)

func (Instance) SetRootBone

func (self Instance) SetRootBone(value string)

func (Instance) SetTarget

func (self Instance) SetTarget(value Transform3D.BasisOrigin)

func (Instance) SetTargetNode

func (self Instance) SetTargetNode(value string)

func (Instance) SetTipBone

func (self Instance) SetTipBone(value string)

func (Instance) SetUseMagnet

func (self Instance) SetUseMagnet(value bool)

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

func (Instance) TargetNode

func (self Instance) TargetNode() string

func (Instance) TipBone

func (self Instance) TipBone() string

func (Instance) UseMagnet

func (self Instance) UseMagnet() bool

func (Instance) Virtual

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

Jump to

Keyboard shortcuts

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