Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 43 additions & 35 deletions build/three.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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();

/**
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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.
*/
Expand All @@ -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.
*/
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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 ) {

Expand Down Expand Up @@ -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 ];
Expand Down Expand Up @@ -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 ) {

Expand Down Expand Up @@ -44407,7 +44411,7 @@ class ImageLoader extends Loader {

if ( onError ) onError( event );

Cache.remove( url );
Cache.remove( `image:${url}` );

//

Expand Down Expand Up @@ -44444,7 +44448,7 @@ class ImageLoader extends Loader {

}

Cache.add( url, image );
Cache.add( `image:${url}`, image );
scope.manager.itemStart( url );

image.src = url;
Expand Down Expand Up @@ -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 ) {

Expand Down Expand Up @@ -48750,7 +48754,7 @@ class ImageBitmapLoader extends Loader {

} ).then( function ( imageBitmap ) {

Cache.add( url, imageBitmap );
Cache.add( `imageBitmap:${url}`, imageBitmap );

if ( onLoad ) onLoad( imageBitmap );

Expand All @@ -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 );

}
Expand Down Expand Up @@ -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 ) {
Expand Down
74 changes: 39 additions & 35 deletions build/three.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -3867,7 +3867,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

Expand Down Expand Up @@ -18537,8 +18537,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
*/
Expand Down Expand Up @@ -26304,6 +26304,7 @@ class Plane {
}

const _sphere$3 = /*@__PURE__*/ new Sphere();
const _defaultSpriteCenter = /*@__PURE__*/ new Vector2( 0.5, 0.5 );
const _vector$6 = /*@__PURE__*/ new Vector3();

/**
Expand Down Expand Up @@ -26461,7 +26462,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 );
Expand Down Expand Up @@ -33894,11 +33898,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.
*/
Expand All @@ -33917,11 +33921,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.
*/
Expand All @@ -33937,12 +33941,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.
Expand All @@ -33961,12 +33965,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.
Expand Down Expand Up @@ -43786,7 +43790,7 @@ class FileLoader extends Loader {

url = this.manager.resolveURL( url );

const cached = Cache.get( url );
const cached = Cache.get( `file:${url}` );

if ( cached !== undefined ) {

Expand Down Expand Up @@ -43975,7 +43979,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 ];
Expand Down Expand Up @@ -44339,7 +44343,7 @@ class ImageLoader extends Loader {

const scope = this;

const cached = Cache.get( url );
const cached = Cache.get( `image:${url}` );

if ( cached !== undefined ) {

Expand Down Expand Up @@ -44405,7 +44409,7 @@ class ImageLoader extends Loader {

if ( onError ) onError( event );

Cache.remove( url );
Cache.remove( `image:${url}` );

//

Expand Down Expand Up @@ -44442,7 +44446,7 @@ class ImageLoader extends Loader {

}

Cache.add( url, image );
Cache.add( `image:${url}`, image );
scope.manager.itemStart( url );

image.src = url;
Expand Down Expand Up @@ -48685,7 +48689,7 @@ class ImageBitmapLoader extends Loader {

const scope = this;

const cached = Cache.get( url );
const cached = Cache.get( `imageBitmap:${url}` );

if ( cached !== undefined ) {

Expand Down Expand Up @@ -48748,7 +48752,7 @@ class ImageBitmapLoader extends Loader {

} ).then( function ( imageBitmap ) {

Cache.add( url, imageBitmap );
Cache.add( `imageBitmap:${url}`, imageBitmap );

if ( onLoad ) onLoad( imageBitmap );

Expand All @@ -48762,14 +48766,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 );

}
Expand Down
2 changes: 1 addition & 1 deletion build/three.core.min.js

Large diffs are not rendered by default.

Loading