Hi All!
I'm working on a new game where you control a crane. From the crane there is a chain attached and under it a hook that can attach to objects.
I want the chain to be able to collide with other objects so it seems realistic. That pretty much rules out a single DistanceLimit as it cannot collide with objects.
Now I've started to make a chain with small boxes and RevoluteJoints (stole the idea from the bridge demo). As long as I make the hook in the end a bit heavier than the rest it seems to behave ok.
The issue is when I want to make the chain longer or shorter, then I need to remove or add items from the link of RevoluteJoints which is a bit tedious. Is there are better way to do it?
Any feedback is appreciated!
Chain/Rope implementation
Re: Chain/Rope implementation
It would probably work better with just BallSocketJoints instead. The RevoluteJoint has a RevoluteAngularJoint which fights any rotation around 2 of 3 degrees of angular freedom; it's like a hinge.I've started to make a chain with small boxes and RevoluteJoints (stole the idea from the bridge demo)
Not a particularly convenient way, no.The issue is when I want to make the chain longer or shorter, then I need to remove or add items from the link of RevoluteJoints which is a bit tedious. Is there are better way to do it?
One possible option, assuming the minimum and maximum are limited, is to connect the entities with a bunch of DistanceLimits rather than BallSocketJoints. You could then reduce the maximum distance to reel it in, just like you could with a single DistanceLimit.
With any entity-based rope, though, you'll have to keep an eye out for instability and bad mass ratios. The individual rope pieces must be quite hefty in both mass and rotational inertia relative to the constraints and load to maintain stability.
Re: Chain/Rope implementation
Thanks for the tips.
I went with the complicated method because I couldn't get it stable with the DistanceLimit for some reason.
Yes you really need to be careful about the balance and the chain/rope gets kind of heavy.
But I'm kind of happy with the result. Now I need to get the darn game done in March
I went with the complicated method because I couldn't get it stable with the DistanceLimit for some reason.
Yes you really need to be careful about the balance and the chain/rope gets kind of heavy.
But I'm kind of happy with the result. Now I need to get the darn game done in March