|
|
@@ -1,9 +1,11 @@
|
|
|
import { WebGLCoordinateSystem, WebGPUCoordinateSystem } from '../constants.js';
|
|
|
+import { Vector2 } from './Vector2.js';
|
|
|
import { Vector3 } from './Vector3.js';
|
|
|
import { Sphere } from './Sphere.js';
|
|
|
import { Plane } from './Plane.js';
|
|
|
|
|
|
const _sphere = /*@__PURE__*/ new Sphere();
|
|
|
+const _defaultSpriteCenter = /*@__PURE__*/ new Vector2( 0.5, 0.5 );
|
|
|
const _vector = /*@__PURE__*/ new Vector3();
|
|
|
|
|
|
/**
|
|
|
@@ -161,7 +163,10 @@ class Frustum {
|
|
|
intersectsSprite( sprite ) {
|
|
|
|
|
|
_sphere.center.set( 0, 0, 0 );
|
|
|
- _sphere.radius = 0.7071067811865476;
|
|
|
+
|
|
|
+ const offset = _defaultSpriteCenter.distanceTo( sprite.center );
|
|
|
+
|
|
|
+ _sphere.radius = 0.7071067811865476 + offset;
|
|
|
_sphere.applyMatrix4( sprite.matrixWorld );
|
|
|
|
|
|
return this.intersectsSphere( _sphere );
|