ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
fl.ik 

IKJoint  - AS3 Flash

Packagefl.ik
Classpublic class IKJoint
InheritanceIKJoint Inheritance Object

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The IKJoint class defines a connection between two bones, which are required foundational components of an inverse kinematics (IK) armature. IKJoint objects are called "joints" and the IKJoint class defines properties and constraints for how bones connect and move in relation to one another.

More examples

Related API Elements



Public Properties
 PropertyDefined By
  bone : IKBone
[read-only] The head bone associated with the IKJoint object.
IKJoint
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  DOF_ROTATION : int = 1
[static] Static constant for the rotation degree of freedom.
IKJoint
  DOF_XTRANS : int = 2
[static] Static constant for the x-translation degree of freedom.
IKJoint
  DOF_YTRANS : int = 4
[static] Static constant for the y-translation degree of freedom.
IKJoint
  name : String
The IKJoint instance's name.
IKJoint
  numChildren : int
[read-only] Returns the number of IKJoint objects branching from the specified IKJoint.
IKJoint
  parent : IKJoint
The parent IKJoint object.
IKJoint
  position : Point
[read-only] The IKJoint's coordinates.
IKJoint
  rotation : Number
[read-only] The current rotation value.
IKJoint
  rotationConstrained : Boolean
Returns if the rotation is constrained.
IKJoint
  rotationEnabled : Boolean
Specifies if the rotation is enabled.
IKJoint
  rotationMax : Number
The maximum rotation value.
IKJoint
  rotationMin : Number
The minimum rotation value.
IKJoint
  speed : Number
The rotation speed degree of freedom; the xTranslation and yTranslation properties respect the same speed setting.
IKJoint
  springDamping : Number
The spring damping value.
IKJoint
  springPosition : Number
The spring position (for translational joints) or angle (for rotational joints).
IKJoint
  springStrength : Number
The spring strength value.
IKJoint
  xTranslation : Number
[read-only] The current x-translation value.
IKJoint
  xTranslationConstrained : Boolean
Returns if the x-translation is constrained.
IKJoint
  xTranslationEnabled : Boolean
Specifies if the x-translation is enabled.
IKJoint
  xTranslationMax : Number
The maximum x-translation value.
IKJoint
  xTranslationMin : Number
The minimum x-translation value.
IKJoint
  yTranslation : Number
[read-only] The current y-translation value.
IKJoint
  yTranslationConstrained : Boolean
Returns if the y-translation is constrained.
IKJoint
  yTranslationEnabled : Boolean
Specifies if the y-translation is enabled.
IKJoint
  yTranslationMax : Number
The maximum y-translation value.
IKJoint
  yTranslationMin : Number
The minimum y-translation value.
IKJoint
Public Methods
 MethodDefined By
  
Clears the current spring angle.
IKJoint
  
Clears the current spring point.
IKJoint
  
Returns the child IKJoint object at the specified index value.
IKJoint
  
Returns the index value of the specified IKJoint object.
IKJoint
  
Retrieves the current value of the specified type of degree of freedom.
IKJoint
  
Returns the current spring angle.
IKJoint
  
Returns the current spring point.
IKJoint
 Inherited
Indicates whether an object has a specified property defined.
Object
  
hasPhysics(recursive:Boolean = true):Boolean
Returns whether the sub-tree (children) of the joint has physics applied.
IKJoint
  
Returns whether the current spring angle is set.
IKJoint
  
Returns whether a spring point is currently set.
IKJoint
  
Returns if the type of degree of freedom is constrained.
IKJoint
  
Returns if the specified type of degree of freedom is enabled.
IKJoint
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
setConstrained(dof:int, constrained:Boolean):void
Sets the constraint of the specified type of degree of freedom.
IKJoint
  
setEnabled(dof:int, enable:Boolean):*
Enables or disables the specified type of degree of freedom.
IKJoint
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
Sets the current spring angle.
IKJoint
  
Sets the current spring point.
IKJoint
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Property Detail

bone

property
bone:IKBone  [read-only]

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The head bone associated with the IKJoint object.



Implementation
    public function get bone():IKBone

DOF_ROTATION

property 
public static var DOF_ROTATION:int = 1

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Static constant for the rotation degree of freedom.

DOF_XTRANS

property 
public static var DOF_XTRANS:int = 2

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Static constant for the x-translation degree of freedom.

DOF_YTRANS

property 
public static var DOF_YTRANS:int = 4

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Static constant for the y-translation degree of freedom.

name

property 
name:String

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The IKJoint instance's name.



Implementation
    public function get name():String
    public function set name(value:String):void

numChildren

property 
numChildren:int  [read-only]

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Returns the number of IKJoint objects branching from the specified IKJoint. This method does not account for sub-branches. Traverse each child branch to traverse the whole IKArmature object.



