You actually have to test against all objects that could potentially have a
collision.

 

In collision detection, if you have many objects to test against you will
need some spatial partitioning technique. (see Wikipedia:
http://en.wikipedia.org/wiki/Spatial_partitioning). Physics engines all
implement some form of spatial partitioning for collision detection. Some
forms of partitioning can be reasonably simple to implement (e.g. basic
quadtrees), but perhaps learning to do so the first time would be as complex
as learning a physics API which provides this functionality.

 

If you are just  trying to detect collisions with a few static objects you
might take the simple approach of manually grouping those objects into areas
on the field and identifying the area that your actor is in and checking
against all items in that group. If you have a small number of dynamic
objects to check against then consider always performing a check against
those items. 

 

The possibilities for choosing which set of objects you need to perform a
collision check against depend on your particular environment.

 

The spherical check is a pretty inexpensive operation (just a few simple
math operations), so don't be afraid to experiment with algorithms that
perform numerous checks.

 

Dave 

(p.s. my qualifications on this subject are no more than reading a few books
and implementing one such algorithm so far)

 

 

 

From: [email protected] [mailto:[email protected]] On
Behalf Of Michael Iv
Sent: Tuesday, July 28, 2009 1:40 AM
To: [email protected]
Subject: [away3d] Re: collision detection in away3d

 

so how can i get the instance name of the second object that has just enterd
the bounding radius of the first object?

On Mon, Jul 27, 2009 at 8:57 PM, Rob Bateman <[email protected]> wrote:

also, don't forget the boundingRadius property of a 3d object. this will
give you a value that is the minimum radius from the objects zero point that
contains all geometry within. work with meshes, objectcontainers, loaded
models etc.

you also have dimension values of objects from the objectWidth, objectDepth,
objectHeight getters. All these and the min/max values mentioned by Pete are
updated automatically when the geometry is modified

Rob

 

On Mon, Jul 27, 2009 at 6:36 PM, Peter Kapelyan <[email protected]> wrote:

You can do a basic 

if(object1.distanceTo(object2.position)<100){

Which will give you a "ball" type collision, or you can use the objects
..minX,.maxX to do a "box" type coliiion, although the box isn't rotated or
aligned to the object.

Let me know if it makes sense
-Pete

 

On Mon, Jul 27, 2009 at 1:28 PM, SasMaster <[email protected]> wrote:


Is there a way to check for collisions between 3d objects in away3d
without using physics engines.? I need only to check for the collision
but not to have full physics behaviors like encounters and bouncing
that I have in phys engines if I get collisions.





-- 
___________________

Actionscript 3.0 Flash 3D Graphics Engine

HTTP://AWAY3D.COM





-- 
Rob Bateman
Flash Development & Consultancy

[email protected]
www.infiniteturtles.co.uk
www.away3d.com

 

Reply via email to