It takes four settings in the properties window to make a Wm2d formula type latch...
First make an actuator such that when it is rigid it latches (prevents) any movement between two objects.
Select the actuator and open the properties window. Set the actuator's type to 'Length'.
Set the actuator's 'Value' as a formula for the actuators current length. To do this, find the index numbers of the two end points of the actuator. Click the down arrow to open the list of all objects, which will indicate which points go with the actuator. Make a formula similar to this: "|Point[64].p-Point[65].p|" This formula begins and ends with a "|" symbol. This tells Wm2d to use the distance between the global positions of the two points.
Uncheck the 'Active when Always' box.
Now comes the hard part. Whenever the actuator is 'Active' its length will be rigid at the current length, which will hold (latch) any movement. You must devise a formula to put into the bottom 'Active when' box for when you want the actuator to be latched rigid.
The formula will be true or false. It will consist of "Or" and/or "And" formulas. If you want latching when a weight is to the right and above the wheel axle then the formula might be "And( Body[56].p.x>0, Body[56].p.y>0 )" You can build very complex formulas such as the one below that I once used.
Code: Select all
Or(And(Body[57].v.r>Body[1].v.r,And(Point[61].p.x>-1.5688,Point[61].p.y<17.3027)),
And(Body[57].v.r<Body[1].v.r,Or(Point[61].p.x<-1.5688,Point[61].p.y>17.3027)))