|
|
@@ -3869,7 +3869,7 @@ class Quaternion {
|
|
|
|
|
|
let r = vFrom.dot( vTo ) + 1;
|
|
|
|
|
|
- if ( r < Number.EPSILON ) {
|
|
|
+ if ( r < 1e-8 ) { // the epsilon value has been discussed in #31286
|
|
|
|
|
|
// vFrom and vTo point in opposite directions
|
|
|
|
|
|
@@ -18539,8 +18539,8 @@ class Uint32BufferAttribute extends BufferAttribute {
|
|
|
* Convenient class that can be used when creating a `Float16` buffer attribute with
|
|
|
* a plain `Array` instance.
|
|
|
*
|
|
|
- * This class automatically converts to and from FP16 since `Float16Array` is not
|
|
|
- * natively supported in JavaScript.
|
|
|
+ * This class automatically converts to and from FP16 via `Uint16Array` since `Float16Array`
|
|
|
+ * browser support is still problematic.
|
|
|
*
|
|
|
* @augments BufferAttribute
|
|
|
*/
|
|
|
@@ -26306,6 +26306,7 @@ class Plane {
|
|
|
}
|
|
|
|
|
|
const _sphere$3 = /*@__PURE__*/ new Sphere();
|
|
|
+const _defaultSpriteCenter = /*@__PURE__*/ new Vector2( 0.5, 0.5 );
|
|
|
const _vector$6 = /*@__PURE__*/ new Vector3();
|
|
|
|
|
|
/**
|
|
|
@@ -26463,7 +26464,10 @@ class Frustum {
|
|
|
intersectsSprite( sprite ) {
|
|
|
|
|
|
_sphere$3.center.set( 0, 0, 0 );
|
|
|
- _sphere$3.radius = 0.7071067811865476;
|
|
|
+
|
|
|
+ const offset = _defaultSpriteCenter.distanceTo( sprite.center );
|
|
|
+
|
|
|
+ _sphere$3.radius = 0.7071067811865476 + offset;
|
|
|
_sphere$3.applyMatrix4( sprite.matrixWorld );
|
|
|
|
|
|
return this.intersectsSphere( _sphere$3 );
|
|
|
@@ -33896,11 +33900,11 @@ class Path extends CurvePath {
|
|
|
* Adds an arc as an instance of {@link EllipseCurve} to the path, positioned relative
|
|
|
* to the current point.
|
|
|
*
|
|
|
- * @param {number} aX - The x coordinate of the center of the arc offsetted from the previous curve.
|
|
|
- * @param {number} aY - The y coordinate of the center of the arc offsetted from the previous curve.
|
|
|
- * @param {number} aRadius - The radius of the arc.
|
|
|
- * @param {number} aStartAngle - The start angle in radians.
|
|
|
- * @param {number} aEndAngle - The end angle in radians.
|
|
|
+ * @param {number} [aX=0] - The x coordinate of the center of the arc offsetted from the previous curve.
|
|
|
+ * @param {number} [aY=0] - The y coordinate of the center of the arc offsetted from the previous curve.
|
|
|
+ * @param {number} [aRadius=1] - The radius of the arc.
|
|
|
+ * @param {number} [aStartAngle=0] - The start angle in radians.
|
|
|
+ * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.
|
|
|
* @param {boolean} [aClockwise=false] - Whether to sweep the arc clockwise or not.
|
|
|
* @return {Path} A reference to this path.
|
|
|
*/
|
|
|
@@ -33919,11 +33923,11 @@ class Path extends CurvePath {
|
|
|
/**
|
|
|
* Adds an absolutely positioned arc as an instance of {@link EllipseCurve} to the path.
|
|
|
*
|
|
|
- * @param {number} aX - The x coordinate of the center of the arc.
|
|
|
- * @param {number} aY - The y coordinate of the center of the arc.
|
|
|
- * @param {number} aRadius - The radius of the arc.
|
|
|
- * @param {number} aStartAngle - The start angle in radians.
|
|
|
- * @param {number} aEndAngle - The end angle in radians.
|
|
|
+ * @param {number} [aX=0] - The x coordinate of the center of the arc.
|
|
|
+ * @param {number} [aY=0] - The y coordinate of the center of the arc.
|
|
|
+ * @param {number} [aRadius=1] - The radius of the arc.
|
|
|
+ * @param {number} [aStartAngle=0] - The start angle in radians.
|
|
|
+ * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.
|
|
|
* @param {boolean} [aClockwise=false] - Whether to sweep the arc clockwise or not.
|
|
|
* @return {Path} A reference to this path.
|
|
|
*/
|
|
|
@@ -33939,12 +33943,12 @@ class Path extends CurvePath {
|
|
|
* Adds an ellipse as an instance of {@link EllipseCurve} to the path, positioned relative
|
|
|
* to the current point
|
|
|
*
|
|
|
- * @param {number} aX - The x coordinate of the center of the ellipse offsetted from the previous curve.
|
|
|
- * @param {number} aY - The y coordinate of the center of the ellipse offsetted from the previous curve.
|
|
|
- * @param {number} xRadius - The radius of the ellipse in the x axis.
|
|
|
- * @param {number} yRadius - The radius of the ellipse in the y axis.
|
|
|
- * @param {number} aStartAngle - The start angle in radians.
|
|
|
- * @param {number} aEndAngle - The end angle in radians.
|
|
|
+ * @param {number} [aX=0] - The x coordinate of the center of the ellipse offsetted from the previous curve.
|
|
|
+ * @param {number} [aY=0] - The y coordinate of the center of the ellipse offsetted from the previous curve.
|
|
|
+ * @param {number} [xRadius=1] - The radius of the ellipse in the x axis.
|
|
|
+ * @param {number} [yRadius=1] - The radius of the ellipse in the y axis.
|
|
|
+ * @param {number} [aStartAngle=0] - The start angle in radians.
|
|
|
+ * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.
|
|
|
* @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not.
|
|
|
* @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.
|
|
|
* @return {Path} A reference to this path.
|
|
|
@@ -33963,12 +33967,12 @@ class Path extends CurvePath {
|
|
|
/**
|
|
|
* Adds an absolutely positioned ellipse as an instance of {@link EllipseCurve} to the path.
|
|
|
*
|
|
|
- * @param {number} aX - The x coordinate of the absolute center of the ellipse.
|
|
|
- * @param {number} aY - The y coordinate of the absolute center of the ellipse.
|
|
|
- * @param {number} xRadius - The radius of the ellipse in the x axis.
|
|
|
- * @param {number} yRadius - The radius of the ellipse in the y axis.
|
|
|
- * @param {number} aStartAngle - The start angle in radians.
|
|
|
- * @param {number} aEndAngle - The end angle in radians.
|
|
|
+ * @param {number} [aX=0] - The x coordinate of the absolute center of the ellipse.
|
|
|
+ * @param {number} [aY=0] - The y coordinate of the absolute center of the ellipse.
|
|
|
+ * @param {number} [xRadius=1] - The radius of the ellipse in the x axis.
|
|
|
+ * @param {number} [yRadius=1] - The radius of the ellipse in the y axis.
|
|
|
+ * @param {number} [aStartAngle=0] - The start angle in radians.
|
|
|
+ * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.
|
|
|
* @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not.
|
|
|
* @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.
|
|
|
* @return {Path} A reference to this path.
|
|
|
@@ -43788,7 +43792,7 @@ class FileLoader extends Loader {
|
|
|
|
|
|
url = this.manager.resolveURL( url );
|
|
|
|
|
|
- const cached = Cache.get( url );
|
|
|
+ const cached = Cache.get( `file:${url}` );
|
|
|
|
|
|
if ( cached !== undefined ) {
|
|
|
|
|
|
@@ -43977,7 +43981,7 @@ class FileLoader extends Loader {
|
|
|
|
|
|
// Add to cache only on HTTP success, so that we do not cache
|
|
|
// error response bodies as proper responses to requests.
|
|
|
- Cache.add( url, data );
|
|
|
+ Cache.add( `file:${url}`, data );
|
|
|
|
|
|
const callbacks = loading[ url ];
|
|
|
delete loading[ url ];
|
|
|
@@ -44341,7 +44345,7 @@ class ImageLoader extends Loader {
|
|
|
|
|
|
const scope = this;
|
|
|
|
|
|
- const cached = Cache.get( url );
|
|
|
+ const cached = Cache.get( `image:${url}` );
|
|
|
|
|
|
if ( cached !== undefined ) {
|
|
|
|
|
|
@@ -44407,7 +44411,7 @@ class ImageLoader extends Loader {
|
|
|
|
|
|
if ( onError ) onError( event );
|
|
|
|
|
|
- Cache.remove( url );
|
|
|
+ Cache.remove( `image:${url}` );
|
|
|
|
|
|
//
|
|
|
|
|
|
@@ -44444,7 +44448,7 @@ class ImageLoader extends Loader {
|
|
|
|
|
|
}
|
|
|
|
|
|
- Cache.add( url, image );
|
|
|
+ Cache.add( `image:${url}`, image );
|
|
|
scope.manager.itemStart( url );
|
|
|
|
|
|
image.src = url;
|
|
|
@@ -48687,7 +48691,7 @@ class ImageBitmapLoader extends Loader {
|
|
|
|
|
|
const scope = this;
|
|
|
|
|
|
- const cached = Cache.get( url );
|
|
|
+ const cached = Cache.get( `imageBitmap:${url}` );
|
|
|
|
|
|
if ( cached !== undefined ) {
|
|
|
|
|
|
@@ -48750,7 +48754,7 @@ class ImageBitmapLoader extends Loader {
|
|
|
|
|
|
} ).then( function ( imageBitmap ) {
|
|
|
|
|
|
- Cache.add( url, imageBitmap );
|
|
|
+ Cache.add( `imageBitmap:${url}`, imageBitmap );
|
|
|
|
|
|
if ( onLoad ) onLoad( imageBitmap );
|
|
|
|
|
|
@@ -48764,14 +48768,14 @@ class ImageBitmapLoader extends Loader {
|
|
|
|
|
|
_errorMap.set( promise, e );
|
|
|
|
|
|
- Cache.remove( url );
|
|
|
+ Cache.remove( `imageBitmap:${url}` );
|
|
|
|
|
|
scope.manager.itemError( url );
|
|
|
scope.manager.itemEnd( url );
|
|
|
|
|
|
} );
|
|
|
|
|
|
- Cache.add( url, promise );
|
|
|
+ Cache.add( `imageBitmap:${url}`, promise );
|
|
|
scope.manager.itemStart( url );
|
|
|
|
|
|
}
|
|
|
@@ -58227,6 +58231,10 @@ function WebGLAttributes( gl ) {
|
|
|
|
|
|
type = gl.FLOAT;
|
|
|
|
|
|
+ } else if ( typeof Float16Array !== 'undefined' && array instanceof Float16Array ) {
|
|
|
+
|
|
|
+ type = gl.HALF_FLOAT;
|
|
|
+
|
|
|
} else if ( array instanceof Uint16Array ) {
|
|
|
|
|
|
if ( attribute.isFloat16BufferAttribute ) {
|