NewtonWorldForEachBodyInAABBDo for area scanning

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

NewtonWorldForEachBodyInAABBDo for area scanning

Postby JernejL » Tue Feb 06, 2018 7:57 am

I could break down my path/obstacles checking to use NewtonWorldForEachBodyInAABBDo instead of raycasts, but how would the performance of this be? is NewtonWorldForEachBodyInAABBDo good performance-wise, for simple obstacle avoidance checks?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: NewtonWorldForEachBodyInAABBDo for area scanning

Postby Julio Jerez » Tue Feb 06, 2018 10:25 am

well is fast for aabb tha are smaller that the world, but if you make a huge aabb then is more expensive that a plain iteration over all bodies.
this is because the overhead of the tree structure, goes to waste since so made objects will be included.
As a empirical rule if your aabb is larger than 1/3 of the size of the world, then is no better that iterating over all bodies.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonWorldForEachBodyInAABBDo for area scanning

Postby JernejL » Tue Feb 06, 2018 3:04 pm

The lookups would be for 1x1x1 cubes, in a world mostly empty of shapes, i wouldn't need buildings included but cannot exclude them (no pre-filter callback on NewtonWorldForEachBodyInAABBDo, maybe one can be added before the body is considered for aabb check - would that make sense? )

my map is split into rather large blocks and it should be quite ok like that?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: NewtonWorldForEachBodyInAABBDo for area scanning

Postby Julio Jerez » Tue Feb 06, 2018 3:40 pm

that should be very, very fast.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonWorldForEachBodyInAABBDo for area scanning

Postby JernejL » Wed Feb 07, 2018 12:56 pm

Thank you, i will investigate this and report some benchmarks, i assume converting world objects to scene collision would be beneficial aswell to NewtonWorldForEachBodyInAABBDo?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: NewtonWorldForEachBodyInAABBDo for area scanning

Postby JernejL » Sat Mar 10, 2018 3:44 pm

I've started to use NewtonWorldForEachBodyInAABBDo to check areas before raycasting, it seems to work well, however i've noticed that the function is really strict about parameters, if by any chance start and stop points are not properly organized (min, max) then it seems to not work, is this by design or could it be a bug?

I have just organized points on my side to be min, max, i have no issue with this, i'm just wondering if it's by design, if so i will put a notice on wiki page for http://newtondynamics.com/wiki/index.ph ... dyInAABBDo
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: NewtonWorldForEachBodyInAABBDo for area scanning

Postby Julio Jerez » Sat Mar 10, 2018 5:56 pm

no it did no check for the aabb to be a proper box, but is should, I fix it now.
Sync again please
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonWorldForEachBodyInAABBDo for area scanning

Postby JernejL » Wed Mar 14, 2018 7:33 am

Thanks! I will check and fix the patch when i finish some other work i have to finish (networking and some other unrelated things), hopefully somewhen next week
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 16 guests

cron