Distance between 2 objects

Moderators: Sascha Willems, Thomas

Re: Distance between 2 objects

Postby Julio Jerez » Mon Oct 18, 2010 11:32 am

Ok try this

http://www.newtondynamics.com/downloads/NewtonWin-2.25.rar
there are problems with the SDK and the asycronous physics update when changing demos from the menu, but if you take the DLL or library you the bug should be fixed.
I will fixed thing this week.
I did not have time to make the optimized closest distance, so I enabled the naive one which works fine for shapes with small number of subparts.
That will let you continues until I write the more sofisticated one which is one order of magnitud faster for very complex meshes.
the demo show the calculation on closest distance in between different shapes with a coumpound shape.
I hope this is what you wanted.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Distance between 2 objects

Postby Cyrus » Tue Oct 19, 2010 7:02 am

Thanks a lot.
I will check with this fix.
Cyrus
 
Posts: 49
Joined: Mon May 17, 2010 1:04 am

Re: Distance between 2 objects

Postby Julio Jerez » Tue Oct 19, 2010 9:52 am

download it again, I fixed the crash bug in the SDK when swiching demos.

Also some shapes the cast does not seem to be accurate, this is because there is a Bug in the Alchemedia exporter that is not writing the offset matrix of the shape right.
when I add debug display funtionality to the demos I will see hoe the shape is oriented and I will fix that.
that does not affect whe you are doing in any way.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Distance between 2 objects

Postby Cyrus » Mon Oct 25, 2010 10:03 am

Thanks for the update,
I am a bit delayed as I have to use this with MogreNewt.
As soon as I get that working I will post the results.
Cyrus
 
Posts: 49
Joined: Mon May 17, 2010 1:04 am

Re: Distance between 2 objects

Postby Julio Jerez » Mon Oct 25, 2010 1:17 pm

does MogreNewt use OgreNewt?

I posted a patch to OgreNewt that integrate teh new funtionality into OgreNewt, but I do not think peopel too a look at it
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Distance between 2 objects

Postby Cyrus » Wed Oct 27, 2010 10:58 am

Hi Julio
I tested my application with newton 2.25 ( we are using mogrenewt which is built with newton 2.25 http://www.ogre3d.org/addonforums/viewt ... =8&t=13541), the api NewtonCollisionClosestPoint always returning one now eventhought object is joint or disjoint.
Can you please check for us, we are running out of time :cry:

Regards
Cyrus
Cyrus
 
Posts: 49
Joined: Mon May 17, 2010 1:04 am

Re: Distance between 2 objects

Postby Julio Jerez » Wed Oct 27, 2010 2:05 pm

Cyrus wrote:Can you please check for us, we are running out of time :cry:
Cyrus

But it is you that take few day to respond


what do you mean?
NewtonCollisionClosestPoint(world, collisionA, &matrix[0][0], m_shape, &matrix1[0][0], &contact0[0], &contact1[0], &normal[0], 0)) ;
will return 1 if the object are disjoint, zero if they are penetration,
are you saying that if the penetrate, the function still returns 1? (that woul be a Bug yes, I will check it out)
I believe that if the object are penetration the distance betwenn contact0 and contact1is zero.
can you chek that?

anyway try to reply today, so taht I can chek it out.
This should be very, very trail to get it going.
Plus I do not want to be the reason why you can not finish your project.
What are you doing?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Distance between 2 objects

Postby Cyrus » Thu Oct 28, 2010 3:35 am

I believe that if the object are penetration the distance betwenn contact0 and contact1is zero

I am getting the distance between contact0 and contact1 always greater than zero eventhough objects are penetrated!!


We are trying to create a scene editor where we can arrange the objects in an optimized way (space efficiency)

Thanks
Cyrus
Cyrus
 
Posts: 49
Joined: Mon May 17, 2010 1:04 am

Re: Distance between 2 objects

Postby Julio Jerez » Thu Oct 28, 2010 12:25 pm

