Disable/Enable Collision's For Objects.

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Disable/Enable Collision's For Objects.

Postby socom » Fri Nov 21, 2008 8:22 pm

Hello, I have a quick question on collisions. Right now, I have a game that you can kill enemies and I would not make NewtonDestroyBody each time someone die, and would also not that they are collision objects anymore when they died. So my question is, there is no command like EnableCollision (body, true / false)?

Thank you very much!
while(your_engine > my_engine)
my_engine++;
socom
 
Posts: 6
Joined: Fri Dec 03, 2004 10:53 am

Re: Disable/Enable Collision's For Objects.

Postby JernejL » Sat Nov 22, 2008 4:46 am

Yes, you can disable collision between two bodies during material aabb callback, you tell the engine your specific body is no longer collideable and it won't collide.

Also what kind of bodies are you talking about? i delete and create a lot of sphere bodies in my game and it works fast and nice, just remember this is bodies and not collisions i am talking about.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1531
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Disable/Enable Collision's For Objects.

Postby socom » Mon Nov 24, 2008 6:42 am

I use collision body's for each character in the game, When one dies I want to make it "non-collide" object instead of distroy the body. Then when it "respawn" it simple gets collision again instead of create a new body.
while(your_engine > my_engine)
my_engine++;
socom
 
Posts: 6
Joined: Fri Dec 03, 2004 10:53 am

Re: Disable/Enable Collision's For Objects.

Postby JernejL » Mon Nov 24, 2008 7:11 am

As is said:

Yes, you can disable collision between two bodies during material aabb callback, you tell the engine your specific body is no longer collideable and it won't collide.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1531
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Disable/Enable Collision's For Objects.

Postby socom » Mon Nov 24, 2008 10:04 am

Yes I will try that, Thanks.
while(your_engine > my_engine)
my_engine++;
socom
 
Posts: 6
Joined: Fri Dec 03, 2004 10:53 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 6 guests