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
107 changes: 74 additions & 33 deletions build/three.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -4169,10 +4169,6 @@ class Quaternion {

const x = euler._x, y = euler._y, z = euler._z, order = euler._order;

// http://www.mathworks.com/matlabcentral/fileexchange/
// 20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/
// content/SpinCalc.m

const cos = Math.cos;
const sin = Math.sin;

Expand Down Expand Up @@ -4248,8 +4244,6 @@ class Quaternion {
*/
setFromAxisAngle( axis, angle ) {

// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm

const halfAngle = angle / 2, s = Math.sin( halfAngle );

this._x = axis.x * s;
Expand All @@ -4271,8 +4265,6 @@ class Quaternion {
*/
setFromRotationMatrix( m ) {

// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm

// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)

const te = m.elements,
Expand Down Expand Up @@ -4560,8 +4552,6 @@ class Quaternion {
*/
multiplyQuaternions( a, b ) {

// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm

const qax = a._x, qay = a._y, qaz = a._z, qaw = a._w;
const qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w;

Expand Down Expand Up @@ -8521,8 +8511,6 @@ class Vector4 {
*/
setAxisAngleFromQuaternion( q ) {

// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm

// q is assumed to be normalized

this.w = 2 * Math.acos( q.w );
Expand Down Expand Up @@ -8556,8 +8544,6 @@ class Vector4 {
*/
setAxisAngleFromRotationMatrix( m ) {

// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm

// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)

let angle, x, y, z; // variables for result
Expand Down Expand Up @@ -13511,6 +13497,27 @@ class Object3D extends EventDispatcher {

}

/**
* Frees the GPU-related resources allocated by this instance. Call this
* method whenever this instance is no longer used in your app.
*
* Geometries, materials and textures are potentially shared with other
* 3D objects and must be disposed of separately.
*
* @fires Object3D#dispose
*/
dispose() {

/**
* Fires when the 3D object has been disposed of.
*
* @event Object3D#dispose
* @type {Object}
*/
this.dispatchEvent( { type: 'dispose' } );

}

}

/**
Expand Down Expand Up @@ -25718,7 +25725,7 @@ class InstancedMesh extends Mesh {
*/
dispose() {

this.dispatchEvent( { type: 'dispose' } );
super.dispose();

if ( this.morphTexture !== null ) {

Expand Down Expand Up @@ -25914,6 +25921,10 @@ class Frustum {
/**
* Returns `true` if the given bounding sphere is intersecting this frustum.
*
* This is a fast, conservative test that favors performance over precision. It can
* report false positives for spheres that lie outside the frustum but are not separated
* by a single frustum plane. It never reports false negatives, so it is safe for culling.
*
* @param {Sphere} sphere - The bounding sphere to test.
* @return {boolean} Whether the bounding sphere is intersecting this frustum or not.
*/
Expand Down Expand Up @@ -25942,6 +25953,11 @@ class Frustum {
/**
* Returns `true` if the given bounding box is intersecting this frustum.
*
* This is a fast, conservative test that favors performance over precision. It can
* report false positives for large boxes that lie outside the frustum but are not
* separated by a single frustum plane. It never reports false negatives, so it is
* safe for culling.
*
* @param {Box3} box - The bounding box to test.
* @return {boolean} Whether the bounding box is intersecting this frustum or not.
*/
Expand Down Expand Up @@ -27422,6 +27438,7 @@ class BatchedMesh extends Mesh {
this.validateGeometryId( geometryId );

this._instanceInfo[ instanceId ].geometryIndex = geometryId;
this._visibilityChanged = true;

return this;

Expand Down Expand Up @@ -27716,6 +27733,8 @@ class BatchedMesh extends Mesh {
*/
dispose() {

super.dispose();

// Assuming the geometry is not shared with other meshes
this.geometry.dispose();

Expand Down Expand Up @@ -45988,16 +46007,6 @@ class Light extends Object3D {

}

/**
* Frees the GPU-related resources allocated by this instance. Call this
* method whenever this instance is no longer used in your app.
*/
dispose() {

this.dispatchEvent( { type: 'dispose' } );

}

copy( source, recursive ) {

super.copy( source, recursive );
Expand Down Expand Up @@ -50319,6 +50328,8 @@ class ImageBitmapLoader extends Loader {

scope.manager.itemEnd( url );

return imageBitmap; // see #34150

} ).catch( function ( e ) {

if ( onError ) onError( e );
Expand Down Expand Up @@ -55867,15 +55878,19 @@ class RenderTarget3D extends RenderTarget {

this.depth = depth;

/**
* Overwritten with a different texture type.
*
* @type {Data3DTexture}
*/
this.texture = new Data3DTexture( null, width, height, depth );
this._setTextureOptions( options );
// overwrite attachments with 3D textures

this.texture.isRenderTargetTexture = true;
for ( let i = 0; i < this.textures.length; i ++ ) {

const texture = new Data3DTexture( null, width, height, depth );
texture.isRenderTargetTexture = true;
texture.renderTarget = this;

this.textures[ i ] = texture;

}

this._setTextureOptions( options );

}

Expand Down Expand Up @@ -57928,6 +57943,8 @@ class SpotLightHelper extends Object3D {
*/
dispose() {

super.dispose();

this.cone.geometry.dispose();
this.cone.material.dispose();

Expand Down Expand Up @@ -58139,6 +58156,8 @@ class SkeletonHelper extends LineSegments {
*/
dispose() {

super.dispose();

this.geometry.dispose();
this.material.dispose();

Expand Down Expand Up @@ -58230,6 +58249,8 @@ class PointLightHelper extends Mesh {
*/
dispose() {

super.dispose();

this.geometry.dispose();
this.material.dispose();

Expand Down Expand Up @@ -58350,6 +58371,8 @@ class HemisphereLightHelper extends Object3D {
*/
dispose() {

super.dispose();

this.children[ 0 ].geometry.dispose();
this.children[ 0 ].material.dispose();

Expand Down Expand Up @@ -58463,6 +58486,8 @@ class GridHelper extends LineSegments {
*/
dispose() {

super.dispose();

this.geometry.dispose();
this.material.dispose();

Expand Down Expand Up @@ -58581,6 +58606,8 @@ class PolarGridHelper extends LineSegments {
*/
dispose() {

super.dispose();

this.geometry.dispose();
this.material.dispose();

Expand Down Expand Up @@ -58686,6 +58713,8 @@ class DirectionalLightHelper extends Object3D {
*/
dispose() {

super.dispose();

this.lightPlane.geometry.dispose();
this.lightPlane.material.dispose();
this.targetLine.geometry.dispose();
Expand Down Expand Up @@ -59036,6 +59065,8 @@ class CameraHelper extends LineSegments {
*/
dispose() {

super.dispose();

this.geometry.dispose();
this.material.dispose();

Expand Down Expand Up @@ -59198,6 +59229,8 @@ class BoxHelper extends LineSegments {
*/
dispose() {

super.dispose();

this.geometry.dispose();
this.material.dispose();

Expand Down Expand Up @@ -59275,6 +59308,8 @@ class Box3Helper extends LineSegments {
*/
dispose() {

super.dispose();

this.geometry.dispose();
this.material.dispose();

Expand Down Expand Up @@ -59361,6 +59396,8 @@ class PlaneHelper extends Line {
*/
dispose() {

super.dispose();

this.geometry.dispose();
this.material.dispose();
this.children[ 0 ].geometry.dispose();
Expand Down Expand Up @@ -59521,6 +59558,8 @@ class ArrowHelper extends Object3D {
*/
dispose() {

super.dispose();

this.line.geometry.dispose();
this.line.material.dispose();
this.cone.geometry.dispose();
Expand Down Expand Up @@ -59611,6 +59650,8 @@ class AxesHelper extends LineSegments {
*/
dispose() {

super.dispose();

this.geometry.dispose();
this.material.dispose();

Expand Down
19 changes: 19 additions & 0 deletions build/three.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -13845,6 +13845,7 @@ class WebXRManager extends EventDispatcher {

const currentSize = new Vector2();
let currentPixelRatio = null;
let currentCameraSettings = null;

//

Expand Down Expand Up @@ -14040,6 +14041,18 @@ class WebXRManager extends EventDispatcher {
renderer.setPixelRatio( currentPixelRatio );
renderer.setSize( currentSize.width, currentSize.height, false );

if ( currentCameraSettings !== null ) {

const camera = currentCameraSettings.camera;

camera.fov = currentCameraSettings.fov;
camera.zoom = currentCameraSettings.zoom;
camera.updateProjectionMatrix();

currentCameraSettings = null;

}

scope.dispatchEvent( { type: 'sessionend' } );

}
Expand Down Expand Up @@ -14561,6 +14574,12 @@ class WebXRManager extends EventDispatcher {

// update user camera and its children

if ( currentCameraSettings === null && camera.isPerspectiveCamera ) {

currentCameraSettings = { camera: camera, fov: camera.fov, zoom: camera.zoom };

}

updateUserCamera( camera, cameraXR, parent );

};
Expand Down
5 changes: 3 additions & 2 deletions build/three.tsl.js

Large diffs are not rendered by default.

Loading
Loading