How can I stop a physics entity from its jiggling movement when it is supposed to have come to rest, meaning, after a box or cylinder has bounced a couple of times and (is supposed to) stand(s) absolutely still on the ground?
Among other things I've unsuccessfully tried things like:

vec_for_vertex(temp,my,2);//include rotation
phent_getvelocity(my, mySpeed, temp);
temp=vec_length(myspeed);

if(temp<50){phent_setmass(my,0,PH_POLY);}
else {phent_setmass(my,10,PH_POLY);}

I've also tried phent_enable and phent_set_type but couldn't find out how to disable the physics entity after all the bouncing and enabling it again when being hit by another physics entity.