HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Constraint physics

11-14-2007, 07:46 AM#1
PipeDream
Just for fun demo of how one might do constraints in war3. A slightly squishy cube of footmen falls, rolls, and bounces on a frictionless surface.

The evolution operator is split in two:
1. Integration
Rather than store velocity, position, calculate acceleration and then new velocity and position, I store position and old position. Update is then
x2 = 2*x1 - x0 + a dt^2
This is nice when you don't care about velocity, (e.g. no collisions). It's stable and easy to add drag.
2. Constraints
Each object has a linked list of equations it must satisfy specifying distance to other objects. The equations are relaxed by solving just one at a time. Two passes through the entire scene are made, which leaves the constraints only approximately satisfied, so the cube is slightly squishy.
Attached Files
File type: w3xverlet.w3x (24.4 KB)
11-14-2007, 02:32 PM#2
MaD[Lion]
oh my, i was gonna make this, but now u made it so i can just out it into map, thnx!