 # constants
 qt  = Math.PI / 2
+et  = qt / 2
 tau = Math.PI * 2
 
 # general handle on everything; keeps track of geometry of entities it contains

      @bodyColor || 'black'
    )
  drag: ->
  drawCircle: ( x, y, radius, color ) ->
    return unless radius > 0
    ctx = @universe.ctx
    ctx.beginPath()
    ctx.arc x, y, radius, 0, tau
    ctx.fillStyle = color
    ctx.fill()
  setAttributes: ( options = {} ) ->

  # some decorations that let us see the animal's angle of vision
  # the direction of its gaze, and where it's headed
  drawHead: ->
    @earSize ?= @calcEarSize()
    @drawEar()
    @drawEar true
    inc = @visualAngle() * qt
    @eyeSize ?= @calcEyeSize()
    @drawEye inc
    @drawEye -inc
  drawEar: (left) ->
    point = @angle + if left then -qt else qt
    rad = @earSize
    [ start, end ] = if left then [ @angle, @angle + Math.PI ] else [ @angle - Math.PI, @angle ]
    [ x, y ] = @edgePoint point, rad + @radius
    @drawArc x, y, rad, @bodyColor, start, end
  calcEarSize: ->
    ratio = @auditoryRange() / @genes.auditoryRange[2]
    size = ratio * @radius / 3
    Math.max size, 1
  calcEyeSize: ->
    ratio = @visualRange() / @genes.visualRange[2]
    size = ratio * @radius / 4
