Enhancement: allow static query ignore sensor fixtures

Posts regarding potential bugs, enhancement requests, and general feedback on use of dyn4j
alpedar
Posts: 7
Joined: Sat Jan 25, 2014 11:08 am

Re: Enhancement: allow static query ignore sensor fixtures

Postby alpedar » Sat Feb 08, 2014 11:19 am

I continued with my experiments.
1) managed to create subclass of DynamicAABBTree that ignores sensor-sensor overlap (and in my experimental scenario it provided huge speed up) (I tried both building tree of solid only AABB-s and of full, from these two building it from full AABBs and just adding information about solid part is better, because it does not lose information)
2) found out that most of that speed up can be achieved by listener that filters body-body collision from BP by AABB (if nonsensor AABB of either body overlaps full AABB of the other, accept it) and this can be used with any BP
3) static query benefits a lot from filtering out colisions with sensors (if we dont care about them) on before narrow phase, again, does not have to be done in BP, but in my experiment it was waster to do it in BP.

0) its better to not have large sensors (in Dyn4j sense) and use static query for dtermining whom unit have in sensing radius.

here are sources of my experiments: https://drive.google.com/file/d/0B5mUATVdMD5NOGluRjNURHRybmM/edit?usp=sharing

William
Site Admin
Posts: 349
Joined: Sat Feb 06, 2010 10:23 pm

Re: Enhancement: allow static query ignore sensor fixtures

Postby William » Sun Feb 09, 2014 8:36 am

alpedar wrote:1) managed to create subclass of DynamicAABBTree that ignores sensor-sensor overlap (and in my experimental scenario it provided huge speed up) (I tried both building tree of solid only AABB-s and of full, from these two building it from full AABBs and just adding information about solid part is better, because it does not lose information)
2) found out that most of that speed up can be achieved by listener that filters body-body collision from BP by AABB (if nonsensor AABB of either body overlaps full AABB of the other, accept it) and this can be used with any BP

I'm glad that you've found a solution for your problem without having to make too many changes.

alpedar wrote:3) static query benefits a lot from filtering out colisions with sensors (if we dont care about them) on before narrow phase, again, does not have to be done in BP, but in my experiment it was waster to do it in BP.

I've made some changes to the World.detect methods that will allow filtering by a Filter object, sensors, inactive, and by a listener. This certainly made sense to do. Naturally, not doing work will always be faster.

alpedar wrote:0) its better to not have large sensors (in Dyn4j sense) and use static query for dtermining whom unit have in sensing radius.

This will be the case with any engine, whether you are using sensors or not. If your bodies are large enough so that everything collides with everything, performance will be poor regardless. Remember, the concept of a sensor is to know when things are colliding which is why they are included in the BP.

William

William
Site Admin
Posts: 349
Joined: Sat Feb 06, 2010 10:23 pm

Re: Enhancement: allow static query ignore sensor fixtures

Postby William » Sun Feb 09, 2014 5:08 pm

I meant to upload the jar with my last post.

William
Attachments
dyn4j-v3.1.9-beta8.jar
dyn4j 3.1.9 beta 8
(354.62 KiB) Downloaded 117 times

William
Site Admin
Posts: 349
Joined: Sat Feb 06, 2010 10:23 pm

Re: Enhancement: allow static query ignore sensor fixtures

Postby William » Sat Mar 29, 2014 9:00 pm

These additional methods have been released in version 3.1.9.

William


Return to “Bugs, Enhancements, Feedback”

Who is online

Users browsing this forum: No registered users and 1 guest