Skip to content

Commit 286b2d5

Browse files
committed
Updated examples builds.
1 parent df45402 commit 286b2d5

File tree

7 files changed

+197
-86
lines changed

7 files changed

+197
-86
lines changed

examples/js/controls/ArcballControls.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,7 +1850,7 @@
18501850

18511851
this._gizmoMatrixState.copy( this._gizmoMatrixState0 );
18521852

1853-
if ( this.camera.zoom != 1 ) {
1853+
if ( this.camera.zoom !== 1 ) {
18541854

18551855
//adapt gizmos size to camera zoom
18561856
const size = 1 / this.camera.zoom;
@@ -1867,9 +1867,22 @@
18671867

18681868
}
18691869

1870-
this._gizmoMatrixState.decompose( this._gizmos.position, this._gizmos.quaternion, this._gizmos.scale );
1870+
this._gizmoMatrixState.decompose( this._gizmos.position, this._gizmos.quaternion, this._gizmos.scale ); //
1871+
1872+
1873+
this._gizmos.traverse( function ( object ) {
1874+
1875+
if ( object.isLine ) {
1876+
1877+
object.geometry.dispose();
1878+
object.material.dispose();
1879+
1880+
}
1881+
1882+
} );
1883+
1884+
this._gizmos.clear(); //
18711885

1872-
this._gizmos.clear();
18731886

18741887
this._gizmos.add( gizmoX );
18751888

examples/js/controls/TransformControls.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,17 @@
181181

182182
this.camera.updateMatrixWorld();
183183
this.camera.matrixWorld.decompose( this.cameraPosition, this.cameraQuaternion, this._cameraScale );
184-
this.eye.copy( this.cameraPosition ).sub( this.worldPosition ).normalize();
184+
185+
if ( this.camera.isOrthographicCamera ) {
186+
187+
this.camera.getWorldDirection( this.eye );
188+
189+
} else {
190+
191+
this.eye.copy( this.cameraPosition ).sub( this.worldPosition ).normalize();
192+
193+
}
194+
185195
super.updateMatrixWorld( this );
186196

187197
}

examples/js/loaders/KTX2Loader.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,24 @@
1212
* - KTX: http://github.khronos.org/KTX-Specification/
1313
* - DFD: https://www.khronos.org/registry/DataFormat/specs/1.3/dataformat.1.3.html#basicdescriptor
1414
*/
15-
const KTX2TransferSRGB = 2;
16-
const KTX2_ALPHA_PREMULTIPLIED = 1;
15+
const {
16+
read,
17+
KHR_DF_FLAG_ALPHA_PREMULTIPLIED,
18+
KHR_DF_TRANSFER_SRGB,
19+
VK_FORMAT_UNDEFINED,
20+
VK_FORMAT_R16_SFLOAT,
21+
VK_FORMAT_R16G16_SFLOAT,
22+
VK_FORMAT_R16G16B16A16_SFLOAT,
23+
VK_FORMAT_R32_SFLOAT,
24+
VK_FORMAT_R32G32_SFLOAT,
25+
VK_FORMAT_R32G32B32A32_SFLOAT,
26+
VK_FORMAT_R8_SRGB,
27+
VK_FORMAT_R8_UNORM,
28+
VK_FORMAT_R8G8_SRGB,
29+
VK_FORMAT_R8G8_UNORM,
30+
VK_FORMAT_R8G8B8A8_SRGB,
31+
VK_FORMAT_R8G8B8A8_UNORM
32+
} = KTX; // eslint-disable-line no-undef
1733

1834
const _taskCache = new WeakMap();
1935

@@ -173,8 +189,8 @@
173189
texture.magFilter = THREE.LinearFilter;
174190
texture.generateMipmaps = false;
175191
texture.needsUpdate = true;
176-
texture.encoding = dfdTransferFn === KTX2TransferSRGB ? THREE.sRGBEncoding : THREE.LinearEncoding;
177-
texture.premultiplyAlpha = !! ( dfdFlags & KTX2_ALPHA_PREMULTIPLIED );
192+
texture.encoding = dfdTransferFn === KHR_DF_TRANSFER_SRGB ? THREE.sRGBEncoding : THREE.LinearEncoding;
193+
texture.premultiplyAlpha = !! ( dfdFlags & KHR_DF_FLAG_ALPHA_PREMULTIPLIED );
178194
return texture;
179195

180196
}

0 commit comments

Comments
 (0)