Pin Constraint
在 Forge Dynamics 模擬中將 Shape 固定在其原始位置,同時允許它們旋轉。Shape 也可以由 motor 驅動,這意味著它們可用於齒輪、車輪或曲軸等概念。
Horizontal Alignment - 將 Constraint 的位置對齊到 Body 的左邊緣 (-1) 或右邊緣 (1)。
Vertical Alignment - 將 Constraint 的位置對齊到 Body 的上邊緣 (1) 或下邊緣 (-1)。
Motor - 當勾選時,固定的 Shape 會被賦予旋轉力。
Motor Speed - 設定固定 Shape 的旋轉速度。
Maximum Torque - 設定 Motor 的扭矩或力。較高的值意味著固定的 Shape 能夠對抗密度更大的 Shape。
Limit Rotation - 當勾選時,Constraint 的旋轉永遠不會超過 Rotational Limits 的上限或下限。
Rotational Limits - 設定上限 (U) 和下限 (L) 角度以限制 Constraint 的旋轉。
Tension - 當此值大於 0 時,Constraint 將嘗試以彈簧般的行為返回其原始角度,值越高彈簧越強。當此值設定為 0 時,Constraint 將自由旋轉。
Damping Ratio - 增大/減小 Constraint 旋轉 ‘spring’ 的阻尼,值 0 = 彈跳振盪,1 = 平滑返回無彈跳。
Breakable - 當啟用時,Constraint 可以被其他力打破。
Breaking Mode - 設定 Constraint 破裂的條件:
- Force - 當力超過 Breaking Force 時 Constraint 將破裂。
- Distance - 當 Constraint 移動超過其 Stretch Limit 時將破裂。
- Time - 當超過 Breaking Force 的力持續超過 Breaking Duration 定義的連續幀數時,Constraint 將破裂。
Breaking Force - 設定破裂 Constraint 所需的力的量。
Stretch Limit - 設定 Constraint 在破裂前被移動的 Rest Length 的倍數。例如,如果 Rest Length 為 100,Stretch Limit 為 2,則當拉伸到 100×2=200100 \times 2 = 200100×2=200 時 Constraint 將破裂。
Breaking Duration - 設定 Constraint 在破裂前必須承受超過 Breaking Force 的力的連續幀數。
Stress Threshold - 設定作為 Breaking Force 百分比的閾值,在此閾值內 Constraint 將破裂。
- 建立一個 Rectangle。
- 設定 Width 為
600,Height 為30。 - 建立一個 Ellipse。
- 設定 Ellipse 的 Position 為
100,400。 - 選擇兩個 Shape,點擊 Shelf 中的 Forge 圖示。
- 在 Forge Dynamics 的 Bodies 標籤下,點擊 Rectangle 的齒輪圖示。
- 點擊視窗底部 Constraints 屬性旁邊的 +,選擇 Pin Constraint。
- 點擊 Play
Ellipse 將下落並撞擊 Rectangle,使其在固定位置旋轉。