No edit summary |
add info |
||
(13 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{stub}} | {{stub}} | ||
{{Infobox Component | {{Infobox Component | ||
Line 6: | Line 5: | ||
}} | }} | ||
Dynamic Bone Chain is a component that allows you to add [https://en.wikipedia.org/wiki/Rigid_body rigidbody] physics to the bones of a rigged model or avatar. Bones with rigidbody physics are called dynamic bones; this name is derived from a [https://assetstore.unity.com/packages/tools/animation/dynamic-bone-16743 Unity asset] that offers similar functionality. | Dynamic Bone Chain is a component that allows you to add [https://en.wikipedia.org/wiki/Rigid_body rigidbody] physics to the bones of a rigged model or avatar. Bones with rigidbody physics are called dynamic bones; this name is derived from a [https://assetstore.unity.com/packages/tools/animation/dynamic-bone-16743 Unity asset] that offers similar functionality. | ||
To add dynamic bones to a model, navigate through the model's armature in the Inspector until you locate the bone you want to use as the "root" or "master" bone. Then, attach the Dynamic Bone Chain component, and click Setup From Children. This will add the root bone and all its children to the dynamic bone chain. | To add dynamic bones to a model, navigate through the model's armature in the Inspector until you locate the bone you want to use as the "root" or "master" bone. Then, attach the Dynamic Bone Chain component, and click Setup From Children. This will add the root bone and all its children to the dynamic bone chain. | ||
The Dynamic Bone Chain component contains various properties for adjusting the physical behavior of the bone chain. The most important properties in the component are Inertia, InertiaForce, Damping, Elasticity, and Stiffness. The descriptions of each are listed below: | The Dynamic Bone Chain component contains various properties for adjusting the physical behavior of the bone chain. The most important properties in the component are Inertia, InertiaForce, Damping, Elasticity, and Stiffness. The descriptions of each are listed below: | ||
== Fields == | == Fields == | ||
{{Table ComponentFields | {{Table ComponentFields | ||
|Inertia|Float|Controls the amount of inertia a bone experiences. Does not affect acceleration of bones. | |Inertia|Float|Controls the amount of inertia a bone experiences. Does not affect acceleration of bones. | ||
Line 24: | Line 20: | ||
|SimulateTerminalBones|Bool|Whether or not to use the last bone in the chain. If your armature has end bones that do not control anything, you probably want this off. | |SimulateTerminalBones|Bool|Whether or not to use the last bone in the chain. If your armature has end bones that do not control anything, you probably want this off. | ||
|BaseBoneRadius|Float|The default size of the sphere that allows a bone to be interacted with. | |BaseBoneRadius|Float|The default size of the sphere that allows a bone to be interacted with. | ||
|DynamicPlayerCollision|Bool| | |DynamicPlayerCollision|Bool|Whether or not to allow this bone chain to collide with players. | ||
|CollideWithOwnBody|Bool| | |CollideWithOwnBody|Bool|Whether or not to allow this bone chain to collide with the active user of the dynamic bone chain. | ||
|HandCollisionVibration|VibratePreset| | |HandCollisionVibration|VibratePreset|The vibration intensity when touching the chain colliders with a hand. | ||
|CollideWithHead|Bool| | |CollideWithHead|Bool|Whether or not to allow this bone chain to collide with player heads. | ||
|CollideWithBody|Bool| | |CollideWithBody|Bool|Whether or not to allow this bone chain to collide with player body parts. | ||
|CollideWithLeftHand|Bool| | |CollideWithLeftHand|Bool|Whether or not to allow this bone chain to collide with a player's left hand. | ||
|CollideWithRightHand|Bool| | |CollideWithRightHand|Bool|Whether or not to allow this bone chain to collide with a player's right hand. | ||
|Gravity|Float3| | |Gravity|Float3| A force like gravity in <code>GravitySpace</code> space that should be applied to the bone chain at all times. | ||
| | |GravitySpace|{{RootFieldType|RootSpace}}|TypeAdv15=true| The coordinate space to apply <code>Gravity</code> in. | ||
| | |UseUserGravityDirection|Bool|Whether or not to use the active user of the dynamic bone chain's character controller gravity for the gravity direction | ||
|LocalForce|Float3| Constant force being applied to the bone in the dynamic bone chain's local space. | |||
|UseUserGravityDirection|Bool| | |||
|LocalForce|Float3| | |||
|GlobalStretch|Float|How stretched out the bone chain should be at rest. | |GlobalStretch|Float|How stretched out the bone chain should be at rest. | ||
|MaxStretchRatio|Float|The maximum amount of stretching that can be caused by pulling on the bones. | |MaxStretchRatio|Float|The maximum amount of stretching that can be caused by pulling on the bones. | ||
|CurrentStretchRatio|Float|The current amount of stretching applied to the bones. | |CurrentStretchRatio|{{RootFieldType|RawOutput`1|[[Type:Float|Float]]}}|TypeAdv20=true|The current amount of stretching applied to the bones. | ||
|StretchRestoreSpeed|Float|How quickly extra stretching dissipates. | |StretchRestoreSpeed|Float|How quickly extra stretching dissipates. | ||
|UseLocalUserSpace|Bool| | |UseLocalUserSpace|Bool|Whether or not to make the dynamic bone only respond to movements generated from the user slot's local position changing. | ||
| | |SimulationSpace|{{RootFieldType|RootSpace}}|TypeAdv23=true| The coordinate space that movement in should affect this dynamic bone chain. | ||
| | |StaticColliders|{{RootFieldType|SyncRefList`1|[[Type:IDynamicBoneCollider|IDynamicBoneCollider]]}}|TypeAdv24=true|A list of dynamic bone collider components to be used. | ||
| | |VisualizeColliders|Bool|Causes all bone colliders colliding with this bone to be displayed. | ||
|VisualizeBones|Bool|Causes the bones, their colliders, and the connections between them to be displayed. | |||
|VisualizeColliders|Bool|Causes all bone colliders to be displayed. | |IsGrabbable|Bool|Allows you to grab bones by touching them and grabbing. Requires DynamicPlayerCollision to be checked. | ||
|VisualizeBones|Bool|Causes the bones and the connections between them to be displayed. | |ActiveUserRootOnly|Bool|Allows the active user of the dynamic bone chain to be the only user that can grab it. | ||
|IsGrabbable|Bool|Allows you to grab bones by touching them and grabbing. | |||
|ActiveUserRootOnly|Bool| | |||
|AllowSteal|Bool|Whether or not a second user can grab the chain while someone is holding it. | |AllowSteal|Bool|Whether or not a second user can grab the chain while someone is holding it. | ||
|GrabPriority|Int| | |GrabPriority|Int|{{Template:Grab Priority}} | ||
|IgnoreGrabOnFirstBone|Bool| | |IgnoreGrabOnFirstBone|Bool| Prevents EffectorBoneIndex from being 0 while being grabbed. | ||
|GrabRadiusTolerance|Float| | |GrabRadiusTolerance|Float| how much further a user can grab a bone with their grab sphere despite the radius of the bone not being in contact with their grab sphere. | ||
|GrabReleaseDistance|Float|How far a bone can be dragged before it automatically releases. | |GrabReleaseDistance|Float| How far a bone can be dragged before it automatically releases. | ||
|GrabSlipping|Bool| | |GrabSlipping|Bool|Whether or not to make the EffectorBoneIndex increase as the hand moves along the bone chain away from the first bone in the chain. Does not let EffectorBoneIndex decrease unless re-grabbed. | ||
|GrabTerminalBones|Bool|Whether or not the final bone in the chain can be grabbed. | |GrabTerminalBones|Bool|Whether or not the final bone in the chain can be grabbed. | ||
|GrabVibration|VibratePreset| | |GrabVibration|VibratePreset| The vibration intensity when grabbing the chain with a hand. | ||
|IgnoreOwnLeftHand|Bool| | |IgnoreOwnLeftHand|Bool|Whether or not to allow this bone chain to be grabbed with the left hand of the active user of the dynamic bone chain. | ||
|IgnoreOwnRightHand|Bool| | |IgnoreOwnRightHand|Bool|Whether or not to allow this bone chain to be grabbed with the right hand of the active user of the dynamic bone chain. | ||
|EffectorTarget|Slot|The chain tries to position one if its bones at this slot (used for grabbing) | |EffectorTarget|Slot|The chain tries to position one if its bones at this slot (used for grabbing) | ||
|EffectorBoneIndex|Int|Which bone is being positioned | |EffectorBoneIndex|Int|Which bone is being positioned, every other bone after this acts as if it is not being grabbed | ||
|EffectorBoneOffset|Float3| | |EffectorBoneOffset|Float3| acts as an offset from the grabbing slot in the grabbing slot's local space at the moment the bone was grabbed. Essentially prevents the bone from snapping to the center of the hand's grab sphere and keeps an offset for a smoother grabbing experience. Is automatically set every grab. | ||
|_activeGrabber|Grabber| | |_activeGrabber|'''[[Component:Grabber|Grabber]]'''|TypeAdv42=true| The grabber component that is grabbing this bone chain currently | ||
|Bones|SyncList`1| | |Bones|{{RootFieldType|SyncList`1|[[#Bone|Bone]]}}|TypeAdv43=true| The bones that should be controlled by this dynamic bone chain. | ||
}} | }} | ||
== | == Sync Delegates == | ||
{{Table ComponentTriggers | |||
|SetupFromChildren()|[[Type:Delegate|Delegate]]<[[Type:IButton|IButton]]: button, [[Type:ButtonEventData|ButtonEventData]]: eventData>| Sets up bones from children, ignoring ones already driven. | |||
|SetupFromAllChildren()|[[Type:Delegate|Delegate]]<[[Type:IButton|IButton]]: button, [[Type:ButtonEventData|ButtonEventData]]: eventData>| Sets up all children bones, regardless of if they are driven by breaking the drive links and replacing them with ones from this component. | |||
|SetupFromAllRigChildren()|[[Type:Delegate|Delegate]]<[[Type:IButton|IButton]]: button, [[Type:ButtonEventData|ButtonEventData]]: eventData>|sets up child bones as dynamic bones for this component. Ignores all slots except for one's epecified in a [[Component:Rig|Rig component]] on a slot that is a parent to the slot this dynamic bone component is on. | |||
|ReplaceSmoothTransforms()|[[Type:Delegate|Delegate]]<[[Type:IButton|IButton]]: button, [[Type:ButtonEventData|ButtonEventData]]: eventData>| Replace any smooth transforms affecting the bones targeted by this chain with drives from this chain. | |||
|AddCollidersFromHierarchy()|[[Type:Delegate|Delegate]]<[[Type:IButton|IButton]]: button, [[Type:ButtonEventData|ButtonEventData]]: eventData>| Add all colliders in hiearchy under this bone that are dynamic bone colliders to this bone chain's <code>StaticColliders</code> list. | |||
|AlwaysGrabLastBone()|[[Type:Delegate|Delegate]]<[[Type:IButton|IButton]]: button, [[Type:ButtonEventData|ButtonEventData]]: eventData>| changes the <code>GrabOverride</code> on every [[#Bone|Bone]] in the chain to point to the last bone in the chain. | |||
|CleanSmoothTransforms()|[[Type:Delegate|Delegate]]<[[Type:IButton|IButton]]: button, [[Type:ButtonEventData|ButtonEventData]]: eventData>| Gets rid of smooth transforms on targeted bones. | |||
}} | |||
== Bone == | |||
{{Table TypeFields | |||
|BoneSlot|Slot| The slot of the dynamic bone this bone is referring to. | |||
|OrigPosition|Float3| The rest position of <code>BoneSlot</code>. | |||
|OrigRotation|FloatQ| The rest rotation of <code>BoneSlot</code>. | |||
|RadiusModifier|Float| How much to multiply the default radius specified by the dynamic bone chain to make this bone's radius. | |||
|GrabOverride|'''[[#Bone|Bone]]'''|TypeAdv4=true| A Bone the same type as this Bone that will be grabbed instead of this bone when this bone is grabbed. | |||
|Collide|Bool| Whether this bone has collisions. | |||
|_posDrive|{{RootFieldType|FieldDrive`1|[[Type:Float3|Float3]]}}|TypeAdv6=true| The position of <code>BoneSlot</code> which this should be driving to make the dynamic bone movement effects. | |||
|_rotDrive|{{RootFieldType|FieldDrive`1|[[Type:FloatQ|FloatQ]]}}|TypeAdv7=true| The rotation <code>BoneSlot</code> which this should be driving to make the dynamic bone movement effects. | |||
}} | |||
=== Bone Sync Delegates === | |||
{{Table ComponentTriggers | |||
|OnSetupFromSlot()|[[Type:Delegate|Delegate]]<[[Type:IButton|IButton]]: button, [[Type:ButtonEventData|ButtonEventData]]: eventData>| Sets up the <code>OrigPosition</code>, <code>OrigRotation</code>, <code>_rotDrive</code>, and <code>_posDrive</code> fields of the [[#Bone|Bone]] when pressed and <code>BoneSlot</code> is not null. | |||
}} | |||
== Usage == | |||
== Examples == | == Examples == | ||
== | == See Also == | ||
[[Category:Components{{#translation:}}|Dynamic Bone Chain]] | [[Category:Components{{#translation:}}|Dynamic Bone Chain]] | ||
[[Category:Components With Nested Types{{#translation:}}|Dynamic Bone Chain]] | |||
[[Category:Components:Physics:Dynamic Bones{{#translation:}}|Dynamic Bone Chain]] | [[Category:Components:Physics:Dynamic Bones{{#translation:}}|Dynamic Bone Chain]] |
Latest revision as of 18:07, 14 January 2025
This article or section is a Stub. You can help the Resonite Wiki by expanding it.
![](/images/thumb/5/5b/DynamicBoneChainComponent.png/510px-DynamicBoneChainComponent.png)
Dynamic Bone Chain is a component that allows you to add rigidbody physics to the bones of a rigged model or avatar. Bones with rigidbody physics are called dynamic bones; this name is derived from a Unity asset that offers similar functionality.
To add dynamic bones to a model, navigate through the model's armature in the Inspector until you locate the bone you want to use as the "root" or "master" bone. Then, attach the Dynamic Bone Chain component, and click Setup From Children. This will add the root bone and all its children to the dynamic bone chain.
The Dynamic Bone Chain component contains various properties for adjusting the physical behavior of the bone chain. The most important properties in the component are Inertia, InertiaForce, Damping, Elasticity, and Stiffness. The descriptions of each are listed below:
Fields
Name | Type | Description |
---|---|---|
persistent
|
Bool | Determines whether or not this item will be saved to the server. |
UpdateOrder
|
Int | Controls the order in which this component is updated. |
Enabled
|
Bool | Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't. |
Inertia
|
Float | Controls the amount of inertia a bone experiences. Does not affect acceleration of bones. |
InertiaForce
|
Float | Controls the amount of inertia a bone experiences. Does affect acceleration of bones. |
Damping
|
Float | Controls the amount of damping a bone experiences. A high damping value will cause bones to decelerate quickly. |
Elasticity
|
Float | Controls the elasticity of bone joints. A high elasticity value will cause bones to accelerate toward their starting rotation more quickly. |
Stiffness
|
Float | Controls the stiffness of bone joints. |
SimulateTerminalBones
|
Bool | Whether or not to use the last bone in the chain. If your armature has end bones that do not control anything, you probably want this off. |
BaseBoneRadius
|
Float | The default size of the sphere that allows a bone to be interacted with. |
DynamicPlayerCollision
|
Bool | Whether or not to allow this bone chain to collide with players. |
CollideWithOwnBody
|
Bool | Whether or not to allow this bone chain to collide with the active user of the dynamic bone chain. |
HandCollisionVibration
|
VibratePreset | The vibration intensity when touching the chain colliders with a hand. |
CollideWithHead
|
Bool | Whether or not to allow this bone chain to collide with player heads. |
CollideWithBody
|
Bool | Whether or not to allow this bone chain to collide with player body parts. |
CollideWithLeftHand
|
Bool | Whether or not to allow this bone chain to collide with a player's left hand. |
CollideWithRightHand
|
Bool | Whether or not to allow this bone chain to collide with a player's right hand. |
Gravity
|
Float3 | A force like gravity in GravitySpace space that should be applied to the bone chain at all times.
|
GravitySpace
|
direct RootSpace | The coordinate space to apply Gravity in.
|
UseUserGravityDirection
|
Bool | Whether or not to use the active user of the dynamic bone chain's character controller gravity for the gravity direction |
LocalForce
|
Float3 | Constant force being applied to the bone in the dynamic bone chain's local space. |
GlobalStretch
|
Float | How stretched out the bone chain should be at rest. |
MaxStretchRatio
|
Float | The maximum amount of stretching that can be caused by pulling on the bones. |
CurrentStretchRatio
|
raw output of Float | The current amount of stretching applied to the bones. |
StretchRestoreSpeed
|
Float | How quickly extra stretching dissipates. |
UseLocalUserSpace
|
Bool | Whether or not to make the dynamic bone only respond to movements generated from the user slot's local position changing. |
SimulationSpace
|
direct RootSpace | The coordinate space that movement in should affect this dynamic bone chain. |
StaticColliders
|
list of IDynamicBoneCollider | A list of dynamic bone collider components to be used. |
VisualizeColliders
|
Bool | Causes all bone colliders colliding with this bone to be displayed. |
VisualizeBones
|
Bool | Causes the bones, their colliders, and the connections between them to be displayed. |
IsGrabbable
|
Bool | Allows you to grab bones by touching them and grabbing. Requires DynamicPlayerCollision to be checked. |
ActiveUserRootOnly
|
Bool | Allows the active user of the dynamic bone chain to be the only user that can grab it. |
AllowSteal
|
Bool | Whether or not a second user can grab the chain while someone is holding it. |
GrabPriority
|
Int | Determines what gets grabbed if several grabbable objects are touching someone's grab sphere. The IGrabbable with the highest priority will be grabbed first. If the highest priority ties with another IGrabbable, it will grab both of those and ignore any lower priority IGrabbables. |
IgnoreGrabOnFirstBone
|
Bool | Prevents EffectorBoneIndex from being 0 while being grabbed. |
GrabRadiusTolerance
|
Float | how much further a user can grab a bone with their grab sphere despite the radius of the bone not being in contact with their grab sphere. |
GrabReleaseDistance
|
Float | How far a bone can be dragged before it automatically releases. |
GrabSlipping
|
Bool | Whether or not to make the EffectorBoneIndex increase as the hand moves along the bone chain away from the first bone in the chain. Does not let EffectorBoneIndex decrease unless re-grabbed. |
GrabTerminalBones
|
Bool | Whether or not the final bone in the chain can be grabbed. |
GrabVibration
|
VibratePreset | The vibration intensity when grabbing the chain with a hand. |
IgnoreOwnLeftHand
|
Bool | Whether or not to allow this bone chain to be grabbed with the left hand of the active user of the dynamic bone chain. |
IgnoreOwnRightHand
|
Bool | Whether or not to allow this bone chain to be grabbed with the right hand of the active user of the dynamic bone chain. |
EffectorTarget
|
Slot | The chain tries to position one if its bones at this slot (used for grabbing) |
EffectorBoneIndex
|
Int | Which bone is being positioned, every other bone after this acts as if it is not being grabbed |
EffectorBoneOffset
|
Float3 | acts as an offset from the grabbing slot in the grabbing slot's local space at the moment the bone was grabbed. Essentially prevents the bone from snapping to the center of the hand's grab sphere and keeps an offset for a smoother grabbing experience. Is automatically set every grab. |
_activeGrabber
|
Grabber | The grabber component that is grabbing this bone chain currently |
Bones
|
list of Bone | The bones that should be controlled by this dynamic bone chain. |
Sync Delegates
Method Name | Method type and Arguments. | Description |
---|---|---|
SetupFromChildren()
|
Delegate<IButton: button, ButtonEventData: eventData> | Sets up bones from children, ignoring ones already driven. |
SetupFromAllChildren()
|
Delegate<IButton: button, ButtonEventData: eventData> | Sets up all children bones, regardless of if they are driven by breaking the drive links and replacing them with ones from this component. |
SetupFromAllRigChildren()
|
Delegate<IButton: button, ButtonEventData: eventData> | sets up child bones as dynamic bones for this component. Ignores all slots except for one's epecified in a Rig component on a slot that is a parent to the slot this dynamic bone component is on. |
ReplaceSmoothTransforms()
|
Delegate<IButton: button, ButtonEventData: eventData> | Replace any smooth transforms affecting the bones targeted by this chain with drives from this chain. |
AddCollidersFromHierarchy()
|
Delegate<IButton: button, ButtonEventData: eventData> | Add all colliders in hiearchy under this bone that are dynamic bone colliders to this bone chain's StaticColliders list.
|
AlwaysGrabLastBone()
|
Delegate<IButton: button, ButtonEventData: eventData> | changes the GrabOverride on every Bone in the chain to point to the last bone in the chain.
|
CleanSmoothTransforms()
|
Delegate<IButton: button, ButtonEventData: eventData> | Gets rid of smooth transforms on targeted bones. |
Bone
Name | Type | Description |
---|---|---|
BoneSlot
|
Slot | The slot of the dynamic bone this bone is referring to. |
OrigPosition
|
Float3 | The rest position of BoneSlot .
|
OrigRotation
|
FloatQ | The rest rotation of BoneSlot .
|
RadiusModifier
|
Float | How much to multiply the default radius specified by the dynamic bone chain to make this bone's radius. |
GrabOverride
|
Bone | A Bone the same type as this Bone that will be grabbed instead of this bone when this bone is grabbed. |
Collide
|
Bool | Whether this bone has collisions. |
_posDrive
|
field drive of Float3 | The position of BoneSlot which this should be driving to make the dynamic bone movement effects.
|
_rotDrive
|
field drive of FloatQ | The rotation BoneSlot which this should be driving to make the dynamic bone movement effects.
|
Bone Sync Delegates
Method Name | Method type and Arguments. | Description |
---|---|---|
OnSetupFromSlot()
|
Delegate<IButton: button, ButtonEventData: eventData> | Sets up the OrigPosition , OrigRotation , _rotDrive , and _posDrive fields of the Bone when pressed and BoneSlot is not null.
|