Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Physics.SetBodyCollidable(index, True) doesn't work  (Read 3047 times)
bbence
Customers
Community Member
*****
Posts: 944


WWW
« on: September 25, 2010, 02:40:37 PM »

The possibility to switch off physics collision with SetBodyCollidable works, but I cannot get it work to switch the collision ON. So once I call SetBodyCollidable(index, False), I cannot reenable the collisison with it (by calling SetBodyCollidable(index, True)).

Thanks!
Bence
Logged
jviper
Community Member
*
Posts: 2131

Discipline in training


« Reply #1 on: September 25, 2010, 07:12:36 PM »

I cannot confirm this with code yet, but it looks like when you set TVPhysis.SetBodyCollidable to false, it actually deletes the collision volume for that physics body. That could lead to problems. Sad However, I was able to do a TVPhysis.SetBodyCollidable to true and the collision volume returned and collision were able to be done again. This is different however if I enable autofreeze. If I enable autofreeze, reenabling a body to be collidable will crash the engine when that body becomes movable again. So it seems disabling a body from collidable while it is frozen, then reenabling that body to collidable will crash the engine once that body starts moving again.

Also, I should say this may be difficult to test because if you use tvphysics's ray collision test, setting collidable to false will effect that, so you will not be able to do a ray collision test on that body. The only way to really test this is create a mesh variable for each of your physics bodies so that every physics body will have a mesh to reference. Then when you do a ray collision test, do it with tvscene rather than tvphysics. This may be a time-consuming test to set up. This would make a TVPhysics.GetPhysicsBodyIDFromMeshID function useful.

If you can't reproduce this, I'll see if I can write a test app to demonstrate this, but it might take a while though.
« Last Edit: September 25, 2010, 07:39:21 PM by jviper » Logged

JAbstract.....Don't just imagine, make it happen!
bbence
Customers
Community Member
*****
Posts: 944


WWW
« Reply #2 on: September 26, 2010, 05:20:07 AM »

Thanks for detailed analysis jviper! Smiley
One additional info is that I'm trying this with StaticMeshBody, which I guess is also "frozen" somehow. So this bug comes up with StaticMeshBodies for sure.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks