@xeokit/xeokit-sdk 2.4.0-alpha-68 → 2.4.0-alpha-69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18879,7 +18879,7 @@ class Perspective extends Component {
18879
18879
 
18880
18880
  const WIDTH_INDEX = 2;
18881
18881
  const HEIGHT_INDEX = 3;
18882
- const boundary = this.scene.viewport.boundary;
18882
+ const boundary = this.scene.canvas.boundary;
18883
18883
  const aspect = boundary[WIDTH_INDEX] / boundary[HEIGHT_INDEX];
18884
18884
  const fovAxis = this._fovAxis;
18885
18885
 
@@ -19181,7 +19181,7 @@ class Ortho extends Component {
19181
19181
  const scale = this._scale;
19182
19182
  const halfSize = 0.5 * scale;
19183
19183
 
19184
- const boundary = scene.viewport.boundary;
19184
+ const boundary = scene.canvas.boundary;
19185
19185
  const boundaryWidth = boundary[WIDTH_INDEX];
19186
19186
  const boundaryHeight = boundary[HEIGHT_INDEX];
19187
19187
  const aspect = boundaryWidth / boundaryHeight;
@@ -18875,7 +18875,7 @@ class Perspective extends Component {
18875
18875
 
18876
18876
  const WIDTH_INDEX = 2;
18877
18877
  const HEIGHT_INDEX = 3;
18878
- const boundary = this.scene.viewport.boundary;
18878
+ const boundary = this.scene.canvas.boundary;
18879
18879
  const aspect = boundary[WIDTH_INDEX] / boundary[HEIGHT_INDEX];
18880
18880
  const fovAxis = this._fovAxis;
18881
18881
 
@@ -19177,7 +19177,7 @@ class Ortho extends Component {
19177
19177
  const scale = this._scale;
19178
19178
  const halfSize = 0.5 * scale;
19179
19179
 
19180
- const boundary = scene.viewport.boundary;
19180
+ const boundary = scene.canvas.boundary;
19181
19181
  const boundaryWidth = boundary[WIDTH_INDEX];
19182
19182
  const boundaryHeight = boundary[HEIGHT_INDEX];
19183
19183
  const aspect = boundaryWidth / boundaryHeight;
@@ -4923,7 +4923,7 @@ var tolerance=2;this.on("mousedown",function(params){downX=params[0];downY=param
4923
4923
  */_this29.camera=camera;_this29._state=new RenderState({matrix:math.mat4(),inverseMatrix:math.mat4(),transposedMatrix:math.mat4(),near:0.1,far:2000.0});_this29._inverseMatrixDirty=true;_this29._transposedMatrixDirty=true;_this29._fov=60.0;// Recompute aspect from change in canvas size
4924
4924
  _this29._canvasResized=_this29.scene.canvas.on("boundary",_this29._needUpdate,_assertThisInitialized(_this29));_this29.fov=cfg.fov;_this29.fovAxis=cfg.fovAxis;_this29.near=cfg.near;_this29.far=cfg.far;return _this29;}_createClass(Perspective,[{key:"type",get:/**
4925
4925
  @private
4926
- */function get(){return"Perspective";}},{key:"_update",value:function _update(){var WIDTH_INDEX=2;var HEIGHT_INDEX=3;var boundary=this.scene.viewport.boundary;var aspect=boundary[WIDTH_INDEX]/boundary[HEIGHT_INDEX];var fovAxis=this._fovAxis;var fov=this._fov;if(fovAxis==="x"||fovAxis==="min"&&aspect<1||fovAxis==="max"&&aspect>1){fov=fov/aspect;}fov=Math.min(fov,120);math.perspectiveMat4(fov*(Math.PI/180.0),aspect,this._state.near,this._state.far,this._state.matrix);this._inverseMatrixDirty=true;this._transposedMatrixDirty=true;this.glRedraw();this.camera._updateScheduled=true;this.fire("matrix",this._state.matrix);}/**
4926
+ */function get(){return"Perspective";}},{key:"_update",value:function _update(){var WIDTH_INDEX=2;var HEIGHT_INDEX=3;var boundary=this.scene.canvas.boundary;var aspect=boundary[WIDTH_INDEX]/boundary[HEIGHT_INDEX];var fovAxis=this._fovAxis;var fov=this._fov;if(fovAxis==="x"||fovAxis==="min"&&aspect<1||fovAxis==="max"&&aspect>1){fov=fov/aspect;}fov=Math.min(fov,120);math.perspectiveMat4(fov*(Math.PI/180.0),aspect,this._state.near,this._state.far,this._state.matrix);this._inverseMatrixDirty=true;this._transposedMatrixDirty=true;this.glRedraw();this.camera._updateScheduled=true;this.fire("matrix",this._state.matrix);}/**
4927
4927
  * Sets the Perspective's field-of-view angle (FOV).
4928
4928
  *
4929
4929
  * Fires an "fov" event on change.
@@ -5032,7 +5032,7 @@ this.fire("far",this._state.far);}},{key:"matrix",get:function get(){if(this._up
5032
5032
  * @final
5033
5033
  */_this30.camera=camera;_this30._state=new RenderState({matrix:math.mat4(),inverseMatrix:math.mat4(),transposedMatrix:math.mat4(),near:0.1,far:2000.0});_this30._inverseMatrixDirty=true;_this30._transposedMatrixDirty=true;_this30.scale=cfg.scale;_this30.near=cfg.near;_this30.far=cfg.far;_this30._onCanvasBoundary=_this30.scene.canvas.on("boundary",_this30._needUpdate,_assertThisInitialized(_this30));return _this30;}_createClass(Ortho,[{key:"type",get:/**
5034
5034
  @private
5035
- */function get(){return"Ortho";}},{key:"_update",value:function _update(){var WIDTH_INDEX=2;var HEIGHT_INDEX=3;var scene=this.scene;var scale=this._scale;var halfSize=0.5*scale;var boundary=scene.viewport.boundary;var boundaryWidth=boundary[WIDTH_INDEX];var boundaryHeight=boundary[HEIGHT_INDEX];var aspect=boundaryWidth/boundaryHeight;var left;var right;var top;var bottom;if(boundaryWidth>boundaryHeight){left=-halfSize;right=halfSize;top=halfSize/aspect;bottom=-halfSize/aspect;}else{left=-halfSize*aspect;right=halfSize*aspect;top=halfSize;bottom=-halfSize;}math.orthoMat4c(left,right,bottom,top,this._state.near,this._state.far,this._state.matrix);this._inverseMatrixDirty=true;this._transposedMatrixDirty=true;this.glRedraw();this.fire("matrix",this._state.matrix);}/**
5035
+ */function get(){return"Ortho";}},{key:"_update",value:function _update(){var WIDTH_INDEX=2;var HEIGHT_INDEX=3;var scene=this.scene;var scale=this._scale;var halfSize=0.5*scale;var boundary=scene.canvas.boundary;var boundaryWidth=boundary[WIDTH_INDEX];var boundaryHeight=boundary[HEIGHT_INDEX];var aspect=boundaryWidth/boundaryHeight;var left;var right;var top;var bottom;if(boundaryWidth>boundaryHeight){left=-halfSize;right=halfSize;top=halfSize/aspect;bottom=-halfSize/aspect;}else{left=-halfSize*aspect;right=halfSize*aspect;top=halfSize;bottom=-halfSize;}math.orthoMat4c(left,right,bottom,top,this._state.near,this._state.far,this._state.matrix);this._inverseMatrixDirty=true;this._transposedMatrixDirty=true;this.glRedraw();this.fire("matrix",this._state.matrix);}/**
5036
5036
  * Sets scale factor for this Ortho's extents on X and Y axis.
5037
5037
  *
5038
5038
  * Clamps to minimum value of ````0.01```.