Algorithm for Direction Change upon Collision

Ender Nafi Elekcioglu endernafi at gmail.com
Tue Nov 12 15:11:35 EST 2013


@Jim,
As I’ve said, you’re equations and physics simulations are excellent.
But performance is my biggest concern over being realistic,
so I’m with Scott here, “near enough is good enough”.

@Scott,
I totally agree with "Somewhat paradoxically, more code in the loop that does the screen updating 
is actually faster if the logic used is more efficient.”
I have to optimize my code.
And here comes Mark’s and Jim’s advices.

@Mark
I’m testing alternate intersect functions as you suggested.
All of the particles have same sizes, they are not circles but it doesn’t matter since they are too small to notice little miscalculations.
So, I’m coding your advice of *comparing the distances*.

All and all, LiveCode seems to handle particle thingy pretty good.
I mean; without collision check I could go up to 1000’s of objects flying around with reasonable fps values.
It’s promising, right?


Thank you all, for valuable advices.
I’ll post my results for future reference.


Best,

~ Ender Nafi


More information about the use-livecode mailing list