We have released a new mechanical element called TorsionSpringConstraint!
This physics item performs a similar function as the SpringConstraint but instead of applying a force opposing the linear distance/motion between bodies, it applies a torque to oppose angular difference and angular motion. More specifically, this constraint applies a torque based on torsional spring and damper behavior to bring the secondary axes of two attachments together such that the angle between them eventually becomes zero.
Some places where you may want to use TorsionSpringConstraint could be in a door hinge, for vehicle suspension, in robotics, etc.
How to Use
First, access the joint in the “Model/Create’’ menu. Place an attachment on one body and the second attachment on a different body. The constraint will try to bring the secondary axes of attachment0 and attachment1 of the constraint together (see picture/model below).
TorsionalSpring.rbxl (24.8 KB)
By changing the Stiffness and the Damping parameters, you can control how large the resulting torque should be with respect to the angular difference and relative angular velocity of the secondary axes, respectively.
You can also limit the relative angular motion of the secondary axes of attachments via LimitEnabled properties. This way the motion of the secondary axis of attachement1 will be limited by a cone. This cone is formed via attachemnt0 and its secondary axis and its angle is defined via the MaxAngle property. (see documentation for more details)
TorsionSpringConstraint is an ideal element to couple with constraints such as HingeConstraints to control the relative rotational motion of the underlying bodies. See for example:
We hope you enjoy this new element. Show us if you find any fun uses for it!