Author Topic: question about checkForCollisionEllipsoid's detect distance;  (Read 1676 times)

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Object3D source;
Object3D target;
SimpleVector ellipsoid=new SimpleVector(10,10,10);
ini()
{
source.setCollisionMode(Object3D.COLLISION_CHECK_SELF|Object3D.COLLISION_CHECK_OTHERS);
target.setCollisionMode(Object3D.COLLISION_CHECK_SELF|Object3D.COLLISION_CHECK_OTHERS);
source.build();
target.build();
}

update()
{   
    simpleVector front=obj.getZAxis();
     simpleVector fix_front=null;
    fix_front=obj.checkForCollisionEllipsoid(front,ellipsoid, 5);
    if(front.equals(fix_front)==true)
    {
       source.setTransparency(-1);//source will see
    }
    else if(front.equals(fix_front)==false)
    {
       source.setTransparency(0);//source will disappear
    }
   source.translat(fix_front);
}







my problem:
when ellipsoid=(10,10,10) or ellipsoid=(100,100,100);
their checkcollition's distance was the same,just same unit away between source and target,then source be disappear.

so how to change checkcollition's distance?whatever i do with ellipsoid,but the distance just the same.

« Last Edit: May 21, 2015, 12:18:32 pm by Uncle Ray »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: question about checkForCollisionEllipsoid's detect distance;
« Reply #1 on: May 21, 2015, 12:31:47 pm »