Overview
The class Bone is the basic building block for inverse kinematics.
Bone objects can be assembled in a tree-structure using the instance variables parent and children.
A Bone has a head, which is a point in space around which it can be rotated, and a length. Both can be initilized and read using the members currentHead and currentLength. Head, rotation, and length define a second point in space, which can be requested from currentTail.
The rotation can be limited using the members minAngle and maxAngle. The angle is measured in reagard to the parent-bone. The current value can be initalized and read from currentAngle.
The Node objects which need to be translated and rotated according to the Bone can be set using content. All Bone objects need to be assigned to a Skeleton, the Node which needs to be added to the scenegraph. All coordinates of a Bone are based on the local coordinate-system of its Skeleton.
Profile: desktop
Variable Summary
| access | name | type | Can Read | Can Init | Can Write | Default Value | description |
|---|---|---|---|---|---|---|---|
| public | children | Bone[] | ![]() | ![]() | ![]() | [] |
The children of this Bone. |
| public | content | Node[] | ![]() | ![]() | ![]() | [] |
The Node objects which are controlled by this Bone.
The Node objects which are controlled by this Bone. If this Bone is translated or rotated, the Node objects in content are updated accordingly. []Profile: desktop |
| public-init | currentAngle | Number | ![]() | ![]() | 0.0 |
The current angle of this Bone.
The current angle of this Bone. The angle is measured in degrees between this Bone and the extension of its parent, an angle of null degrees results in a straight line. An angle has a value in the range [-180..180]. The angle can be bounded using minAngle and maxAngle. 0.0Profile: desktop |
|
| public-init | currentHead | Point2D | ![]() | ![]() | Geometry.ZERO_POINT |
The current position of the head of this Bone.
The current position of the head of this Bone. The head is calculated in local coordinates of the skeleton. If parent is set during initialization, the value of currentHead is ignored. The head's position can be altered using toHead . Geometry.ZERO_POINTProfile: desktop |
|
| public-init | currentLength | Number | ![]() | ![]() | 0.0 |
The current length of this Bone. |
|
| public-read | currentTail | Point2D | ![]() |
The current position of the tail of this Bone.
The current position of the tail of this Bone. The tail is calculated in local coordinates of the skeleton. The tail's position can be altered using toTail. Profile: desktop |
|||
| package | group | Group | |||||
| public-init | maxAngle | Number | ![]() | ![]() | 180.0 |
The upper bound of the angle of this Bone. |
|
| public-init | minAngle | Number | ![]() | ![]() | -180.0 |
The lower bound of the angle of this Bone. |
|
| public | parent | Bone | ![]() | ![]() | ![]() | null |
The parent-Bone of this Bone. |
| public-read | rotate | Number | ![]() |
The current rotation of this Bone in relation to the Skeleton. |
|||
| public-init | skeleton | Skeleton | ![]() | ![]() | ![]() | null |
The skeleton is the Node in the scenegraph, that determines how Bone objects are rendered.
The skeleton is the Node in the scenegraph, that determines how Bone objects are rendered. All connected Bone objects in a tree belong to one Skeleton. (This is taken care of automatically. If the skeleton of one Bone is changed, the skeleton-values for all connected Bone objects are updated. All coordinates of this Bone are based on the local coordinate-system of this Skeleton. nullProfile: desktop |
| public | toHead | TargetShape | ![]() | ![]() | ![]() |
The TargetShape where the head of this Bone should be pulled.
The TargetShape where the head of this Bone should be pulled. Local coordinates of the skeleton are used for toHead. Currently only points can be used for TargetShape. Profile: desktop |
|
| public | toTail | TargetShape | ![]() | ![]() | ![]() |
The TargetShape where the tail of this Bone should be pulled.
The TargetShape where the tail of this Bone should be pulled. Local coordinates of the skeleton are used for toTail. Currently only points can be used for TargetShape. Profile: desktop |

