| 11-14-2007, 07:46 AM | #1 |
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. |
| 11-14-2007, 02:32 PM | #2 |
oh my, i was gonna make this, but now u made it so i can just out it into map, thnx! |
