Author Topic: Question about Object3D.calcMinDistance  (Read 3776 times)

Offline Kernle 32DLL

  • byte
  • *
  • Posts: 20
    • View Profile
Question about Object3D.calcMinDistance
« on: April 24, 2011, 02:24:33 am »
Hi there,

Just a quick question. Has the org vector in Object3D.calcMinDistance 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
« Last Edit: April 24, 2011, 02:28:59 am by Kernle 32DLL »

Offline Kernle 32DLL

  • byte
  • *
  • Posts: 20
    • View Profile
Re: Question about Object3D.calcMinDistance
« Reply #1 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Question about Object3D.calcMinDistance
« Reply #2 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?

Offline Kernle 32DLL

  • byte
  • *
  • Posts: 20
    • View Profile
Re: Question about Object3D.calcMinDistance
« Reply #3 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.
« Last Edit: April 24, 2011, 07:22:18 pm by Kernle 32DLL »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Question about Object3D.calcMinDistance
« Reply #4 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Question about Object3D.calcMinDistance
« Reply #5 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