Babylon.js 构建 地球,支持切片地图 (二)

首先babylonjs 相机我们要改造

对于相机改造类图如下

针对EarthCamera类

  • const BABYLON = require('babylonjs');
  •  
  • export class EarthCamera extends BABYLON.ArcRotateCamera {
  • constructor(e, t, i, n, r, o, s) {
  • super(e, t, i, n, r, o),
  • this.isDirty = true,
  • this.diffAlpha = 0,
  • this.diffBeta = 0,
  • this.diffRadius = 0,
  • this.latLonAtmouse = new BABYLON.Vector2
  • }
  • }

针对CameraControl
```javascript

posted @ 2022-01-21 09:29  haibalai  阅读(179)  评论(0编辑  收藏  举报