www.jpct.net
jPCT-AE - a 3d engine for Android => Support => Topic started by: Uncle Ray on May 21, 2015, 12:13:07 pm
-
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.
-
Try to increase http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Config.html#collideOffset (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Config.html#collideOffset) to something like 1000 or so.