|
@@ -202,7 +202,7 @@ abstract Polygon(Array<Point>) from Array<Point> to Array<Point> {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- Transforms Polygon points by provided matrix.
|
|
|
|
|
|
+ Transforms Polygon points by the provided matrix.
|
|
**/
|
|
**/
|
|
public function transform(mat: h2d.col.Matrix) {
|
|
public function transform(mat: h2d.col.Matrix) {
|
|
for( i in 0...points.length ) {
|
|
for( i in 0...points.length ) {
|
|
@@ -210,6 +210,17 @@ abstract Polygon(Array<Point>) from Array<Point> to Array<Point> {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ Returns transformed Polygon points by the provided matrix.
|
|
|
|
+ **/
|
|
|
|
+ public function transformed(mat: h2d.col.Matrix) {
|
|
|
|
+ var ret = points.copy();
|
|
|
|
+ for( i in 0...ret.length ) {
|
|
|
|
+ ret[i] = ret[i].transformed(mat);
|
|
|
|
+ }
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
Tests if Point `p` is inside this Polygon.
|
|
Tests if Point `p` is inside this Polygon.
|
|
@param p The point to test against.
|
|
@param p The point to test against.
|