hi,
i am having problems with coding a way to find bodys touching another body at a certain time.
i used:
however this code produces also "true" if just the bounding box and not the shape touch (see screenshot which generated true)
where did i go wrong?
thanks!
i am having problems with coding a way to find bodys touching another body at a certain time.
i used:
Code:
private function bodyTouchesTrolley(body:b2Body):Boolean{
var bool:Boolean=false;
for ( var ce:b2ContactEdge = body.GetContactList(); ce; ce = ce.next){
if(ce.other.GetUserData().type=="trolley_plate"){
bool=true;
break;
};
};
return bool
};
var bool:Boolean=false;
for ( var ce:b2ContactEdge = body.GetContactList(); ce; ce = ce.next){
if(ce.other.GetUserData().type=="trolley_plate"){
bool=true;
break;
};
};
return bool
};
however this code produces also "true" if just the bounding box and not the shape touch (see screenshot which generated true)
where did i go wrong?
thanks!