Object Hierarchy | 関連する C++クラス:Constraint
Constraint
v1.0
Constraint オブジェクトは、シーングラフのコンストレイントです。コンストレイントにより、オブジェクトを他のオブジェクトのアニメーションに拘束できます。たとえば、方向コンストレイントを使用して必ず別のオブジェクトの方向を向くようにオブジェクトを拘束することができます。オブジェクトのコンストレイントは、Kinematics.AddConstraintメソッドを使用して適用できます。オブジェクト適用されているコンストレイントを検索するにはKinematics.Constraintsプロパティを使用し、特定のパラメータを扱っているコンストレイントを検索するにはParameter.Sourceプロパティを使用します。コンストレイントのタイプは、SIObject.Typeプロパティを使用して取得できます。
'
' This example illustrates how to apply a direction constraint to a sphere so that it always
' points in the direction of the null. We then enumerate all the constraints on the sphere
' using the kinematics.contraints property.
'
Dim oRoot, oNull, oSphere
set oRoot = Application.ActiveProject.ActiveScene.Root
set oNull = oRoot.AddNull
set oSphere = oRoot.AddGeometry("Sphere","MeshSurface")
oSphere.Kinematics.AddConstraint "Direction", oNull
set oConstraints = oSphere.Kinematics.Constraints
for each oCns in oConstraints
LogMessage oCns.FullName
next |