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).
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!
Although I only program and make UI, I’m sure this will help out with building. Will this be able to go in any direction, or angle? Will the spring disappear in the game?
For elevators you’ll want a PrismaticConstraint not a TorsionSpringConstraint. Elevators are probably not going to be rotating or springing past limits unless you have a really funky and special elevator.
OH WOW, I wasn’t expecting this to come out at all, but DANG this is nice I can already see people using this for car suspensions in the future. Great job
These contraint updates are cool and all, but I don’t see much use of them besides some weird showcases. I’d much rather have breakable welds and other constraints more frequently seen in other engines.