stub in focal point visualization
This commit is contained in:
parent
169d923cb3
commit
f07bb60fdc
1 changed files with 31 additions and 2 deletions
|
|
@ -36,11 +36,12 @@ gapp.register("moto.space", [], (root, exports) => {
|
||||||
alignedTracking = false,
|
alignedTracking = false,
|
||||||
skyAmbient,
|
skyAmbient,
|
||||||
skyGridColor = 0xcccccc,
|
skyGridColor = 0xcccccc,
|
||||||
skyMaterial = undefined,
|
|
||||||
skyGridMaterial = undefined,
|
skyGridMaterial = undefined,
|
||||||
showSkyGrid = false,
|
showSkyGrid = false,
|
||||||
showPlatform = true,
|
showPlatform = true,
|
||||||
hidePlatformBelow = true,
|
hidePlatformBelow = true,
|
||||||
|
showFocus = 0,
|
||||||
|
focalPoint = undefined,
|
||||||
origin = {x:0, y:0, z: 0},
|
origin = {x:0, y:0, z: 0},
|
||||||
trackcam = addLight(0, 0, 0, lightIntensity),
|
trackcam = addLight(0, 0, 0, lightIntensity),
|
||||||
trackDelta = {x:0, y:0, z:0},
|
trackDelta = {x:0, y:0, z:0},
|
||||||
|
|
@ -947,6 +948,25 @@ gapp.register("moto.space", [], (root, exports) => {
|
||||||
* Space Object
|
* Space Object
|
||||||
******************************************************************* */
|
******************************************************************* */
|
||||||
|
|
||||||
|
function updateFocus() {
|
||||||
|
if (focalPoint) {
|
||||||
|
Space.scene.remove(focalPoint);
|
||||||
|
}
|
||||||
|
if (showFocus) {
|
||||||
|
let mesh = focalPoint = new THREE.Mesh(
|
||||||
|
new THREE.SphereGeometry(1, 16, 16),
|
||||||
|
new THREE.MeshPhongMaterial({
|
||||||
|
side: THREE.DoubleSide,
|
||||||
|
specular: 0x202020,
|
||||||
|
color: 0xff0000,
|
||||||
|
shininess: 125
|
||||||
|
})
|
||||||
|
);
|
||||||
|
Space.scene.add(mesh);
|
||||||
|
mesh.position.copy(viewControl.target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setSky(opt = {}) {
|
function setSky(opt = {}) {
|
||||||
let { grid, color, gridColor } = opt;
|
let { grid, color, gridColor } = opt;
|
||||||
if (grid) Space.sky.showGrid(grid);
|
if (grid) Space.sky.showGrid(grid);
|
||||||
|
|
@ -1147,7 +1167,15 @@ gapp.register("moto.space", [], (root, exports) => {
|
||||||
getFPS () { return fps },
|
getFPS () { return fps },
|
||||||
getRMS() { return renderTime },
|
getRMS() { return renderTime },
|
||||||
getFocus() { return viewControl.getTarget() },
|
getFocus() { return viewControl.getTarget() },
|
||||||
setFocus(v) { viewControl.setTarget(v); refresh() },
|
setFocus(v) {
|
||||||
|
viewControl.setTarget(v);
|
||||||
|
updateFocus();
|
||||||
|
refresh()
|
||||||
|
},
|
||||||
|
showFocus(ms) {
|
||||||
|
showFocus = ms;
|
||||||
|
updateFocus();
|
||||||
|
},
|
||||||
setHome(r,u) {
|
setHome(r,u) {
|
||||||
home = r || 0;
|
home = r || 0;
|
||||||
up = u || PI4;
|
up = u || PI4;
|
||||||
|
|
@ -1256,6 +1284,7 @@ gapp.register("moto.space", [], (root, exports) => {
|
||||||
Space.scene.updateFog();
|
Space.scene.updateFog();
|
||||||
}
|
}
|
||||||
updateLastAction();
|
updateLastAction();
|
||||||
|
updateFocus();
|
||||||
}, (val) => {
|
}, (val) => {
|
||||||
updateLastAction();
|
updateLastAction();
|
||||||
if (slider) slider(val);
|
if (slider) slider(val);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue