ported to three.js r66