NewtonCollisionCollide and contact points.

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

NewtonCollisionCollide and contact points.

Postby Crashy » Sun Dec 05, 2010 10:20 pm

Hello, I'm new to Newton, and I'm using it for collision detection only. I'm currently doing my own collision response code, and I cannot understand what position is given by the "contacts" array parameter of the NewtonCollisionCollide function.

It seems to be a local space position, but I cannot see if it is for collision A or B. But maybe I'm totally wrong. I really need to know the position of the contact if I want to compute a proper torque for the collision response.

By the way, is there any sample on how to do simple collision response using NewtonCollisionCollide?

Thank you:)
Crashy
 
Posts: 101
Joined: Fri Dec 03, 2010 6:30 am

Re: NewtonCollisionCollide and contact points.

Postby JernejL » Mon Dec 06, 2010 3:59 am

The positions are for collision pair of the 2 objects.. NOT for one object.. what you wrote makes no sense, a collision happens between 2 objects, the response is a result of 2 objects colliding.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: NewtonCollisionCollide and contact points.

Postby Crashy » Mon Dec 06, 2010 6:57 am

he positions are for collision pair of the 2 objects.. NOT for one object


Yes, I agree, but I've seen many collision detection code before that is returning a contact point in the local space of, for exemple, the first collision object in the teted pair, that's what I wanted to say.

For example, NewtonCollisionClosestPoint gives the contact points for collisionA and collisionB separately.
Crashy
 
Posts: 101
Joined: Fri Dec 03, 2010 6:30 am

Re: NewtonCollisionCollide and contact points.

Postby JernejL » Mon Dec 06, 2010 7:34 am

Interesting, i gues it works on A against B so it would be for a.. i guess you will have to test and report so i can add the info to wiki.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: NewtonCollisionCollide and contact points.

Postby Crashy » Mon Dec 06, 2010 7:45 am

Ok there was a bug on my side, now I can tell you that it is a position in world space :)

This info should be a great addition to the wiki yes. Thank you, Newton is Awesome :D
Crashy
 
Posts: 101
Joined: Fri Dec 03, 2010 6:30 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron