Pin Constraint
Intro
Pin Shapes to their original position in a Forge Dynamics simulation while allowing them to rotate. Shapes can also be driven by a motor meaning
UI
Horizontal Alignment - Align the position of the Constraint to the left (-1) or right (1) edge of the Body.
Vertical Alignment - Align the position of the Constraint to the top (1) or bottom (-1) edge of the Body.
Motor - When checked, a pinned Shape is given a rotational force.
Motor Speed - Set the speed in which the pinned Shape rotates.
Maximum Torque - Set the torque or force for the Motor. A higher value will mean the pinned Shape is capable of acting against Shapes with a greater density.
Limit Rotation - When checked, the Constraint's rotation will be never go above or below the Rotational Limits.
Rotational Limits - Set an upper (U) and lower (L) angle to clamp the Constraint's rotation.
Tension - When this value is greater than 0, the Constraint will attempt to return to its original angle with a spring-like behaviour where a higher value will result in a stronger spring. When this value is set to 0, the Constraint will rotate freely.
Damping Ratio - Increase/decrease the damping of a Constraint's rotational 'spring' where a value of 0 = bouncy oscillation and 1 = smooth return with no bounce.
Breakable - When enabled, the Constraint can be broken by other forces.
Breaking Mode - Set a condition for the Constraint to break under:
- Force - The Constraint will break when a force is above the Breaking Force.
- Distance - The Constraint will break when it moves beyond its Stretch Limit.
- Time - The Constraint will break when a force above the Breaking Force is sustained for a number of consecutive frames above the Breaking Duration.
Breaking Force - Set the amount of force required to break the Constraint.
Stretch Limit - Set a multiple of the Rest Length a Constraint is moved by before it breaks. For example, if the Rest Length is 100 and the Stretch Limit is 2, the Constraint will break when stretched to .
Breaking Duration - Set the number of consecutive frames a Constraint must be under a force above the Breaking Force before breaking.
Stress Threshold - Set a threshold as a percentage of the Breaking Force within which a Constraint will break.
- Create a Rectangle.
- Set Width to
600and Height to30. - Create an Ellipse.
- Set the Ellipse's Position to
100,400. - Select both Shapes and click the Forge icon in the Shelf.
- Under the Forge Dynamics Bodies tab, click the gear icon for the Rectangle.
- Click the + next to the Constraints attribute towards the bottom of the window and choose Pin Constraint.
- Hit Play
The Ellipse will fall and hit the Rectangle causing it to rotate in place.