Implementation
    public function get numChildren():int

parent

property 
parent:IKJoint

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The parent IKJoint object.



Implementation
    public function get parent():IKJoint
    public function set parent(value:IKJoint):void

position

property 
position:Point  [read-only]

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The IKJoint's coordinates.



Implementation
    public function get position():Point

rotation

property 
rotation:Number  [read-only]

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The current rotation value. This value is read-only. The IKMover object udpates this value automatically during an IK movement.



Implementation
    public function get rotation():Number

rotationConstrained

property 
rotationConstrained:Boolean

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Returns if the rotation is constrained.



Implementation
    public function get rotationConstrained():Boolean
    public function set rotationConstrained(value:Boolean):void

rotationEnabled

property 
rotationEnabled:Boolean

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Specifies if the rotation is enabled.



Implementation
    public function get rotationEnabled():Boolean
    public function set rotationEnabled(value:Boolean):void

rotationMax

property 
rotationMax:Number

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The maximum rotation value.



Implementation
    public function get rotationMax():Number
    public function set rotationMax(value:Number):void

rotationMin

property 
rotationMin:Number

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The minimum rotation value.



Implementation
    public function get rotationMin():Number
    public function set rotationMin(value:Number):void

speed

property 
speed:Number

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The rotation speed degree of freedom; the xTranslation and yTranslation properties respect the same speed setting.



Implementation
    public function get speed():Number
    public function set speed(value:Number):void

springDamping

property 
springDamping:Number

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10, AIR 1.5

The spring damping value. Damping adds spring resistance when used in conjunction with the strength property. It affects the rate of decay for the spring, which is the amount of time between the initial movement and when the bones connected to the joint return to their rest position. The range is from 0 (no resistance, the default) to 100 (highly damped). A maximum damping value does not negate strength With damping at 100 and strength at 1, there is still an effect. Because of the rigidity of the joint, it may be difficult to notice, but there is a physics-based reaction nonetheless.



Implementation
    public function get springDamping():Number
    public function set springDamping(value:Number):void

Example  ( How to use this example )
The following example applies randomly generated IKJoint.springStrength and IKJoint.springDamping values for each joint of the first armature on the stage. This example comes from Mike Welsh.
import fl.ik.*;

var armature:IKArmature = IKManager.getArmatureAt(0);
armature.springsEnabled = true;
var joint:IKJoint = armature.rootJoint;
while(joint)
{
    joint.springStrength = Math.random() * 10;
    joint.springDamping = Math.random() * 100;
    
    if(joint.numChildren > 0)joint = joint.getChildAt(0);
    else joint = null;
}

springPosition

property 
springPosition:Number

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10, AIR 1.5

The spring position (for translational joints) or angle (for rotational joints).



Implementation
    public function get springPosition():Number
    public function set springPosition(value:Number):void

springStrength

property 
springStrength:Number

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10, AIR 1.5

The spring strength value. This is the amount of spring in the joint. The range is from 1-100, with 0 being rigid (the default Flash behavior) and 100 being a very loose spring that is mostly controlled by physics.



Implementation
    public function get springStrength():Number
    public function set springStrength(value:Number):void

Example  ( How to use this example )
The following example applies randomly generated IKJoint.springStrength and IKJoint.springDamping values for each joint of the first armature on the stage. This example comes from Mike Welsh.
import fl.ik.*;

var armature:IKArmature = IKManager.getArmatureAt(0);
armature.springsEnabled = true;
var joint:IKJoint = armature.rootJoint;
while(joint)
{
    joint.springStrength = Math.random() * 10;
    joint.springDamping = Math.random() * 100;
    
    if(joint.numChildren > 0)joint = joint.getChildAt(0);
    else joint = null;
}

xTranslation

property 
xTranslation:Number  [read-only]

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The current x-translation value. This value is read-only. The IKMover object udpates this value automatically during an IK movement.



Implementation
    public function get xTranslation():Number

xTranslationConstrained

property 
xTranslationConstrained:Boolean

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Returns if the x-translation is constrained.



Implementation
    public function get xTranslationConstrained():Boolean
    public function set xTranslationConstrained(value:Boolean):void

xTranslationEnabled

property 
xTranslationEnabled:Boolean

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Specifies if the x-translation is enabled.



Implementation
    public function get xTranslationEnabled():Boolean
    public function set xTranslationEnabled(value:Boolean):void

xTranslationMax

property 
xTranslationMax:Number

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The maximum x-translation value.



Implementation
    public function get xTranslationMax():Number
    public function set xTranslationMax(value:Number):void

xTranslationMin

property 
xTranslationMin:Number

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The minimum x-translation value.



