summaryrefslogtreecommitdiff
path: root/src/main/scala/graphyx/graphics/GraphicalAABB.scala
blob: cb3694b8308380f7de49e5392a5818719379a14e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)
  }
}