 
 {vec3} = require 'vmath'
-# Force usage of spur-events' polyfill even when there is pointer event support
-# to avoid some problems in Chrome
-window.PointerEvent = undefined
-{addListener, removeListener} = require 'spur-events'
+# To be able to use pointer events everywhere,
+# use this https://www.npmjs.com/package/pepjs
+addListener = (el, ev, f, opts) -> el.addEventListener ev, f, opts
+removeListener = (el, ev, f, opts) -> el.removeEventListener ev, f, opts
 {set_immediate} = require './main_loop'
 
 supports_passive_events = false # changed at the end

        @on_key_up? and window.removeEventListener 'keyup', @_on_key_up
        @on_wheel? and root.removeEventListener 'wheel', @_on_wheel_listener
        # @on_click? and removeListener root, 'click', @on_click

options = Object.defineProperty {}, 'passive', get: ->
    supports_passive_events = true

                return @scene.world.ray_test pos, rayto, @int_mask
        return {}

    lock_pointer: ->
        if not @_enabled
            throw Error "Can't lock pointer when behaviour is disabled"
        if not @locked
            @_root.requestPointerLock()
        return this

    unlock_pointer: ->
        if @locked
            document.exitPointerLock()
        return this

    _add_callbacks: =>
        @_remove_callbacks()
        if @on_tick?
