Disable collision between two rigid bodies

Software: Away3D 4.x

entropic, Newbie
Posted: 27 May 2012 04:56 PM   Total Posts: 16

I must say, i NEVER saw such an impossible tutorial like the “CollisionFilter” one (from physics examples).
I read, and read, and try, and try, everything, everything, every possible combination ... i just don’t understand NOTHING.

So….

I have

the ground:

var ground AWPRigidBody
physicsWorld
.addRigidBody(ground); 

body1

var body1 AWPRigidBody
physicsWorld
.addRigidBody(body1); 

body2

var body2 AWPRigidBody
physicsWorld
.addRigidBody(body2); 

and body3

var body3AWPRigidBody
physicsWorld
.addRigidBody(body3); 

And i want DISABLE COLLISION BETWEEN:
body3
and
body2

Thats AAAAAAAAAAAAAALLLLLLLLLLLLLLLL !!!!!!!!!!!!!!!

What i write ?

   

Avatar
loth, Sr. Member
Posted: 28 May 2012 08:18 AM   Total Posts: 236   [ # 1 ]

hello you have to use
physicsWorld.addCollisionObject(body, group:int=1, mask:int=-1 );
instead addRigidBoby

and define the good number for collision group
look AWPCollisionFlags

physicsWorld.collisionCallbackOn = true;
if you want callback

   

entropic, Newbie
Posted: 28 May 2012 05:00 PM   Total Posts: 16   [ # 2 ]

Thanks a lot . The FLAGS !! THIS IS !!
For the beginning ....The code look like this:

the ground:

var ground AWPRigidBody
physicsWorld
.addRigidBodyWithGroup(ground1, -1);; 

body1

var body1 AWPRigidBody
physicsWorld
.addRigidBodyWithGroup(body11, -1); 

body2

var body2 AWPRigidBody
physicsWorld
.addRigidBodyWithGroup(body241); 

and body3

var body3AWPRigidBody
physicsWorld
.addRigidBodyWithGroup(body341); 

body3
and
body2
has a “NO_CONTACT_RESPONSE : int = 4” group , and the “mask” (the only group that interacts) is group 1


but ... still to experiment.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X