To use OrbitControls for Ejecta you will need to modify the OrbitControls.js where touchmove
is looking for variable element.clientHeight
and element.clientWidth
. These are read-only properties of Element which are not available in Ejecta.
If you are passing the default document
Element using controls = new THREE.OrbitControls( camera );
, then you can replace the following lines with the innerWidth
and innerHeight
properties of window
. (window == document
are basically same element in Ejecta).
function touchmove( event ) {
if ( scope.enabled === false ) { return; }
event.preventDefault();
event.stopPropagation();
var element = scope.domElement === document ? scope.domElement.body : scope.domElement;
// -------- modification
if (window.ejecta) {
element.clientHeight = window.innerHeight;
element.clientWidth = window.innerHeight;
}
// -------- end modification
switch ( event.touches.length ) {
...