Order Independent Physics Calcualtions

Started by TheGentlmen, September 25, 2015, 05:38:22 PM

Previous topic - Next topic

TheGentlmen

Recently bumped into a problem on a project which I've been working on... for the life in me I simply can't fiqure it out, plz help.

Legend

W=Wall
P1=Particle 1
P2=Particle 2
=Empty space

Lets say I got this:

WWWWW
WP1P2W
WWWW
WWWWW

If I calculate pysics from the Top-Right this will happen:

WWWWW
WP2W
WWP1WW
WWWWW

If I calculate pysics from the Bottom-Left this will happen:

WWWWW
WP1W
WWP2WW
WWWWW

So how can I make it have an equal chance of both happening?

RemingtonRyder

Basically, you need to allow and catch instances of P1 and P2 moving into the same space. If only one of them can occupy the same space, then you have to decide which one of them does end up occupying that space, and what happens to the other one - are they deflected back to their original space or into a different space?

TheGentlmen

But that doesn't fix the underling problem, take this:

Legend

W=Wall
P1=Particle 1
R=Repeller
=Empty space

Lets say I got this:

W
WRP1
WR
WWWWW

If I calculate pysics from the Top-Right this will happen:

W
WRP1
WR
WWWWW

If I calculate pysics from the Bottom-Left this will happen:

WP1
WR
WR
WWWWW

What should happen is:

WP1
WR
WR
WWWWW

RemingtonRyder

The thing to do is to identify all the particles (doesn't matter which way you're scanning) and then iterate through them to determine where they will end up 1 frame later, based on for example, are they moving in a particular or random direction, or is there something exerting a force on them? Then do collision resolution. Then finally update the positions.

Collision resolution is going to be quite a taxing part because you have to consider what there is for each particle to collide with, which means looking at not just the static elements, but anything which is predicted to move.

TheGentlmen

Witch brings me to the topic of how to calculate collisions with other non-moving objects...

I shall go simulate tempeture's instead... comeback hopefully with somesort of an idea at collisions.

Or, better yet.. I shall see what Tpt does for collisions... hehehehe...

keylocke

to have both equal chances of happening.

you put them inside of a box with a cat...

and shake vigorously...