Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Using physics only for events  (Read 5595 times)
diogomartins
Community Member
*
Posts: 40


« on: September 04, 2010, 02:12:36 PM »

In my current project i need to get object collisions, like when a cube collides with another. since tvphysics already does this, i thought i could use it. the thing is, tvphysics gives me my results, but it also moves my objects around. i already fixed unwanted rotations using a double upjoint. to fix the position i store the objects position in a list, then i simulate the physics, and then i reposicionate the objects using the stored position. this works, but besides slowing the program down, it sometimes makes one collision to be 61 instead, and i already enabled oneeventperpair.

My question is: Is there a way to use the tvphysics object in order to simply get the collisions in the world? without having it move stuff around?

Or on the other hand, is there a simpler way to determine collision between meshes/land/other objects, using TV??

Thanks in advance
Logged
jviper
Community Member
*
Posts: 2130

Discipline in training


« Reply #1 on: September 04, 2010, 03:48:13 PM »

There is a way to enable collision reporting but keep collision reactions disabled with TVPhysics.SetMaterialInteractionEvents(...). This is not very trivial as it involves Physics Material Groups. Luckily if you do not use Physics Material Groups, you can use TVPhysics.GetDefaultMaterialGroup() in for both iMaterialGroup1 and iMaterialGroup2 argumants. However if you do use material groups then you have to set between all material groups for which you do not want collision reactions. What you do is pass true for bRaiseCollisionEvents, and true for bDisableCollision (or actually if might be false because last I've heard this argument is misnamed but it might be fixed by now). This will allow events to be raised but objects will not react to collisions (not bounce or anything).
Logged

JAbstract.....Don't just imagine, make it happen!
diogomartins
Community Member
*
Posts: 40


« Reply #2 on: September 04, 2010, 04:02:52 PM »

Thank you so much! it works like a charm now! Finally i have my collision detector up!

Thank you once again
Logged
diogomartins
Community Member
*
Posts: 40


« Reply #3 on: September 04, 2010, 08:41:00 PM »

One more question. On the collisions detected i need to know the "collision penetration". basically it's how deep one body is on another. i thought this would be something like the force or speed of the even_physicscollision struct, but after some testing this has been showing me 0...

Should i be doing something different? Or is there another way to measure this same penetration?

Thanks in advance
Logged
Pages: [1]
  Print  
 
Jump to:  

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