diff options
Diffstat (limited to 'src/main/scala/graphyx/graphics/GraphicalAABB.scala')
-rw-r--r-- | src/main/scala/graphyx/graphics/GraphicalAABB.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/scala/graphyx/graphics/GraphicalAABB.scala b/src/main/scala/graphyx/graphics/GraphicalAABB.scala new file mode 100644 index 0000000..cb3694b --- /dev/null +++ b/src/main/scala/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._ +class GraphicalAABB(val 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) + } +} |