-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from VCityTeam/dev-unstable
2.32.6
- Loading branch information
Showing
250 changed files
with
1,565 additions
and
211 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,37 @@ | ||
|
||
|
||
import { View3D, itowns, THREE } from 'ud-viz'; | ||
import THREEUtils from 'ud-viz/src/Game/Shared/Components/THREEUtils'; | ||
|
||
let x = 1832891; | ||
let y = 5174952; | ||
let r = 1000; | ||
|
||
const extent = new itowns.Extent('EPSG:3946', x - r, x + r, y - r, y + r); | ||
const view = new View3D(); | ||
view.initItownsView(extent); | ||
|
||
const center = extent.center(); | ||
|
||
const image = document.createElement('img'); | ||
image.src = 'https://lh3.googleusercontent.com/proxy/-V2q6dQpdGNZw6JMniNsnI1hTItamwP2cXIoQBZQAZhU-NYEXHC39lJd1qJYIcrg8gvrx3tGeyJiPsg6v1A_l4xhWUgZ7O1aRTF9vfZD3ZcmB5Z1qNw6BMikdxzL4UGMMsSk9PRjAXQ6pTiLi3I-7CeobzNbDZ2Nz4dbw4cAlQTAJmWvSj80IbAhjlnk'; | ||
view.appendCSS3D( | ||
image, | ||
{ width: 200, height: 500 }, | ||
new THREEUtils.Transform( | ||
new THREE.Vector3(center.x, center.y, 50), | ||
new THREE.Vector3(Math.PI * 0.5, Math.PI * 0.2, 0), | ||
new THREE.Vector3(2, 2, 2) | ||
) | ||
); | ||
|
||
const geometry = new THREE.SphereGeometry(100, 32, 32); | ||
const material = new THREE.MeshBasicMaterial({ color: 0xffff00 }); | ||
const sphere = new THREE.Mesh(geometry, material); | ||
sphere.position.copy(new THREE.Vector3(center.x + 200, center.y, 50)); | ||
sphere.updateMatrixWorld(); | ||
|
||
view.getItownsView().scene.add(sphere); | ||
/** @format */ | ||
|
||
import { Views, itowns, THREE } from 'ud-viz'; | ||
import THREEUtils from 'ud-viz/src/Game/Shared/Components/THREEUtils'; | ||
|
||
const View3D = Views.View3D; | ||
|
||
let x = 1832891; | ||
let y = 5174952; | ||
let r = 1000; | ||
|
||
const extent = new itowns.Extent('EPSG:3946', x - r, x + r, y - r, y + r); | ||
const view = new View3D(); | ||
view.initItownsView(extent); | ||
|
||
const center = extent.center(); | ||
|
||
const image = document.createElement('img'); | ||
image.src = | ||
'https://lh3.googleusercontent.com/proxy/-V2q6dQpdGNZw6JMniNsnI1hTItamwP2cXIoQBZQAZhU-NYEXHC39lJd1qJYIcrg8gvrx3tGeyJiPsg6v1A_l4xhWUgZ7O1aRTF9vfZD3ZcmB5Z1qNw6BMikdxzL4UGMMsSk9PRjAXQ6pTiLi3I-7CeobzNbDZ2Nz4dbw4cAlQTAJmWvSj80IbAhjlnk'; | ||
view.appendCSS3D( | ||
image, | ||
{ width: 200, height: 500 }, | ||
new THREEUtils.Transform( | ||
new THREE.Vector3(center.x, center.y, 50), | ||
new THREE.Vector3(Math.PI * 0.5, Math.PI * 0.2, 0), | ||
new THREE.Vector3(2, 2, 2) | ||
) | ||
); | ||
|
||
const geometry = new THREE.SphereGeometry(100, 32, 32); | ||
const material = new THREE.MeshBasicMaterial({ color: 0xffff00 }); | ||
const sphere = new THREE.Mesh(geometry, material); | ||
sphere.position.copy(new THREE.Vector3(center.x + 200, center.y, 50)); | ||
sphere.updateMatrixWorld(); | ||
|
||
view.getItownsView().scene.add(sphere); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!-- @format --> | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>UD-Viz LocalGame Template example</title> | ||
|
||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
</head> | ||
<body> | ||
<script src="./assets/js/udv.js"></script> | ||
<!--the path point your bundle library--> | ||
<script type="text/javascript"> | ||
const myWorld = new udv.Game.Shared.World({ | ||
name: 'My World', | ||
origin: { lat: 45.7530993, lng: 4.8452654, alt: 300 }, | ||
gameObject: { | ||
name: 'GameManager', | ||
static: true, | ||
components: { | ||
WorldScript: { | ||
idScripts: ['worldGameManager'], | ||
}, | ||
LocalScript: { | ||
idScripts: ['focus', 'commands'], | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
const app = new udv.Templates.LocalGame(); | ||
app.start(myWorld, './assets/config/local_game_config.json'); | ||
</script> | ||
</body> | ||
</html> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"assetsManager": { | ||
"models": { | ||
"zeppelin": { | ||
"path": "./assets/models/Zeppelin_Labex_IMU.glb", | ||
"anchor": "center_min", | ||
"rotation": { "x": 0, "y": 1.5707, "z": 0 } | ||
} | ||
}, | ||
"worldScripts": { | ||
"worldGameManager": { | ||
"path": "./assets/worldScripts/worldGameManager.js" | ||
}, | ||
"zeppelin": { | ||
"path": "./assets/worldScripts/zeppelin.js" | ||
} | ||
}, | ||
"localScripts": { | ||
"focus": { | ||
"path": "./assets/localScripts/focus.js" | ||
}, | ||
"commands": { | ||
"path": "./assets/localScripts/commands.js" | ||
} | ||
} | ||
}, | ||
"game": { | ||
"fps": 30, | ||
"shadowMapSize": 2046, | ||
"skyColor": { | ||
"r": 0.4, | ||
"g": 0.6, | ||
"b": 0.8 | ||
} | ||
}, | ||
"itowns": { | ||
"radiusExtent": 1000, | ||
"camera": { | ||
"range": 3000, | ||
"heading": -50, | ||
"tilt": 10 | ||
} | ||
}, | ||
"3DTilesLayer": { | ||
"id": "3d-tiles-layer-building", | ||
"url": "./assets/lod_flying_campus/tileset.json", | ||
"color": "0xFFFFFF", | ||
"initTilesManager": "true" | ||
}, | ||
"projection": "EPSG:3946", | ||
"background_image_layer": { | ||
"url": "https://download.data.grandlyon.com/wms/grandlyon", | ||
"name": "Ortho2018_Dalle_unique_8cm_CC46", | ||
"version": "1.3.0", | ||
"format": "image/jpeg", | ||
"layer_name": "Base_Map", | ||
"transparent": true | ||
}, | ||
"elevation_layer": { | ||
"url": "https://download.data.grandlyon.com/wms/grandlyon", | ||
"name": "MNT2018_Altitude_2m", | ||
"format": "image/jpeg", | ||
"layer_name": "wms_elevation_test" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** @format */ | ||
|
||
let udviz; | ||
let Shared = null; | ||
|
||
module.exports = class Commands { | ||
constructor(conf, udvizBundle) { | ||
this.conf = conf; | ||
udviz = udvizBundle; | ||
Shared = udviz.Game.Shared; | ||
} | ||
|
||
init() { | ||
const localContext = arguments[1]; | ||
|
||
//Input manager of the game | ||
const inputManager = localContext.getGameView().getInputManager(); | ||
|
||
//FORWARD | ||
inputManager.addKeyCommand( | ||
Shared.Command.TYPE.MOVE_FORWARD, | ||
['z', 'ArrowUp'], | ||
function () { | ||
return new Shared.Command({ type: Shared.Command.TYPE.MOVE_FORWARD }); | ||
} | ||
); | ||
|
||
//BACKWARD | ||
inputManager.addKeyCommand( | ||
Shared.Command.TYPE.MOVE_BACKWARD, | ||
['s', 'ArrowDown'], | ||
function () { | ||
return new Shared.Command({ type: Shared.Command.TYPE.MOVE_BACKWARD }); | ||
} | ||
); | ||
|
||
//LEFT | ||
inputManager.addKeyCommand( | ||
Shared.Command.TYPE.MOVE_LEFT, | ||
['q', 'ArrowLeft'], | ||
function () { | ||
return new Shared.Command({ type: Shared.Command.TYPE.MOVE_LEFT }); | ||
} | ||
); | ||
|
||
//RIGHT | ||
inputManager.addKeyCommand( | ||
Shared.Command.TYPE.MOVE_RIGHT, | ||
['d', 'ArrowRight'], | ||
function () { | ||
return new Shared.Command({ type: Shared.Command.TYPE.MOVE_RIGHT }); | ||
} | ||
); | ||
} | ||
|
||
tick() { | ||
const localContext = arguments[1]; | ||
const worldComputer = localContext.getGameView().getStateComputer(); | ||
const inputManager = localContext.getGameView().getInputManager(); | ||
|
||
//send input manager command to the world | ||
worldComputer.onCommands(inputManager.computeCommands()); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/** @format */ | ||
|
||
let udviz = null; | ||
let Shared; | ||
|
||
//angle to inclinate the camera | ||
const CAMERA_ANGLE = Math.PI / 6; | ||
|
||
module.exports = class Focus { | ||
constructor(conf, udvizBundle) { | ||
this.conf = conf; | ||
udviz = udvizBundle; | ||
Shared = udviz.Game.Shared; | ||
|
||
//quaternion to place the camera | ||
this.quaternionCam = new Shared.THREE.Quaternion().setFromEuler( | ||
new Shared.THREE.Euler(Math.PI * 0.5, 0, 0) | ||
); | ||
this.quaternionAngle = new Shared.THREE.Quaternion().setFromEuler( | ||
new Shared.THREE.Euler(-CAMERA_ANGLE, 0, 0) | ||
); | ||
|
||
//initial distance of the camera with the zeppelin | ||
this.distance = 150; | ||
} | ||
|
||
init() { | ||
const _this = this; | ||
|
||
const localContext = arguments[1]; | ||
const gV = localContext.getGameView(); | ||
const manager = gV.getInputManager(); | ||
manager.addMouseInput(gV.html(), 'wheel', function (event) { | ||
_this.distance += event.wheelDelta * 0.1; | ||
_this.distance = Math.max(Math.min(_this.distance, 500), 0); | ||
}); | ||
} | ||
|
||
tick() { | ||
//the gameobject parent of this script | ||
const go = arguments[0]; | ||
|
||
//a context containing all data to script clientside script | ||
const localContext = arguments[1]; | ||
|
||
//get the zeppelin gameobject by name | ||
const zeppelin = go.computeRoot().findByName('zeppelin'); | ||
|
||
//compute world transform | ||
const obj = zeppelin.computeObject3D(); | ||
let position = new Shared.THREE.Vector3(); | ||
let quaternion = new Shared.THREE.Quaternion(); | ||
obj.matrixWorld.decompose(position, quaternion, new Shared.THREE.Vector3()); | ||
|
||
//move the position a bit up (z is up) | ||
position.z += 10; | ||
|
||
//compute camera position | ||
const dir = zeppelin | ||
.getDefaultForward() | ||
.applyQuaternion(this.quaternionAngle) | ||
.applyQuaternion(quaternion); | ||
|
||
position.sub(dir.setLength(this.distance)); | ||
quaternion.multiply(this.quaternionCam); | ||
quaternion.multiply(this.quaternionAngle); | ||
|
||
//tweak values in camera object | ||
const iV = localContext.getGameView().getItownsView(); | ||
iV.camera.camera3D.position.copy(position); | ||
iV.camera.camera3D.quaternion.copy(quaternion); | ||
iV.camera.camera3D.updateProjectionMatrix(); | ||
} | ||
}; |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.