|
@@ -26122,9 +26122,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
const controllers = [];
|
|
|
const controllerInputSources = [];
|
|
|
|
|
|
- const planes = new Set();
|
|
|
- const planesLastChangedTimes = new Map();
|
|
|
-
|
|
|
//
|
|
|
|
|
|
let userCamera = null;
|
|
@@ -26733,12 +26730,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
};
|
|
|
|
|
|
- this.getPlanes = function () {
|
|
|
-
|
|
|
- return planes;
|
|
|
-
|
|
|
- };
|
|
|
-
|
|
|
// Animation Loop
|
|
|
|
|
|
let onAnimationFrameCallback = null;
|
|
@@ -26852,60 +26843,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
if ( frame.detectedPlanes ) {
|
|
|
|
|
|
- scope.dispatchEvent( { type: 'planesdetected', data: frame.detectedPlanes } );
|
|
|
-
|
|
|
- let planesToRemove = null;
|
|
|
-
|
|
|
- for ( const plane of planes ) {
|
|
|
-
|
|
|
- if ( ! frame.detectedPlanes.has( plane ) ) {
|
|
|
-
|
|
|
- if ( planesToRemove === null ) {
|
|
|
-
|
|
|
- planesToRemove = [];
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- planesToRemove.push( plane );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if ( planesToRemove !== null ) {
|
|
|
-
|
|
|
- for ( const plane of planesToRemove ) {
|
|
|
-
|
|
|
- planes.delete( plane );
|
|
|
- planesLastChangedTimes.delete( plane );
|
|
|
- scope.dispatchEvent( { type: 'planeremoved', data: plane } );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- for ( const plane of frame.detectedPlanes ) {
|
|
|
-
|
|
|
- if ( ! planes.has( plane ) ) {
|
|
|
-
|
|
|
- planes.add( plane );
|
|
|
- planesLastChangedTimes.set( plane, frame.lastChangedTime );
|
|
|
- scope.dispatchEvent( { type: 'planeadded', data: plane } );
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- const lastKnownTime = planesLastChangedTimes.get( plane );
|
|
|
-
|
|
|
- if ( plane.lastChangedTime > lastKnownTime ) {
|
|
|
-
|
|
|
- planesLastChangedTimes.set( plane, plane.lastChangedTime );
|
|
|
- scope.dispatchEvent( { type: 'planechanged', data: plane } );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+ scope.dispatchEvent( { type: 'planesdetected', data: frame } );
|
|
|
|
|
|
}
|
|
|
|