summaryrefslogtreecommitdiff
path: root/src/graphyx/graphics/GraphicalAABB.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphyx/graphics/GraphicalAABB.scala')
-rw-r--r--src/graphyx/graphics/GraphicalAABB.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/graphyx/graphics/GraphicalAABB.scala b/src/graphyx/graphics/GraphicalAABB.scala
new file mode 100644
index 0000000..3d8999c
--- /dev/null
+++ b/src/graphyx/graphics/GraphicalAABB.scala
@@ -0,0 +1,18 @@
+/*
+ * Graphyx
+ * copyright (c) 2009 Jakob Odersky
+ * made available under the MIT License
+*/
+
+package graphyx.graphics
+
+import sims.collision._
+case class GraphicalAABB(real: AABB) extends AABB(real.minVertex, real.maxVertex) with GraphicalObject {
+ override def draw() = {
+ g.setColor(java.awt.Color.BLACK)
+ g.drawRect((minVertex.x * scale * ppm).toInt,
+ correctY(maxVertex.y * scale * ppm).toInt,
+ ((maxVertex - minVertex).x * scale * ppm).toInt,
+ ((maxVertex - minVertex).y * scale * ppm).toInt)
+ }
+}