Hello,
i just cleaning a project and porting it to es6 synthax and I am getting an exception
Uncaught TypeError: i is undefined in the createPickingRayInCameraSpaceToRef function.
the relevant code in the project is
this._scene.onPointerObservable.add((evt)=>this.onPointer(evt));
onPointer(pointerInfo){
let evt = pointerInfo.event;
switch (pointerInfo.type) {
case BABYLON.PointerEventTypes.POINTERUP:
this.onClick(evt);
break;
}
};
onClick(pointerEvt) {
let xPos = this._scene.pointerX;
let yPos = this._scene.pointerY;
let pickResult = this._scene.pick(xPos, yPos);
if (pickResult.hit){
let pickedPoint = pickResult.pickedPoint;
let originalPosition = new BABYLON.Vector3(pickedPoint.x, pickedPoint.y, pickedPoint.z);
pickResult = this._scene.pickSprite(xPos, yPos);
}
}
the exception happens when calling the this._scene.pickSprite function.
Any ideas?