Constraint.Constrained

Description

Returns the X3DObject being constrained by the constraining objects.

Examples

JScript Example

NewScene( null, false );
var oRoot = Application.ActiveProject.ActiveScene.Root;
var oNull = oRoot.AddNull();
var oSphere = oRoot.AddGeometry( "Sphere","MeshSurface" );
oSphere.Kinematics.AddConstraint( "Direction", oNull );
oSphere.Kinematics.AddConstraint( "Direction", oNull );
oSphere.Kinematics.AddConstraint( "Direction", oNull );
var oConstraints = oSphere.Kinematics.Constraints;
Application.LogMessage( Application.ClassName(oConstraints) );
for (var i=0; i<oConstraints.Count; i++) {
        Application.LogMessage( oConstraints(i).Name + ", Constrained : " + oConstraints(i).Constrained );
        Application.LogMessage( "Constraining : " );
        var oConstraining = oConstraints(i).Constraining;
        for (var j=0; j<oConstraining.Count; j++) {
                Application.LogMessage( "\t" + oConstraining(j) );
        }
}
// Expected results:
//INFO : ConstraintCollection
//INFO : Direction Cns, Constrained : sphere
//INFO : Constraining : 
//INFO :        null
//INFO : Direction Cns, Constrained : sphere
//INFO : Constraining : 
//INFO :        null
//INFO : Direction Cns, Constrained : sphere
//INFO : Constraining : 
//INFO :        null