Game Development Reference
In-Depth Information
The solution you should be more interested in uses spring joints. Again, you have two
choices. One is to connect the center body with each circumference body as explained in
the previous paragraph. However, despite using eight spring joints, this creates a rather
wobbly structure that is prone to collapse in on itself if a strong force is applied to the
body at one point. Increasing spring stiffness doesn't really help. Though there are cer-
tainly uses for this kind of wobbly, bouncing, pudding-like blob.
The other solution is to use just four spring joints that connect one circumference body
with the body directly opposite to it. That's what you should be doing. With the Player-
SoftBody.ccb open, drag and drop four spring joints onto the stage. Connect a joint with
the right node and the left node. Connect the next joint with the bottom-right and top-left
nodes, and then bottom and top nodes as well as bottom-left and top-right nodes.
Then select each spring joint in turn to edit the joint properties. The Collide bodies prop-
erty can be left unchecked, while opposing bodies are unlikely to get close enough to ever
get in contact with each other. The anchor-point values should all be set to 0 to align the
joint anchors with the node positions. Afterward, you should enable Rest length , which
will show 60 as the length value, give or take a tiny fraction for the two diagonal spring
joints. Leave damping set to 1 , but change stiffness to 100 . Confirm that you've applied
all these settings to all four spring joints correctly. The result should be a ball-grid that
looks like the one in Figure 10-11 .
Figure 10-11 . Four spring joints connect opposing circumference bodies
You should try this version in the game to see how this design has improved the previous
version. The Hacky Sack has become a jelly blob. It works well, but the center node isn't
attached to the body yet, and the body is perhaps too easily deformed.
Search WWH ::




Custom Search