|
@@ -44,6 +44,17 @@ class Box extends Object {
|
|
ctx.engine.lineP(p.add(dy), p.add(dx).add(dy), color, depth);
|
|
ctx.engine.lineP(p.add(dy), p.add(dx).add(dy), color, depth);
|
|
ctx.engine.lineP(p.add(dy), p.add(dx).add(dy), color, depth);
|
|
ctx.engine.lineP(p.add(dy), p.add(dx).add(dy), color, depth);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ public static function ofBounds( bounds : h3d.col.Bounds, ?parent : Object ) {
|
|
|
|
+ var b = new Box();
|
|
|
|
+ if( parent != null ) parent.addChild(b);
|
|
|
|
+ b.x = (bounds.xMin + bounds.xMax) * 0.5;
|
|
|
|
+ b.y = (bounds.yMin + bounds.yMax) * 0.5;
|
|
|
|
+ b.z = (bounds.zMin + bounds.zMax) * 0.5;
|
|
|
|
+ b.scaleX = bounds.xMax - bounds.xMin;
|
|
|
|
+ b.scaleY = bounds.yMax - bounds.yMin;
|
|
|
|
+ b.scaleZ = bounds.zMax - bounds.zMin;
|
|
|
|
+ return b;
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|