Implementation
    public function get xTranslationMin():Number
    public function set xTranslationMin(value:Number):void

yTranslation

property 
yTranslation:Number  [read-only]

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The current y-translation value. This value is read-only. The IKMover object udpates this value automatically during an IK movement.



Implementation
    public function get yTranslation():Number

yTranslationConstrained

property 
yTranslationConstrained:Boolean

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Returns if the y-translation is constrained.



Implementation
    public function get yTranslationConstrained():Boolean
    public function set yTranslationConstrained(value:Boolean):void

yTranslationEnabled

property 
yTranslationEnabled:Boolean

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Specifies if the y-translation is enabled.



Implementation
    public function get yTranslationEnabled():Boolean
    public function set yTranslationEnabled(value:Boolean):void

yTranslationMax

property 
yTranslationMax:Number

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The maximum y-translation value.



Implementation
    public function get yTranslationMax():Number
    public function set yTranslationMax(value:Number):void

yTranslationMin

property 
yTranslationMin:Number

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

The minimum y-translation value.



Implementation
    public function get yTranslationMin():Number
    public function set yTranslationMin(value:Number):void
Method Detail

clearSpringAngle

()method
public function clearSpringAngle():void

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10, AIR 1.5

Clears the current spring angle.

clearSpringPoint

()method 
public function clearSpringPoint():void

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10, AIR 1.5

Clears the current spring point.

getChildAt

()method 
public function getChildAt(iChild:int):IKJoint

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Returns the child IKJoint object at the specified index value.

Parameters

iChild:int — The zero-based index number of the joint to retrieve.

Returns
IKJoint — Returns the IKJoint instance at the specified index value.

getChildIndex

()method 
public function getChildIndex(child:IKJoint):int

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Returns the index value of the specified IKJoint object.

Parameters

child:IKJoint — The targeted child joint.

Returns
int — Returns the zero-based index value of the specified IKJoint object.

getJointValue

()method 
public function getJointValue(dof:int):Number

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Retrieves the current value of the specified type of degree of freedom.

Parameters

dof:int — An integer specifying a type of degree of freedom. This value can be 1 (rotation), 2 (x-translation), or 4 (y-translation).

Returns
Number

getSpringAngle

()method 
public function getSpringAngle():Number

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10, AIR 1.5

Returns the current spring angle.

Returns
Number

getSpringPt

()method 
public function getSpringPt():Point

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10, AIR 1.5

Returns the current spring point.

Returns
Point

hasPhysics

()method 
public function hasPhysics(recursive:Boolean = true):Boolean

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10, AIR 1.5

Returns whether the sub-tree (children) of the joint has physics applied.

Parameters

recursive:Boolean (default = true)

Returns
Boolean

hasSpringAngle

()method 
public function hasSpringAngle():Boolean

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10, AIR 1.5

Returns whether the current spring angle is set.

Returns
Boolean

hasSpringPoint

()method 
public function hasSpringPoint():Boolean

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10, AIR 1.5

Returns whether a spring point is currently set.

Returns
Boolean

isConstrained

()method 
public function isConstrained(dof:int):Boolean

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Returns if the type of degree of freedom is constrained.

Parameters

dof:int — An integer specifying a type of degree of freedom. This value can be 1 (rotation), 2 (x-translation), or 4 (y-translation).

Returns
Boolean

isEnabled

()method 
public function isEnabled(dof:int):*

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Returns if the specified type of degree of freedom is enabled.

Parameters

dof:int — An integer specifying a type of degree of freedom. This value can be 1 (rotation), 2 (x-translation), or 4 (y-translation).

Returns
* — A Boolean value indicating whether the specific degree of freedom is enabled (true), or not (false).

setConstrained

()method 
public function setConstrained(dof:int, constrained:Boolean):void

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Sets the constraint of the specified type of degree of freedom.

Parameters

dof:int — An integer specifying a type of degree of freedom. This value can be 1 (rotation), 2 (x-translation), or 4 (y-translation).
 
constrained:Boolean — Use true to constrain the specified degree of freedom, otherwise use false.

setEnabled

()method 
public function setEnabled(dof:int, enable:Boolean):*

Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: Flash Player 10, AIR 1.5

Enables or disables the specified type of degree of freedom.

Parameters

dof:int — An integer specifying a type of degree of freedom. This value can be 1 (rotation), 2 (x-translation), or 4 (y-translation).
 
enable:Boolean — If set to true the specified degree of freedom is enabled.

Returns
*

setSpringAngle

()method 
public function setSpringAngle(angle:Number):void

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10, AIR 1.5

Sets the current spring angle.

Parameters

angle:Number

setSpringPt

()method 
public function setSpringPt(pt:Point):void

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10, AIR 1.5

Sets the current spring point.

Parameters

pt:Point