mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-27 14:17:37 +01:00
Relintai
22ce231a4e
This PR and commit adds a new IK system for 3D with the Skeleton3D node
that adds several new IK solvers, as well as additional changes and functionality
for making bone manipulation in Godot easier.
This work was sponsored by GSoC 2020 and TwistedTwigleg
Full list of changes:
* Adds a SkeletonModification3D resource
* This resource is the base where all IK code is written and executed
* Adds a SkeletonModificationStack3D resource
* This node oversees the execution of the modifications and acts as a bridge of sorts for the modifications to the Skeleton3D node
* Adds SkeletonModification3D resources for LookAt, CCDIK, FABRIK, Jiggle, and TwoBoneIK
* Each modification is in it's own file
* Several changes to Skeletons, listed below:
* Added local_pose_override, which acts just like global_pose_override but keeps bone-child relationships intract
* So if you move a bone using local_pose_override, all of the bones that are children will also be moved. This is different than global_pose_override, which only affects the individual bone
* Internally bones keep track of their children. This removes the need of a processing list, makes it possible to update just a few select bones at a time, and makes it easier to traverse down the bone chain
* Additional functions added for converting from world transform to global poses, global poses to local poses, and all the same changes but backwards (local to global, global to world). This makes it much easier to work with bone transforms without needing to think too much about how to convert them.
* New signal added, bone_pose_changed, that can be used to tell if a specific bone changed its transform. Needed for BoneAttachment3D
* Added functions for getting the forward position of a bone
* BoneAttachment3D node refactored heavily
* BoneAttachment3D node is now completely standalone in its functionality.
* This makes the code easier and less interconnected, as well as allowing them to function properly without being direct children of Skeleton3D nodes
* BoneAttachment3D now can be set either using the index or the bone name.
* BoneAttachment3D nodes can now set the bone transform instead of just following it. This is disabled by default for compatibility
* BoneAttachment3D now shows a warning when not configured correctly
* Added rotate_to_align function in Basis
* Added class reference documentation for all changes
- TwistedTwigleg
5ffed49907
Note: It still needs some work.
200 lines
9.8 KiB
XML
200 lines
9.8 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<class name="SkeletonModification3DJiggle" inherits="SkeletonModification3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
|
<brief_description>
|
|
A modification that jiggles bones as they move towards a target.
|
|
</brief_description>
|
|
<description>
|
|
This modification moves a series of bones, typically called a bone chain, towards a target. What makes this modification special is that it calculates the velocity and acceleration for each bone in the bone chain, and runs a very light physics-like calculation using the inputted values. This allows the bones to overshoot the target and "jiggle" around. It can be configured to act more like a spring, or sway around like cloth might.
|
|
This modification is useful for adding additional motion to things like hair, the edges of clothing, and more. It has several settings to that allow control over how the joint moves when the target moves.
|
|
[b]Note:[/b] The Jiggle modifier has [code]jiggle_joints[/code], which are the data objects that hold the data for each joint in the Jiggle chain. This is different from a bone! Jiggle joints hold the data needed for each bone in the bone chain used by the Jiggle modification.
|
|
</description>
|
|
<tutorials>
|
|
</tutorials>
|
|
<methods>
|
|
<method name="get_collision_mask" qualifiers="const">
|
|
<return type="int" />
|
|
<description>
|
|
Returns the collision mask that the Jiggle modifier will take into account when performing physics calculations.
|
|
</description>
|
|
</method>
|
|
<method name="get_jiggle_joint_bone_index" qualifiers="const">
|
|
<return type="int" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<description>
|
|
Returns the bone index of the bone assigned to the Jiggle joint at [code]joint_idx[/code].
|
|
</description>
|
|
</method>
|
|
<method name="get_jiggle_joint_bone_name" qualifiers="const">
|
|
<return type="String" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<description>
|
|
Returns the name of the bone that is assigned to the Jiggle joint at [code]joint_idx[/code].
|
|
</description>
|
|
</method>
|
|
<method name="get_jiggle_joint_damping" qualifiers="const">
|
|
<return type="float" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<description>
|
|
Returns the amount of dampening of the Jiggle joint at [code]joint_idx[/code].
|
|
</description>
|
|
</method>
|
|
<method name="get_jiggle_joint_gravity" qualifiers="const">
|
|
<return type="Vector3" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<description>
|
|
Returns a [Vector3] representign the amount of gravity the Jiggle joint at [code]joint_idx[/code] is influenced by.
|
|
</description>
|
|
</method>
|
|
<method name="get_jiggle_joint_mass" qualifiers="const">
|
|
<return type="float" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<description>
|
|
Returns the amount of mass of the Jiggle joint at [code]joint_idx[/code].
|
|
</description>
|
|
</method>
|
|
<method name="get_jiggle_joint_override" qualifiers="const">
|
|
<return type="bool" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<description>
|
|
Returns a boolean that indicates whether the joint at [code]joint_idx[/code] is overriding the default jiggle joint data defined in the modification.
|
|
</description>
|
|
</method>
|
|
<method name="get_jiggle_joint_roll" qualifiers="const">
|
|
<return type="float" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<description>
|
|
Returns the amount of roll/twist applied to the bone that the Jiggle joint is applied to.
|
|
</description>
|
|
</method>
|
|
<method name="get_jiggle_joint_stiffness" qualifiers="const">
|
|
<return type="float" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<description>
|
|
Returns the stiffness of the Jiggle joint at [code]joint_idx[/code].
|
|
</description>
|
|
</method>
|
|
<method name="get_jiggle_joint_use_gravity" qualifiers="const">
|
|
<return type="bool" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<description>
|
|
Returns a boolean that indicates whether the joint at [code]joint_idx[/code] is using gravity or not.
|
|
</description>
|
|
</method>
|
|
<method name="get_use_colliders" qualifiers="const">
|
|
<return type="bool" />
|
|
<description>
|
|
Returns whether the Jiggle modifier is taking physics colliders into account when solving.
|
|
</description>
|
|
</method>
|
|
<method name="set_collision_mask">
|
|
<return type="void" />
|
|
<argument index="0" name="mask" type="int" />
|
|
<description>
|
|
Sets the collision mask that the Jiggle modifier takes into account when performing physics calculations.
|
|
</description>
|
|
</method>
|
|
<method name="set_jiggle_joint_bone_index">
|
|
<return type="void" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<argument index="1" name="bone_idx" type="int" />
|
|
<description>
|
|
Sets the bone index, [code]bone_index[/code], of the Jiggle joint at [code]joint_idx[/code]. When possible, this will also update the [code]bone_name[/code] of the Jiggle joint based on data provided by the [Skeleton3D].
|
|
</description>
|
|
</method>
|
|
<method name="set_jiggle_joint_bone_name">
|
|
<return type="void" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<argument index="1" name="name" type="String" />
|
|
<description>
|
|
Sets the bone name, [code]bone_name[/code], of the Jiggle joint at [code]joint_idx[/code]. When possible, this will also update the [code]bone_index[/code] of the Jiggle joint based on data provided by the [Skeleton3D].
|
|
</description>
|
|
</method>
|
|
<method name="set_jiggle_joint_damping">
|
|
<return type="void" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<argument index="1" name="damping" type="float" />
|
|
<description>
|
|
Sets the amount of dampening of the Jiggle joint at [code]joint_idx[/code].
|
|
</description>
|
|
</method>
|
|
<method name="set_jiggle_joint_gravity">
|
|
<return type="void" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<argument index="1" name="gravity" type="Vector3" />
|
|
<description>
|
|
Sets the gravity vector of the Jiggle joint at [code]joint_idx[/code].
|
|
</description>
|
|
</method>
|
|
<method name="set_jiggle_joint_mass">
|
|
<return type="void" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<argument index="1" name="mass" type="float" />
|
|
<description>
|
|
Sets the of mass of the Jiggle joint at [code]joint_idx[/code].
|
|
</description>
|
|
</method>
|
|
<method name="set_jiggle_joint_override">
|
|
<return type="void" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<argument index="1" name="override" type="bool" />
|
|
<description>
|
|
Sets whether the Jiggle joint at [code]joint_idx[/code] should override the default Jiggle joint settings. Setting this to true will make the joint use its own settings rather than the default ones attached to the modification.
|
|
</description>
|
|
</method>
|
|
<method name="set_jiggle_joint_roll">
|
|
<return type="void" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<argument index="1" name="roll" type="float" />
|
|
<description>
|
|
Sets the amount of roll/twist on the bone the Jiggle joint is attached to.
|
|
</description>
|
|
</method>
|
|
<method name="set_jiggle_joint_stiffness">
|
|
<return type="void" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<argument index="1" name="stiffness" type="float" />
|
|
<description>
|
|
Sets the of stiffness of the Jiggle joint at [code]joint_idx[/code].
|
|
</description>
|
|
</method>
|
|
<method name="set_jiggle_joint_use_gravity">
|
|
<return type="void" />
|
|
<argument index="0" name="joint_idx" type="int" />
|
|
<argument index="1" name="use_gravity" type="bool" />
|
|
<description>
|
|
Sets whether the Jiggle joint at [code]joint_idx[/code] should use gravity.
|
|
</description>
|
|
</method>
|
|
<method name="set_use_colliders">
|
|
<return type="void" />
|
|
<argument index="0" name="use_colliders" type="bool" />
|
|
<description>
|
|
When [code]true[/code], the Jiggle modifier will use raycasting to prevent the Jiggle joints from rotating themselves into collision objects when solving.
|
|
</description>
|
|
</method>
|
|
</methods>
|
|
<members>
|
|
<member name="damping" type="float" setter="set_damping" getter="get_damping" default="0.75">
|
|
The default amount of dampening applied to the Jiggle joints, if they are not overridden. Higher values lead to more of the calculated velocity being applied.
|
|
</member>
|
|
<member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity" default="Vector3(0, -6, 0)">
|
|
The default amount of gravity applied to the Jiggle joints, if they are not overridden.
|
|
</member>
|
|
<member name="jiggle_data_chain_length" type="int" setter="set_jiggle_data_chain_length" getter="get_jiggle_data_chain_length" default="0">
|
|
The amount of Jiggle joints in the Jiggle modification.
|
|
</member>
|
|
<member name="mass" type="float" setter="set_mass" getter="get_mass" default="0.75">
|
|
The default amount of mass assigned to the Jiggle joints, if they are not overridden. Higher values lead to faster movements and more overshooting.
|
|
</member>
|
|
<member name="stiffness" type="float" setter="set_stiffness" getter="get_stiffness" default="3.0">
|
|
The default amount of stiffness assigned to the Jiggle joints, if they are not overridden. Higher values act more like springs, quickly moving into the correct position.
|
|
</member>
|
|
<member name="target_nodepath" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath("")">
|
|
The NodePath to the node that is the target for the Jiggle modification. This node is what the Jiggle chain will attempt to rotate the bone chain to.
|
|
</member>
|
|
<member name="use_gravity" type="bool" setter="set_use_gravity" getter="get_use_gravity" default="false">
|
|
Whether the gravity vector, [member gravity], should be applied to the Jiggle joints, assuming they are not overriding the default settings.
|
|
</member>
|
|
</members>
|
|
</class>
|