 m_ctl = b4w.require("controls")
 
 vec2_tmp = new Float32Array(2)
+control_rotate_circle = undefined
+control_pan_circle = undefined
+control_rotate_circle_offset = undefined
+control_pan_circle_offset = undefined
 
 $ ->
   $(window).resize ->

  pan_left_arrow = m_ctl.create_custom_sensor(0)
  pan_up_arrow = m_ctl.create_custom_sensor(0)
  pan_down_arrow = m_ctl.create_custom_sensor(0)
  document.getElementById("b4w-overlay").addEventListener("touchstart", touch_start_cb, false)
  document.getElementById("b4w-overlay").addEventListener("touchmove", touch_move_cb, false)
  document.getElementById("b4w-overlay").addEventListener("touchend", touch_end_cb, false)


    if(x > w / 2)
      console.log("right hand side")
      control_rotate_circle.style.left = x - control_rotate_circle_offset + "px"
      control_rotate_circle.style.top = y - control_rotate_circle_offset + "px"

    else
      console.log("left hand side")
      control_pan_circle.style.left = x - control_pan_circle_offset + "px"
      control_pan_circle.style.top = y - control_pan_circle_offset + "px"

    i++
  return
