Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Two physics questions  (Read 566 times)
xavram
Community Member
*
Posts: 525


« on: March 08, 2010, 10:13:05 PM »

Tried finding these on the forums but no dice.  So here goes...

1.  Physics.TestCollision :  this works as expected, if the two body ids are meshes...but if one of the Ids is from Physics.CreateStaticTerrainBody, then this method never returns true.  But, I can see the mesh I'm testing hitting the landscape and bouncing along.

2.  Physics.SetMaterialInteractionEvents : as I understand from the Newton website, this should allow you to set an event to fire (for example, play a sound) if two materials interact.  But how do you do this?  I don't see anything in the method that supports, If collision happens, trigger this method.
Logged
xavram
Community Member
*
Posts: 525


« Reply #1 on: March 10, 2010, 02:26:00 PM »

wow, nothing... Tongue
Logged
pagebt
Customers
Community Member
*****
Posts: 58


WWW
« Reply #2 on: March 12, 2010, 07:32:44 AM »

Check out this post in the bugs forum, it looks like there may be a problem with the returned body indexes.

http://www.truevision3d.com/forums/bugs/physics_testcollision_doesnt_check_terrain-t19782.0.html

I hope this helps.
Logged
MiloDC
Customers
Community Member
*****
Posts: 216


WWW
« Reply #3 on: March 12, 2010, 02:02:41 PM »

2.  Physics.SetMaterialInteractionEvents : as I understand from the Newton website, this should allow you to set an event to fire (for example, play a sound) if two materials interact.  But how do you do this?  I don't see anything in the method that supports, If collision happens, trigger this method.

If you TVPhysics.SetMaterialInteractionEvents on physics "materials," then their collision will register as an event to be polled.

Then, you simply:

Code: (C#)
int eventCount = TVPhysics.PollEvents();
for (int i = 0; i < eventCount; ++i) {
TV_EVENT_PHYSICSCOLLISION pColl = TVPhysics.GetEventCollisionDesc(i);
[... do something with pColl...]
}
Logged

Pages: [1]
  Print  
 
Jump to:  

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