X3DObject.Kinematics

X3DObject.Kinematics

説明

オブジェクトの Kinematics オブジェクトを戻します。

C#構文

// get accessor

Kinematics rtn = X3DObject.Kinematics;

1. JScript の例

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 の例

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