К
Size: a a a
К
M
К
К
К
M
К
AT
AT
M
Г
Г
К
К
К
static public function InPoints(w:b2Vec2, points:Array, pointCount:int):Boolean
{
const k_tolerance:Number = 100 * Number.MIN_VALUE;
for (var i:int = 0; i < pointCount; i++){
var points_i:b2Vec2 = points[i];
var dX:Number = w.x - points_i.x < 0 ? -(w.x - points_i.x) : w.x - points_i.x;
var dY:Number = w.y - points_i.y < 0 ? -(w.y - points_i.y) : w.y - points_i.y;
var mX:Number = w.x < 0 ? -w.x : w.x > points_i.x < 0 ? -points_i.x : points_i.x ? w.x < 0 ? -w.x : w.x : points_i.x < 0 ? -points_i.x : points_i.x;
var mY:Number = w.x < 0 ? -w.y : w.y > points_i.y < 0 ? -points_i.y : points_i.y ? w.y < 0 ? -w.y : w.y : points_i.y < 0 ? -points_i.y : points_i.y;
if (dX < k_tolerance * (mX + 1) &&
dY < k_tolerance * (mY + 1))
{
return true;
}
}
return false;
}
К
M
static public function InPoints(w:b2Vec2, points:Array, pointCount:int):Boolean
{
const k_tolerance:Number = 100 * Number.MIN_VALUE;
for (var i:int = 0; i < pointCount; i++){
var points_i:b2Vec2 = points[i];
var dX:Number = w.x - points_i.x < 0 ? -(w.x - points_i.x) : w.x - points_i.x;
var dY:Number = w.y - points_i.y < 0 ? -(w.y - points_i.y) : w.y - points_i.y;
var mX:Number = w.x < 0 ? -w.x : w.x > points_i.x < 0 ? -points_i.x : points_i.x ? w.x < 0 ? -w.x : w.x : points_i.x < 0 ? -points_i.x : points_i.x;
var mY:Number = w.x < 0 ? -w.y : w.y > points_i.y < 0 ? -points_i.y : points_i.y ? w.y < 0 ? -w.y : w.y : points_i.y < 0 ? -points_i.y : points_i.y;
if (dX < k_tolerance * (mX + 1) &&
dY < k_tolerance * (mY + 1))
{
return true;
}
}
return false;
}