[Flashcoders] bounce object off tilted wall

2010-09-28 Thread Kevin Newman

 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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] bounce object off tilted wall

2010-09-28 Thread Carl Welch
I'd look in this direction:

http://www.google.com/search?q=actionscript+3+physics+library

Hope this helps. Cheers.

-- 
Carl Welch
http://www.carlwelch.com


On Tue, Sep 28, 2010 at 10:40 AM, Kevin Newman capta...@unfocus.com 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
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] bounce object off tilted wall

2010-09-28 Thread Kevin Newman
 I'd thought of that, but was hoping to something with less weight - I 
think it's Matrix/Vector math I need to learn about.


Just to continue down this path - anyone have a recommendation for the 
most appropriate engine for mobile?


Is there a physics engine that operates on non-screen objects which 
would allow me to apply that data to my scene in the RENDER event (this 
seems to be important on GPU accelerated AIR for mobile).  In other 
words, I don't want a physics engine that updates the display list 
itself, I want to be able to grab the data and update the scene myself.


Box2D Alchemy looks good, but I'd love some suggestions. :-)

Kevin N.


On 9/28/10 1:52 PM, Carl Welch wrote:

I'd look in this direction:

http://www.google.com/search?q=actionscript+3+physics+library

Hope this helps. Cheers.



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] bounce object off tilted wall

2010-09-28 Thread Glen Pike

 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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] bounce object off tilted wall

2010-09-28 Thread Kevin Newman

 On 9/28/10 2:25 PM, Glen Pike wrote:
Keith Peter's Making Things Move book is really good.  Jobe Makar's 
Flash MX Game Programming Demystified explained the basic concepts 
nicely too.

I'm reading Keith Peter's book now. So far, very relevant - thanks!

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? 
What I was talking about wasn't necessarily adding and removing things 
from the stage, but adding and removing them from the GPU. You can add 
stuff to the stage without too many hiccups (in software) - but if you 
set the cacheAsBitmap and cacheAsBitmapMatrix properties (or update or 
remove something with those set), you cause the player to generate and 
upload (or destroy) a texture to the GPU - this has a noticeable impact 
on performance (at least as far as I can tell so far - the biggest 
impact out of most things).


That's why I was saying I'd like to control that part of it myself - I 
don't know if the available physics libraries have been re-crafted for 
mobile/GPU yet.


Kevin N.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders