Skip to content

Commit

Permalink
Update to threejs 152
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin ETOURNEAU committed Jun 29, 2023
1 parent a2e0f5c commit 17fbf07
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions config/threeExamples.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ export default {
'./loaders/DRACOLoader.js',
'./loaders/DDSLoader.js',
'./capabilities/WebGL.js',
'./utils/BufferGeometryUtils.js',
],
};
2 changes: 1 addition & 1 deletion examples/itowns-potree.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
with `itowns.THREE` or `itowns.proj4`. -->
<script type="text/javascript">
const THREE = itowns.THREE;
THREE.Object3D.DefaultUp.set(0, 0, 1);
THREE.Object3D.DEFAULT_UP.set(0, 0, 1);

const proj4 = itowns.proj4;
</script>
Expand Down
2 changes: 1 addition & 1 deletion examples/view_multi_25d.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
// `viewerDiv` will contain iTowns' rendering area (`<canvas>`)
viewerDiv = document.getElementById('viewerDiv');

itowns.THREE.Object3D.DefaultUp.set(0, 0, 1);
itowns.THREE.Object3D.DEFAULT_UP.set(0, 0, 1);

scale = new itowns.THREE.Vector3(1, 1, 1).divideScalar(extent.planarDimensions().x);

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
},
"peerDependencies": {
"proj4": "^2.8.0",
"three": "0.146.0"
"three": "0.152.0"
},
"devDependencies": {
"@babel/cli": "^7.17.10",
Expand Down Expand Up @@ -109,8 +109,8 @@
"puppeteer": "^14.1.1",
"q": "^1.5.1",
"replace-in-file": "^6.3.2",
"three": "0.146.0",
"url-polyfill": "^1.1.12",
"three": "0.152.0",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.9.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Converter/Feature2Texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export default {
data[0] = backgroundColor.r * 255;
data[1] = backgroundColor.g * 255;
data[2] = backgroundColor.b * 255;
texture = new THREE.DataTexture(data, 1, 1, THREE.RGBFormat);
texture = new THREE.DataTexture(data, 1, 1, THREE.RGBAFormat);
} else {
texture = new THREE.Texture();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Prefab/GlobeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class GlobeView extends View {
* @param {Object} options.controls - See options of {@link GlobeControls}
*/
constructor(viewerDiv, placement = {}, options = {}) {
THREE.Object3D.DefaultUp.set(0, 0, 1);
THREE.Object3D.DEFAULT_UP.set(0, 0, 1);
// Setup View
super('EPSG:4978', viewerDiv, options);
this.isGlobeView = true;
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Prefab/PlanarView.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PlanarView extends View {
* initialization. By default, camera will display the view's extent (given in `extent` parameter).
*/
constructor(viewerDiv, extent, options = {}) {
THREE.Object3D.DefaultUp.set(0, 0, 1);
THREE.Object3D.DEFAULT_UP.set(0, 0, 1);

// Setup View
super(extent.crs, viewerDiv, options);
Expand Down
2 changes: 1 addition & 1 deletion src/Parser/deprecated/LegacyGLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ threeExamples.LegacyGLTFLoader = ( function () {

var WEBGL_TEXTURE_FORMATS = {
6406: THREE.AlphaFormat,
6407: THREE.RGBFormat,
6407: THREE.RGBAFormat,
6408: THREE.RGBAFormat,
6409: THREE.LuminanceFormat,
6410: THREE.LuminanceAlphaFormat
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/CameraUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Ellipsoid from 'Core/Math/Ellipsoid';
import OBB from 'Renderer/OBB';
import { VIEW_EVENTS } from 'Core/View';

THREE.Object3D.DefaultUp.set(0, 0, 1);
THREE.Object3D.DEFAULT_UP.set(0, 0, 1);
const targetPosition = new THREE.Vector3();
const targetCoord = new Coordinates('EPSG:4326', 0, 0, 0);
const ellipsoid = new Ellipsoid();
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cameraUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function equalToFixed(value1, value2, toFixed) {
}

describe('Camera utils unit test', function () {
THREE.Object3D.DefaultUp = new THREE.Vector3(0, 0, 1);
THREE.Object3D.DEFAULT_UP = new THREE.Vector3(0, 0, 1);

const original = DEMUtils.getElevationValueAt;

Expand Down

0 comments on commit 17fbf07

Please sign in to comment.