0% found this document useful (0 votes)
216 views

Fast Blob Physics

This document discusses a method for simulating fast and stable blob physics in a video game. It describes using pressure forces to move vertices inward or outward as needed to maintain a constant blob area, rather than using internal springs. This avoids issues with mesh inversion. The document provides equations for calculating the distance each vertex should move based on the target and current blob areas. It begins discussing collision handling but does not fully explain the method.

Uploaded by

bobbob24
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
216 views

Fast Blob Physics

This document discusses a method for simulating fast and stable blob physics in a video game. It describes using pressure forces to move vertices inward or outward as needed to maintain a constant blob area, rather than using internal springs. This avoids issues with mesh inversion. The document provides equations for calculating the distance each vertex should move based on the target and current blob areas. It begins discussing collision handling but does not fully explain the method.

Uploaded by

bobbob24
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Fast and Stable Blob Physics

Grant Kot In this tutorial, we are going to explore how to create a blob similar to the main character Gish in the video game Gish. Ill also detail a simple collision handling system for multiple blobs that is both fast and stable. Usually blobs are simulated with a combination of edge springs and internal springs to keep their shape. In most of these setups, there will be a point where the blob has deformed so much that the mesh will invert and get stuck. Im going to show you how you can get rid those internal springs, and actually end up with something way more stable. Here is the formula for calculating the area of a polygon:

We want our blobs to behave as if theyre filled with some kind of incompressible fluid. The area of the polygon should stay the same even if the vertices move around. I am going to make the assumption that the pressure force is going to move each vertex the same distance h along its normal if the current area of the polygon is not equal to the target area.

When I plug those terms into the polygon area formula and set it up so that it will equal the starting area, I will get this equation:

So right now, we have a quadratic equation for h but in its current format its a bit awkward to work with. In the next steps, well shuffle things around a bit so that we will be able to solve for h using the quadratic formula. If we expand the equation, well get this:

Our next step is to split this equation into workable parts. First Ill move out the terms without the h multiplier:

Now Im going to split the second summation depending on whether they are multiplied by h or h2. At the same time, Im going to move the multipliers to the outside of the summations since they stay constant.

At this point, things are starting to shape up and we have the variables that we can plug into the quadratic formula! All three of them can be calculated using a simple for loop.


Once youve calculated the value for h, you can go ahead and offset those vertices.

Collisions (Incomplete)
Two blobs, A and B Calculate the center of mass for both blobs. Dont use the polygon centroid formula. That gets screwed up when the polygon self-intersects. Now that you have the centers, you have the option of doing an early exit if the distance between the centers is too large. This would probably be between 1.5 and 2x the sum of the radii of the two blobs.

You might also like