X3DObject.Kinematics

Description

Returns the object's Kinematics object.

Examples

1. JScript Example

NewScene( null, false );
var oRoot = Application.ActiveSceneRoot;
var oNull = oRoot.AddNull();
var oSphere = oRoot.AddGeometry( "Sphere", "MeshSurface" );
var oKinematics = oSphere.Kinematics;
oKinematics.AddConstraint( "Position", oNull, false, new Array(0,45.0,90.0) ) ;
for ( var i=0; i<oKinematics.Constraints.Count; i++ ) {
        var oConstraint = oKinematics.Constraints.Item(i);
        Application.LogMessage( oConstraint.Name + ", " + oConstraint.Type );
}
// Expected results:
//INFO : Position Cns, poscns

2. VBScript Example

NewScene , false
set oRoot = Application.ActiveProject.ActiveScene.Root
set oNull = oRoot.AddNull()
set oSphere = oRoot.AddGeometry( "Sphere", "MeshSurface" )
set oKinematics = oSphere.Kinematics
Application.LogMessage TypeName(oKinematics)
oKinematics.AddConstraint "Position", oNull, False, Array(0,45.0,90.0)
for each oConstraint in oKinematics.Constraints
        Application.LogMessage oConstraint.Name & ", " & TypeName(oConstraint)
next
' Expected results:
'INFO : Kinematics
'INFO : Position Cns, Constraint