Author Topic: Find the colliding object with world.checkCollisionSphereical()  (Read 1794 times)

Offline nathan

  • byte
  • *
  • Posts: 15
    • View Profile
The function
Code: [Select]
public int checkCollision(SimpleVector org, SimpleVector dr, float step)returns the id of the object that the collision happens with.  However, the function
Code: [Select]
public SimpleVector checkCollisionSpherical(SimpleVector org, SimpleVector translation, float radius)does not.  Instead it returns the vector that is safe to translate before the collision happens.

Why is the functionality different?  And is there any way I can check what object I collide with when I use checkCollisionSpherical()?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net

Offline nathan

  • byte
  • *
  • Posts: 15
    • View Profile
Re: Find the colliding object with world.checkCollisionSphereical()
« Reply #2 on: April 09, 2013, 03:29:04 am »
So I would put a collision listener on every one of my objects?  It seems that I can use the same instance of the CollisionListener, because the CollisionEvent has targets. 

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Find the colliding object with world.checkCollisionSphereical()
« Reply #3 on: April 09, 2013, 07:25:19 am »
Yes, you can reuse one instance of the listener for multiple objects.