浏览代码

added getBounds impl

ncannasse 11 年之前
父节点
当前提交
8c3d170bc7
共有 1 个文件被更改,包括 8 次插入1 次删除
  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();