This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_actorik [2025/06/23 16:08] – [ECBehaviorActorIK] dragonlord | dragengine:modules:dragonscript:behavior_actorik [2025/06/23 16:14] (current) – [Element Class Example] dragonlord | ||
---|---|---|---|
Line 18: | Line 18: | ||
The behavior supports these controllers to input IK information to the animator. | The behavior supports these controllers to input IK information to the animator. | ||
- | The **IK Position Controller** is used to set position of the target relative to the component assigned to the animator. The position is assigned as '//vector value//. | + | The **IK Position Controller** is used to set position of the target relative to the component assigned to the animator. The position is assigned as //vector value//. |
The **IK Rotation Controller** is used to set orientation of the target relative to the component assigned to the animator. The orientation is assigned as //vector value//. | The **IK Rotation Controller** is used to set orientation of the target relative to the component assigned to the animator. The orientation is assigned as //vector value//. | ||
- | The **IK Height Controller** is used to set the height of the target above the ground. This is the same value as '' | + | The **IK Height Controller** is used to set the height of the target above the ground. This is the same value as '' |
allows to fine tune animators to different target heights above ground. To get the best results you usually have to use an animation for reaching at objects in upright and crouched position. Using this controller you can blend between such animations. | allows to fine tune animators to different target heights above ground. To get the best results you usually have to use an animation for reaching at objects in upright and crouched position. Using this controller you can blend between such animations. | ||
- | The **IK Pan Controller** is used to set the left-right position of the target. This is the same value as '' | + | The **IK Pan Controller** is used to set the left-right position of the target. This is the same value as '' |
- | The **IK Distance Controller** is used to set the forward-backward position of the target. This is the same value as '' | + | The **IK Distance Controller** is used to set the forward-backward position of the target. This is the same value as '' |
- | The **IK Azimuth Controller** is used to set the left-right rotation of the target. This is the same value as '' | + | The **IK Azimuth Controller** is used to set the left-right rotation of the target. This is the same value as '' |
- | The **IK Elevation Controller** is used to set the up-down rotation of the target. This is the same value as '' | + | The **IK Elevation Controller** is used to set the up-down rotation of the target. This is the same value as '' |
====== Instance Counts ====== | ====== Instance Counts ====== | ||
Line 39: | Line 39: | ||
====== Element Class Properties ====== | ====== Element Class Properties ====== | ||
- | Element class properties have the prefix | + | Element class properties have the prefix |
===== controllerIKPosition ===== | ===== controllerIKPosition ===== | ||
Name of the controller to assign IK position to using //vector value//. If the controller is not found it is ignored. | Name of the controller to assign IK position to using //vector value//. If the controller is not found it is ignored. | ||
- | * Full name: "actorIK.controllerIKPosition" | + | * Full name: '' |
* Type string | * Type string | ||
* Default Value '' | * Default Value '' | ||
Line 49: | Line 49: | ||
===== controllerIKRotation ===== | ===== controllerIKRotation ===== | ||
- | Name of the controller to assign IK rotatio | + | Name of the controller to assign IK rotation |
- | * Full name: "actorIK.controllerIKRotation" | + | * Full name: '' |
* Type string | * Type string | ||
* Default Value '' | * Default Value '' | ||
Line 57: | Line 57: | ||
===== controllerIKHeight ===== | ===== controllerIKHeight ===== | ||
Name of the controller to assign IK height (Y axis position) to using //value//. If the controller is not found it is ignored. | Name of the controller to assign IK height (Y axis position) to using //value//. If the controller is not found it is ignored. | ||
- | * Full name: "actorIK.controllerIKHeight" | + | * Full name: '' |
* Type string | * Type string | ||
* Default Value '' | * Default Value '' | ||
Line 64: | Line 64: | ||
===== controllerIKPan ===== | ===== controllerIKPan ===== | ||
Name of the controller to assign IK pan (X axis position) to using //value//. If the controller is not found it is ignored. | Name of the controller to assign IK pan (X axis position) to using //value//. If the controller is not found it is ignored. | ||
- | * Full name: "actorIK.controllerIKPan" | + | * Full name: '' |
* Type string | * Type string | ||
* Default Value '' | * Default Value '' | ||
Line 71: | Line 71: | ||
===== controllerIKDistance ===== | ===== controllerIKDistance ===== | ||
Name of the controller to assign IK distance (Z axis position) to using //value//. If the controller is not found it is ignored. | Name of the controller to assign IK distance (Z axis position) to using //value//. If the controller is not found it is ignored. | ||
- | * Full name: "actorIK.controllerIKDistance" | + | * Full name: '' |
* Type string | * Type string | ||
* Default Value '' | * Default Value '' | ||
Line 78: | Line 78: | ||
===== controllerIKAzimuth ===== | ===== controllerIKAzimuth ===== | ||
Name of the controller to assign IK azimuth (Y axis rotation) to using //value//. If the controller is not found it is ignored. | Name of the controller to assign IK azimuth (Y axis rotation) to using //value//. If the controller is not found it is ignored. | ||
- | * Full name: "actorIK.controllerIKAzimuth" | + | * Full name: '' |
* Type string | * Type string | ||
* Default Value '' | * Default Value '' | ||
Line 85: | Line 85: | ||
===== controllerIKElevation ===== | ===== controllerIKElevation ===== | ||
Name of the controller to assign IK elevation (X axis rotation) to using //value//. If the controller is not found it is ignored. | Name of the controller to assign IK elevation (X axis rotation) to using //value//. If the controller is not found it is ignored. | ||
- | * Full name: "actorIK.controllerIKElevation" | + | * Full name: '' |
* Type string | * Type string | ||
* Default Value '' | * Default Value '' | ||
Line 119: | Line 119: | ||
| | ||
- | public | + | func new() super(" |
// the base actor class creates an actor animated behavior we can use | // the base actor class creates an actor animated behavior we can use | ||
Line 134: | Line 134: | ||
| | ||
- | public | + | func new() |
end | end | ||
Line 145: | Line 145: | ||
// enable IK while this action is assigned to an actor then disable it again. | // enable IK while this action is assigned to an actor then disable it again. | ||
// using disable() instead of setEnabled(false) also clears the target | // using disable() instead of setEnabled(false) also clears the target | ||
- | public | + | func void activate() |
super.activate() | super.activate() | ||
actorIK.setTarget(targetElementToTouch) | actorIK.setTarget(targetElementToTouch) | ||
Line 151: | Line 151: | ||
end | end | ||
- | public | + | func void deactivate() |
actorIK.disable() | actorIK.disable() | ||
super.deactivate() | super.deactivate() | ||
Line 166: | Line 166: | ||
| | ||
- | public | + | func new() super(" |
// the base actor class creates an actor animated behavior we can use | // the base actor class creates an actor animated behavior we can use | ||
Line 190: | Line 190: | ||
| | ||
- | public | + | func new() |
end | end | ||
Line 205: | Line 205: | ||
// from the point of view of the element. the target position is always | // from the point of view of the element. the target position is always | ||
// relative to the target element. | // relative to the target element. | ||
- | public | + | func void activate() |
super.activate() | super.activate() | ||
| | ||
Line 217: | Line 217: | ||
end | end | ||
- | public | + | func void deactivate() |
actorIKLeft.disable() | actorIKLeft.disable() | ||
actorIKRight.disable() | actorIKRight.disable() |