Skip to main content
added 49 characters in body
Source Link
bluescrn
  • 3.4k
  • 26
  • 30

It's a while since I played Worms, but from what I remember - when the rope wraps around things, there's only one (straight) section of rope that's moving at any one time. The rest of the rope becomes static

So there's very little actual physics involved. The active section can be modelled as a single stiff spring with a mass on the end

The interesting bit will be the logic for splitting/joining inactive sections of the rope to/from the active section.

I'd imagine there'd be 2 main operations:

'Split' - The rope has intersected something. Split it at the intersection into an inactive section and the new, shorter, active section

'Join' - The active rope has moved into a position where the nearest intersection no longer exists (this may just be a simple angle/dot product test?). Rejoin 2 sections, creating a new, longer, active section

(Of course, with modern physics engines and In a fair bit of CPU powerscene constructed from 2D polygons, you might get away withall split points should be at a whole load of small rigid bodies and suitable constraintsvertex on the collision mesh. But that'll be costlyCollision detection may simplify down to something along the lines of 'If the rope passes over a vertex on this update, and potentially not too stablesplit/join the rope at that vertex?)

It's a while since I played Worms, but from what I remember - when the rope wraps around things, there's only one (straight) section of rope that's moving at any one time. The rest of the rope becomes static

So there's very little actual physics involved. The active section can be modelled as a single stiff spring with a mass on the end

The interesting bit will be the logic for splitting/joining inactive sections of the rope to/from the active section.

I'd imagine there'd be 2 main operations:

'Split' - The rope has intersected something. Split it at the intersection into an inactive section and the new, shorter, active section

'Join' - The active rope has moved into a position where the nearest intersection no longer exists (this may just be a simple angle/dot product test?). Rejoin 2 sections, creating a new, longer, active section

(Of course, with modern physics engines and a fair bit of CPU power, you might get away with a whole load of small rigid bodies and suitable constraints. But that'll be costly, and potentially not too stable?)

It's a while since I played Worms, but from what I remember - when the rope wraps around things, there's only one (straight) section of rope that's moving at any one time. The rest of the rope becomes static

So there's very little actual physics involved. The active section can be modelled as a single stiff spring with a mass on the end

The interesting bit will be the logic for splitting/joining inactive sections of the rope to/from the active section.

I'd imagine there'd be 2 main operations:

'Split' - The rope has intersected something. Split it at the intersection into an inactive section and the new, shorter, active section

'Join' - The active rope has moved into a position where the nearest intersection no longer exists (this may just be a simple angle/dot product test?). Rejoin 2 sections, creating a new, longer, active section

In a scene constructed from 2D polygons, all split points should be at a vertex on the collision mesh. Collision detection may simplify down to something along the lines of 'If the rope passes over a vertex on this update, split/join the rope at that vertex?

Source Link
bluescrn
  • 3.4k
  • 26
  • 30

It's a while since I played Worms, but from what I remember - when the rope wraps around things, there's only one (straight) section of rope that's moving at any one time. The rest of the rope becomes static

So there's very little actual physics involved. The active section can be modelled as a single stiff spring with a mass on the end

The interesting bit will be the logic for splitting/joining inactive sections of the rope to/from the active section.

I'd imagine there'd be 2 main operations:

'Split' - The rope has intersected something. Split it at the intersection into an inactive section and the new, shorter, active section

'Join' - The active rope has moved into a position where the nearest intersection no longer exists (this may just be a simple angle/dot product test?). Rejoin 2 sections, creating a new, longer, active section

(Of course, with modern physics engines and a fair bit of CPU power, you might get away with a whole load of small rigid bodies and suitable constraints. But that'll be costly, and potentially not too stable?)