www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Kernle 32DLL on April 24, 2011, 02:24:33 am

Title: Question about Object3D.calcMinDistance
Post by: Kernle 32DLL on April 24, 2011, 02:24:33 am
Hi there,

Just a quick question. Has the org vector in Object3D.calcMinDistance (http://www.jpct.net/doc/com/threed/jpct/Object3D.html#calcMinDistance%28com.threed.jpct.SimpleVector,%20com.threed.jpct.SimpleVector%29) to be world of local space? I dont have any suited environment to test this out right now.

Oh, and just out of curiosity... What stands the AABB for in the Object3D.XXXIntersectsAABB functions for?

So long,
Kernle
Title: Re: Question about Object3D.calcMinDistance
Post by: Kernle 32DLL on April 24, 2011, 05:30:12 pm
Nevermind, it's world space of course (silly me...) However, using calcMinDistance is not a good idea atm, as it allocated a lot of objects (Object3D[] and SimpleVectors).

So long,
Kernle
Title: Re: Question about Object3D.calcMinDistance
Post by: EgonOlsen on April 24, 2011, 07:03:52 pm
It does create a lot of objects? I'll look into it as It's basically nothing more than ray/polygon collision detection, which shouldn't create any objects at all. Have you tried without octree?
Title: Re: Question about Object3D.calcMinDistance
Post by: Kernle 32DLL on April 24, 2011, 07:11:29 pm
Well, the allocation tracker gives me the creation of a two SimpleVectors (line 2717 and 2719 in Object3D.java) and one Object3D[] (line 2720 in Object3D.java) per calcMinDistance call. Makes quite a lot of allocations, if used a lot.

Oh, and I dont use an octree atm.
Title: Re: Question about Object3D.calcMinDistance
Post by: EgonOlsen on April 25, 2011, 09:05:14 pm
Please try the new beta. Object creations should be gone as long as you don't use a collision listener.
Title: Re: Question about Object3D.calcMinDistance
Post by: EgonOlsen on April 25, 2011, 09:13:27 pm
Oh, and just out of curiosity... What stands the AABB for in the Object3D.XXXIntersectsAABB functions for?
Axis Aligned Bounding Box