Hi,
You should be able to work out your angle of reflection in a
similar way as you do for horizontal collision.
2 billiard balls - collision detection is easy - if the distance
between the centre's is less than 2 x the radius you have a collision.
I think there is some optimisation you can do for this - check out some
tutorials / books. Keith Peter's "Making Things Move" book is really
good. Jobe Makar's Flash MX Game Programming Demystified explained the
basic concepts nicely too.
For the angle of reflection - it's to do with the angle between the
"wall" and the ball. If you assume the "wall" (for one of your billiard
balls) is at right angles to the direction of the billiard ball, you
have a starting point - again, there is some stuff you can do with trig
in here.
There are lots of tutorials online, so I would Google "as3 physics
collisions" or similar. For other optimisations - it's possibly not
worth updating stuff that's not on stage until you put it back - is that
possible?
Glen
On 28/09/2010 18:40, Kevin Newman wrote:
Hi,
I'm looking for information to help me learn how to bounce an object
off another rotated object (or irregularly shaped object). I've
already got basic collision detection working, and can bounce off
straight horizontal and vertical shapes easily enough (blocks). I'm
looking for info on doing that to an arbitrarily rotated block, or
even a round shape, in a realistic way.
I'd considered using a physics engine, but that seems like overkill in
my case - I really just need the bounce logic.
Any ideas or tutorials suggestions are appreciated. :-)
A bonus would be information that helps me do that to data that isn't
on the display list or DisplayObject derived.
Thanks,
Kevin N.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders