Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Access to Physics internal collision  (Read 774 times)
the-jerry
Community Member
*
Posts: 80


« on: November 21, 2008, 03:50:04 PM »

Hey,

is there any way to access any of the internal physics collision calculations of TVPhysics? I am asking because, all my collisions are done by the physics engine. I would like to know which two objects collided and checking everything with AdvancedCollision again seems such a vast of ressources. (because TV already has the results)

Thanks for any hints.
Logged

"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
jviper
Community Member
*
Posts: 2058

Discipline in training


« Reply #1 on: November 21, 2008, 06:17:14 PM »

NumerOfEvents = TVPhysics.PollEvents() Returns the number of events that occurred
For i as integer=0 to NumberOfEvents-1
    Evnt = corePhysics.GetEventCollisionDesc(i)
Next i
Returns each event with their info.
Logged

JAbstract.....Don't just imagine, make it happen!
SylvainTV
Administrator
Community Member
*****
Posts: 4894


WWW
« Reply #2 on: November 21, 2008, 06:20:50 PM »

Yes don't forget to enable events with SetMaterialInteractionEvents though Smiley

If you don't want to do physics simulation, you can use the new TestCollision function of TVPhysics that just checks collisions between bodies.
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
the-jerry
Community Member
*
Posts: 80


« Reply #3 on: November 22, 2008, 03:29:04 AM »

Thank you guys. I will try it.
Logged

"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
the-jerry
Community Member
*
Posts: 80


« Reply #4 on: November 28, 2008, 03:59:06 PM »

Ok, let's come back to this topic. ^^

I tried jviper's code and for now I get no Event back. (NumberOfEvents = 0)
So I guess I must set up the MaterialInteractionEvents right. I am confused by the two material parameters. Can someone explain this a little more detailed please? Why two materials? What do they stand for?

I would appreciate any advise. Thank you.
Logged

"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
sybixsus
Customers
Community Member
*****
Posts: 1339


WWW
« Reply #5 on: November 28, 2008, 06:34:40 PM »

They don't stand for anything. You apply them to your physics objects and then pick which materials should interract with one another, and how.

Example:

Two objects. One is a cannonball, one is a ship - a Spanish Galleon. The ship is (basically) made of wood. So you create a material called Wood and apply it to the ship's body. The cannoball is (basically) Metal so you make a material called Metal and apply it to the cannonball. Now you define how wood and metal should behave when they collide. Done.
Logged
Hypnotron
Customers
Community Member
*****
Posts: 1025


« Reply #6 on: November 29, 2008, 10:37:04 AM »

define how it should behave?  could you elaborate?  the wood show splinter and break and the cannon ball should be pretty much invulnerable... but it depends on how fast the cannon ball is going.  If the cannon ball is just dropped onto the deck while loading the cannon, the wood shouldn't be damaged (practically speaking).  Can all this be expressed in the settings of the material?

Logged
sybixsus
Customers
Community Member
*****
Posts: 1339


WWW
« Reply #7 on: November 29, 2008, 03:41:54 PM »

Newton does not, AFAIK, support breakable bodies, so no, not unless you did all the hard work yourself. The properties you can define are pretty self explanatory, friction, softness, bounciness, whether they should collide at all and whether they should use continuous collision ( which is to avoid bodies going through other bodies if they're moving too quickly.)
Logged
Pages: [1]
  Print  
 
Jump to:  

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