mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 08:42:21 +00:00
Load the Cesium SDK and its widget styles only when a Cesium globe first starts
This commit is contained in:
1 parent
9f8381ff71
commit
ae13a56f6d
27 files changed
+269
-124
No files matched your search
@@ -8,12 +8,12 @@
|
||||
import * as Cesium from 'cesium';
|
||||
import { createMoverRegistry } from '../movers.js';
|
||||
|
||||
const scratchPosition = new Cesium.Cartesian3();
|
||||
const scratchColor = new Cesium.Color();
|
||||
const scratchQuaternion = new Cesium.Quaternion();
|
||||
const scratchRotation = new Cesium.Matrix3();
|
||||
let scratchPosition;
|
||||
let scratchColor;
|
||||
let scratchQuaternion;
|
||||
let scratchRotation;
|
||||
// Model.modelMatrix and Model.color copy what they are given.
|
||||
const scratchModelMatrix = new Cesium.Matrix4();
|
||||
let scratchModelMatrix;
|
||||
|
||||
/** The atlas cells as canvases, by key (a DOM canvas or image source). */
|
||||
async function cropAtlasCells(atlas, keys) {
|
||||
@@ -287,6 +287,11 @@ export function createCesiumMovers(
|
||||
viewer,
|
||||
{ requestRender = () => viewer.scene.requestRender(), factories = {} } = {},
|
||||
) {
|
||||
scratchPosition ??= new Cesium.Cartesian3();
|
||||
scratchColor ??= new Cesium.Color();
|
||||
scratchQuaternion ??= new Cesium.Quaternion();
|
||||
scratchRotation ??= new Cesium.Matrix3();
|
||||
scratchModelMatrix ??= new Cesium.Matrix4();
|
||||
const make = { ...DEFAULT_FACTORIES, ...factories };
|
||||
const { scene } = viewer;
|
||||
let root = null;
|
||||
|
||||
Reference in new issue
Block a user