Code:
var cb : Function = function(fixture:b2Fixture, point:V2, normal:V2, fraction:Number):Number{
f = fixture;
fixtList.push(f);
lambda = fraction
return fraction;
}
for the purpose of this conversation i will be using the word "contacts" as being a returned callback group of {fixture, point, normal, fraction}.
not at all related to box2d or wck contact.as class(s)
just saying "fixture" or "point" would be too vague since it finds all of these elements for the callback funciton.
keep in mind that the contacts returned are not in order of distance.
it should be assumed that they are not in any order.
raycast is commonly used to find the closest contact
by returning fraction you are telling the raycast to search again for anything closer than the last found contact.
that should explain the reason for fixtList:Array being different each time.
for example of items, 1,2,3,4,5
perhaps it finds 3 first, then it is only looking at 1 or 2 next.
another time it might find 1 first, and have no where else to look.
i'm not sure what you are planning to do with fixtList, more details may help find a solution.
for now looking at what you have, i would suggest comparing the fixture to your array
if it is not on the array, add it and return 1
if it is on the array return -1 to skip it.
i think that might give you all the fixtures in range of the raycast. i hope it doesn't endless loop or something odd. i haven't tried to do that yet, all the raycasts i make so far just care about the first valid contact.
I hope that helps explain things, raycasts are a bit obscure, and sadly have no debug-draw that I'm aware of. but I like this method better than previous implementations of raycast for what its worth.
also this may have gotten more response at the Flash forum, since there is nothing wck specific about raycasts (yet).
that said, i mostly check the wck forum, so i may not have answered it there
