mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Open the cockpit on a tracked Navara aircraft
This commit is contained in:
1 parent
8b179a7e01
commit
2087b55b47
19 files changed
+142
-65
No files matched your search
@@ -63,11 +63,14 @@ import {
|
||||
import { onKeyDown } from './cockpitInput.js';
|
||||
import * as geo from '../geo/index.js';
|
||||
|
||||
import { cockpitHost } from './cockpitHost.js';
|
||||
|
||||
export class CockpitViewController {
|
||||
constructor(
|
||||
viewer,
|
||||
{
|
||||
services,
|
||||
engine = null,
|
||||
onVisionChange = null,
|
||||
getInitialVisionMode = null,
|
||||
onCameraTakeover = null,
|
||||
@@ -79,7 +82,7 @@ export class CockpitViewController {
|
||||
publish = {},
|
||||
} = {},
|
||||
) {
|
||||
this.viewer = viewer;
|
||||
this.host = cockpitHost(viewer, engine);
|
||||
this.services = services;
|
||||
this.destroyed = false;
|
||||
this.disposed = false;
|
||||
@@ -198,8 +201,8 @@ export class CockpitViewController {
|
||||
// from preRender makes 3D Tiles discover a new view after traversal and can
|
||||
// create a self-sustaining refinement loop under a moving cockpit camera.
|
||||
this._listenerRemovers.push(
|
||||
viewer.scene.preUpdate.addEventListener(() => this.update()),
|
||||
viewer.trackedEntityChanged.addEventListener(() => {
|
||||
this.host.preUpdate.addEventListener(() => this.update()),
|
||||
this.host.followChanged.addEventListener(() => {
|
||||
if (this.active) this._adoptTrackedEntity(performance.now());
|
||||
else this.syncEntry();
|
||||
}),
|
||||
|
||||
Reference in new issue
Block a user