SkeletonModification3D

Inherits: Resource < RefCounted < Object

Inherited By: SkeletonModification3DCCDIK, SkeletonModification3DFABRIK, SkeletonModification3DJiggle, SkeletonModification3DLookAt, SkeletonModification3DStackHolder, SkeletonModification3DTwoBoneIK

A resource that operates on bones in a Skeleton3D.

Description

This resource provides an interface that can be expanded so code that operates on bones in a Skeleton3D can be mixed and matched together to create complex interactions.

This is used to provide Godot with a flexible and powerful Inverse Kinematics solution that can be adapted for many different uses.

Properties

bool

enabled

true

int

execution_mode

0

Methods

void

_execute ( float delta ) virtual

void

_setup_modification ( SkeletonModificationStack3D modification_stack ) virtual

float

clamp_angle ( float angle, float min, float max, bool invert )

bool

get_is_setup ( ) const

SkeletonModificationStack3D

get_modification_stack ( )

void

set_is_setup ( bool is_setup )

Property Descriptions

Default

true

Setter

set_enabled(value)

Getter

get_enabled()

When true, the modification's _execute function will be called by the SkeletonModificationStack3D.


  • int execution_mode

Default

0

Setter

set_execution_mode(value)

Getter

get_execution_mode()

The execution mode for the modification. This tells the modification stack when to execute the modification. Some modifications have settings that are only availible in certain execution modes.

Method Descriptions

  • void _execute ( float delta ) virtual

Executes the given modification. This is where the modification performs whatever function it is designed to do.


Sets up the modification so it can be executed. This function should be called automatically by the SkeletonModificationStack3D containing this modification.

If you need to initialize a modification before use, this is the place to do it!


Takes a angle and clamps it so it is within the passed-in min and max range. invert will inversely clamp the angle, clamping it to the range outside of the given bounds.


  • bool get_is_setup ( ) const

Returns whether this modification has been successfully setup or not.


Returns the SkeletonModificationStack3D that this modification is bound to. Through the modification stack, you can access the Skeleton3D the modification is operating on.


  • void set_is_setup ( bool is_setup )

Manually allows you to set the setup state of the modification. This function should only rarely be used, as the SkeletonModificationStack3D the modification is bound to should handle setting the modification up.