Sfoglia il codice sorgente

added getBounds impl

ncannasse 11 anni fa
parent
commit
8c3d170bc7
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 8 1
      h3d/prim/Polygon.hx

+ 8 - 1
h3d/prim/Polygon.hx

@@ -13,7 +13,14 @@ class Polygon extends Primitive {
 		this.points = points;
 		this.idx = idx;
 	}
-
+	
+	override function getBounds() {
+		var b = new h3d.col.Bounds();
+		for( p in points )
+			b.addPoint(p);
+		return b;
+	}
+	
 	override function alloc( engine : h3d.Engine ) {
 		dispose();