Author Topic: Camera.SLIDE  (Read 5473 times)

Offline LiuFeng

  • byte
  • *
  • Posts: 20
    • View Profile
Camera.SLIDE
« on: August 27, 2007, 07:55:44 pm »
help me explain why Camera.SLIDE not work:

theWorld.checkCameraCollisionSpherical(new SimpleVector(20,20,20), 3, len, Camera.SLIDE);


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12297
    • View Profile
    • http://www.jpct.net
Re: Camera.SLIDE
« Reply #1 on: August 28, 2007, 12:23:48 am »
I can't answer that without more information or a test case that shows where it should slide but doesn't. However, usually you'll be better off with ellipsoid collision detection anyway, so consider using that instead.

Offline LiuFeng

  • byte
  • *
  • Posts: 20
    • View Profile
Re: Camera.SLIDE
« Reply #2 on: August 28, 2007, 08:11:50 am »
i want to make camera to able to go through the obstacle , and i use:

theWorld.checkCameraCollisionSpherical(new SimpleVector(20,20,20), 3, len, Camera.SLIDE);

but camera not able

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12297
    • View Profile
    • http://www.jpct.net
Re: Camera.SLIDE
« Reply #3 on: August 28, 2007, 08:17:34 am »
Use an ellipsoid collision method instead. They always slide. Sliding with the spherical approach is limited and doesn't do what one would expect in all cases.

Offline LiuFeng

  • byte
  • *
  • Posts: 20
    • View Profile
Re: Camera.SLIDE
« Reply #4 on: August 28, 2007, 10:28:17 am »
like in JPCTDemo i already use:

theWorld.checkCameraCollisionEllipsoid(delta.normalize(), new SimpleVector(20, 20, 20), len, 3);
     
but the camera still not able????

if i disableCollisionListener of theWorld , orther Object3D able to slide ,i don't want it



help me!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12297
    • View Profile
    • http://www.jpct.net
Re: Camera.SLIDE
« Reply #5 on: August 28, 2007, 10:36:08 am »
Try to play around with recursion depth and/or Config.collideEllipsoidThreshold/Config.collideOffset or your ellipsoid size. Maybe 20 is too big in respect to the world dimensions you are using.
What does it do instead? Are you walking thorugh the walls? Are you getting stuck in front of them?

Offline LiuFeng

  • byte
  • *
  • Posts: 20
    • View Profile
Re: Camera.SLIDE
« Reply #6 on: August 28, 2007, 04:50:19 pm »
in JPCTDemo i repair: add a human in to the world and move camera fllow this human, and only want the human able to collision and camera not.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12297
    • View Profile
    • http://www.jpct.net
Re: Camera.SLIDE
« Reply #7 on: August 28, 2007, 05:33:14 pm »
So the camera shouldn't collide but the model should? Then use this instead: checkCollisionEllipsoid(...)

Offline LiuFeng

  • byte
  • *
  • Posts: 20
    • View Profile
Re: Camera.SLIDE
« Reply #8 on: August 28, 2007, 10:21:57 pm »
OK, thank much