@xtctwins/tctwins-core 1.1.4 → 1.1.6

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.
@@ -4307,10 +4307,21 @@ this.canvas.removeEventListener("webglcontextlost",this._webglcontextlostListene
4307
4307
  * Picked World-space point.
4308
4308
  * @property worldPos
4309
4309
  * @type {Number[]}
4310
- */},{key:"worldPos",get:function get(){return this._gotWorldPos?this._worldPos:null;}/**
4310
+ */},{key:"worldPos",get:function get(){var _this$_worldPos;// return this._gotWorldPos ? this._worldPos : null;
4311
+ return(_this$_worldPos=this._worldPos)!==null&&_this$_worldPos!==void 0?_this$_worldPos:null;}/**
4311
4312
  * @private
4312
4313
  * @param value
4313
- */,set:function set(value){if(value){this._worldPos[0]=value[0];this._worldPos[1]=value[1];this._worldPos[2]=value[2];this._gotWorldPos=true;}else{this._gotWorldPos=false;}}/**
4314
+ */,set:function set(value){if(value){this._worldPos[0]=value[0];this._worldPos[1]=value[1];this._worldPos[2]=value[2];/**
4315
+ * todo: 这里的延迟是为了解决未知pickresult.worldPos获取不到的问题
4316
+ * 因为reset被调用了,_gotWorldPos被置为false,所以加个延迟让它在reset之后再变为true
4317
+ *
4318
+ * @issue 但是后来发现加了延迟也不行,还是获取不到,怀疑是别的地方的问题,所以先注释掉了
4319
+ */ // this._gotWorldPos = true;
4320
+ // setTimeout(() => {
4321
+ // console.log(50)
4322
+ // this._gotWorldPos = true;
4323
+ // }, 50);
4324
+ }}/**
4314
4325
  * Picked View-space point.
4315
4326
  * @property viewPos
4316
4327
  * @type {Number[]}
@@ -4343,7 +4354,8 @@ this.canvas.removeEventListener("webglcontextlost",this._webglcontextlostListene
4343
4354
  * @returns {boolean}
4344
4355
  */},{key:"snapped",get:function get(){return this.snappedToEdge||this.snappedToVertex;}/**
4345
4356
  * @private
4346
- */},{key:"reset",value:function reset(){this.entity=null;this.primIndex=-1;this.primitive=null;this.pickSurfacePrecision=false;this._gotCanvasPos=false;this._gotSnappedCanvasPos=false;this._gotOrigin=false;this._gotDirection=false;this._gotIndices=false;this._gotLocalPos=false;this._gotWorldPos=false;this._gotViewPos=false;this._gotBary=false;this._gotWorldNormal=false;this._gotUV=false;this.touchInput=false;this.snappedToEdge=false;this.snappedToVertex=false;}}]);}();/**
4357
+ */},{key:"reset",value:function reset(){this.entity=null;this.primIndex=-1;this.primitive=null;this.pickSurfacePrecision=false;this._gotCanvasPos=false;this._gotSnappedCanvasPos=false;this._gotOrigin=false;this._gotDirection=false;this._gotIndices=false;this._gotLocalPos=false;// this._gotWorldPos = false;
4358
+ this._gotViewPos=false;this._gotBary=false;this._gotWorldNormal=false;this._gotUV=false;this.touchInput=false;this.snappedToEdge=false;this.snappedToVertex=false;}}]);}();/**
4347
4359
  * @desc Represents a vertex or fragment stage within a {@link Program}.
4348
4360
  * @private
4349
4361
  */var Shader=/*#__PURE__*/function(){function Shader(gl,type,source){_classCallCheck(this,Shader);this.allocated=false;this.compiled=false;this.handle=gl.createShader(type);if(!this.handle){this.errors=["Failed to allocate"];return;}this.allocated=true;gl.shaderSource(this.handle,source);gl.compileShader(this.handle);this.compiled=gl.getShaderParameter(this.handle,gl.COMPILE_STATUS);if(!this.compiled){if(!gl.isContextLost()){// Handled explicitly elsewhere, so won't re-handle here