Ok I fix it. Please download 2.25 again.
http://www.newtondynamics.com/downloads/NewtonWin-2.25.rar


I also added a Patch for update ogrenewt to 2.25, maybe you cal let the people hwo maintain it to make the update.
It adds the file format, to ogenewt, so that debugging is easier than it has being so far.
it also adds a blender plug-in for the file format(early yet)
It adds the ability to run Ogrenewt physic concurrently in a thread, with the application, theis make any application using physics is a multicore system, one order of magnitude faster, and still maintaining determinism.
http://www.newtondynamics.com/downloads/UpdateToNewton25_VS9.patch
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Distance between 2 objects

Postby Cyrus » Thu Oct 28, 2010 1:03 pm

Hi Julio
Thanks for the quick response.

With the new version of newton library(2.25), creation of CollisionPrimitives.ConvexHull() crashes, we got the following stack trace

at NewtonReleaseCollision(NewtonWorld* , NewtonCollision* )
at MogreNewt.Collision.!Collision()
at MogreNewt.Collision.Dispose(Boolean )
at MogreNewt.CollisionPrimitives.ConvexHull..ctor(World world, Vector3[] verts, Single tolerance, Int32 id)

We are still invstigating this issue, can you also verify if it works with our model?

Thanks and Regards
Cyrus
Cyrus
 
Posts: 49
Joined: Mon May 17, 2010 1:04 am

Re: Distance between 2 objects

Postby Julio Jerez » Thu Oct 28, 2010 1:48 pm

it should not crash.
if you downloaded early this morning, please try downloading again, there was still another Bug.

In the last version I fix a memory leak the happened if someone create a convexHull collision and hull routine fail, it was sopose to deallocate the memory, but in fact was not.
I am not sure if it crashes because of the change, but it it is them it mean you has a leak before.

See if the update I put in 2.25 before leaving for work works now. If the crash is there let me know,

Cyrus wrote:...
We are still invstigating this issue, can you also verify if it works with our model?Cyrus

How do I do that?
do you have a running demo I can try?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Distance between 2 objects

Postby Cyrus » Tue Nov 02, 2010 2:15 am

Hello Julio
Still it is crashing while creating convexHull collision with the latest newton dll.

Thanks
Cyrus
Cyrus
 
Posts: 49
Joined: Mon May 17, 2010 1:04 am

Re: Distance between 2 objects

Postby Julio Jerez » Tue Nov 02, 2010 8:23 am

I do not know what that is, it does not crash here.
without a test I do not know what to do.
I have tested with around a million convex hull (programatically for the feature I am working on now) without any error.
do you have a running demo?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Distance between 2 objects

Postby Cyrus » Fri Nov 12, 2010 3:04 am

Hi
Sorry for late reply.
The crash is not happening with the latest newton library.
But still we have the same problem with the return value of NewtonCollisionClosestPoint api (always returns one) and the distance between contact0 and contact1 is always greater than zero
I attached a model for testing (use the same model as 2 different objects), I PMed the password for attached model.

Thanks
Cyrus
Attachments
TestModel.rar
obj model to test
(20.25 KiB) Downloaded 422 times
Cyrus
 
Posts: 49
Joined: Mon May 17, 2010 1:04 am

Re: Distance between 2 objects

Postby Julio Jerez » Fri Nov 12, 2010 12:28 pm

Oh Yes I see how it is failing.
I save your mesh as an alchemedia file and load it as the test mesh for closest distance demo.

I can see how the closest distance is wrong because it is casting right trough the mesh and according to this image here,
Image

I clearly show that the result in wrong.
Today is Friday, I will debug it tomorrow, and I will also check that the return value is also false when the tow collision is interpenetrations.
The only difference between my test and yours is that I have to scales you mesh 40 time, it seem you model are tiny, but that should not be any problems, as long as point are not so close together that we lose floating point integrity.
Anyway I will debug this tomorrow. Got to go now.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to Solved bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron