Best way to hitTest particles?

I’ve set up a small mostly AS 2.0 particle engine, its pretty neat. My one problem is this: I want to make them hitTest walls/floors. I can do the actual hitTests just fine, the problem is that at a low velocity they just get stuck within the walls/floor, and just fall through slowly. Is there any good way avoid this?

Note: I am essentially remaking the engine in my signature in AS 2.0.

I’m not very experienced with using particles and physics etc in Flash but I think you have to calculate the friction of the walls and floor etc.

There’s a tutorial on this at actionscript.org at:
http://www.actionscript.org/tutorials/intermediate/Flash_Physics_Study/index.shtml

Hopefully this’ll help you out,
Dave

Hmm… that looks interesting. I’m not sure if its the friction that does it, but it seems to have some method of making sure it bounces.

Yes, that may happen when the intersecting regions of the object and wall/floor is greater than the object’s current velocity.

To get around that problem I normally use if else statements rather than hitTest, or you should check if the ibject will collide the wall before assigning it’s new position. Do you see where I’m getting at?

Pretty much… like:

if(!wall.hitTest(particle._x+particle.xVel, particle._y+particle.yVel, true)){
move particle
} else {
bounce particle
}

I mean more like . . .

// This is just for the x axis.
// Provided that the registration point of the particle (ball) is at the center.
if((ball._x + ball._width/2 > wall._x) || (ball._x - ball._width/2 < 0)) {
change speed of the particle
}

check for each wall individually (not hittest). Then, when past one, re-position the partical to be completey out of that wall to prevent getting stuck.

if((ball._x + ball._width/2 > wall._x){
    ball._x = wall._x - ball._width/2;
    // .. change direction/speed;
}

The problem is… I want to be able to hitTest a freeform movieclip, not defined walls; If I check for when it will hit, at high velocities it bounces in midair, because the difference between its current x/y is so different from its projected x/y. Any magic solutions or will I just have to limit my velocities?