|
@@ -78731,7 +78731,7 @@ var EffectFallbacks = /** @class */ (function () {
|
|
|
this._maxRank = rank;
|
|
|
}
|
|
|
};
|
|
|
- Object.defineProperty(EffectFallbacks.prototype, "isMoreFallbacks", {
|
|
|
+ Object.defineProperty(EffectFallbacks.prototype, "hasMoreFallbacks", {
|
|
|
/**
|
|
|
* Checks to see if more fallbacks are still availible.
|
|
|
*/
|
|
@@ -79355,7 +79355,7 @@ var Effect = /** @class */ (function () {
|
|
|
}
|
|
|
if (fallbacks) {
|
|
|
this._pipelineContext = null;
|
|
|
- if (fallbacks.isMoreFallbacks) {
|
|
|
+ if (fallbacks.hasMoreFallbacks) {
|
|
|
_Misc_logger__WEBPACK_IMPORTED_MODULE_3__["Logger"].Error("Trying next fallback.");
|
|
|
this.defines = fallbacks.reduce(this.defines, this);
|
|
|
this._prepareEffect();
|
|
@@ -154538,8 +154538,8 @@ var SpriteManager = /** @class */ (function () {
|
|
|
var max = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["Vector3"].Zero();
|
|
|
var distance = Number.MAX_VALUE;
|
|
|
var currentSprite = null;
|
|
|
- var pickedPoint = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["Vector3"].Zero();
|
|
|
- var cameraSpacePosition = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["Vector3"].Zero();
|
|
|
+ var pickedPoint = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["TmpVectors"].Vector3[0];
|
|
|
+ var cameraSpacePosition = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["TmpVectors"].Vector3[1];
|
|
|
var cameraView = camera.getViewMatrix();
|
|
|
for (var index = 0; index < count; index++) {
|
|
|
var sprite = this.sprites[index];
|
|
@@ -154575,7 +154575,7 @@ var SpriteManager = /** @class */ (function () {
|
|
|
result.pickedSprite = currentSprite;
|
|
|
result.distance = distance;
|
|
|
// Get picked point
|
|
|
- var direction = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["TmpVectors"].Vector3[0];
|
|
|
+ var direction = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["TmpVectors"].Vector3[2];
|
|
|
direction.copyFrom(ray.direction);
|
|
|
direction.normalize();
|
|
|
direction.scaleInPlace(distance);
|
|
@@ -154586,6 +154586,57 @@ var SpriteManager = /** @class */ (function () {
|
|
|
return null;
|
|
|
};
|
|
|
/**
|
|
|
+ * Intersects the sprites with a ray
|
|
|
+ * @param ray defines the ray to intersect with
|
|
|
+ * @param camera defines the current active camera
|
|
|
+ * @param predicate defines a predicate used to select candidate sprites
|
|
|
+ * @returns null if no hit or a PickingInfo array
|
|
|
+ */
|
|
|
+ SpriteManager.prototype.multiIntersects = function (ray, camera, predicate) {
|
|
|
+ var count = Math.min(this._capacity, this.sprites.length);
|
|
|
+ var min = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["Vector3"].Zero();
|
|
|
+ var max = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["Vector3"].Zero();
|
|
|
+ var distance;
|
|
|
+ var results = [];
|
|
|
+ var pickedPoint = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["TmpVectors"].Vector3[0].copyFromFloats(0, 0, 0);
|
|
|
+ var cameraSpacePosition = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["TmpVectors"].Vector3[1].copyFromFloats(0, 0, 0);
|
|
|
+ var cameraView = camera.getViewMatrix();
|
|
|
+ for (var index = 0; index < count; index++) {
|
|
|
+ var sprite = this.sprites[index];
|
|
|
+ if (!sprite) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (predicate) {
|
|
|
+ if (!predicate(sprite)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (!sprite.isPickable) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["Vector3"].TransformCoordinatesToRef(sprite.position, cameraView, cameraSpacePosition);
|
|
|
+ min.copyFromFloats(cameraSpacePosition.x - sprite.width / 2, cameraSpacePosition.y - sprite.height / 2, cameraSpacePosition.z);
|
|
|
+ max.copyFromFloats(cameraSpacePosition.x + sprite.width / 2, cameraSpacePosition.y + sprite.height / 2, cameraSpacePosition.z);
|
|
|
+ if (ray.intersectsBoxMinMax(min, max)) {
|
|
|
+ distance = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["Vector3"].Distance(cameraSpacePosition, ray.origin);
|
|
|
+ var result = new _Collisions_pickingInfo__WEBPACK_IMPORTED_MODULE_5__["PickingInfo"]();
|
|
|
+ results.push(result);
|
|
|
+ cameraView.invertToRef(_Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["TmpVectors"].Matrix[0]);
|
|
|
+ result.hit = true;
|
|
|
+ result.pickedSprite = sprite;
|
|
|
+ result.distance = distance;
|
|
|
+ // Get picked point
|
|
|
+ var direction = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["TmpVectors"].Vector3[2];
|
|
|
+ direction.copyFrom(ray.direction);
|
|
|
+ direction.normalize();
|
|
|
+ direction.scaleInPlace(distance);
|
|
|
+ ray.origin.addToRef(direction, pickedPoint);
|
|
|
+ result.pickedPoint = _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["Vector3"].TransformCoordinates(pickedPoint, _Maths_math_vector__WEBPACK_IMPORTED_MODULE_3__["TmpVectors"].Matrix[0]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return results;
|
|
|
+ };
|
|
|
+ /**
|
|
|
* Render all child sprites
|
|
|
*/
|
|
|
SpriteManager.prototype.render = function () {
|
|
@@ -154786,6 +154837,31 @@ _scene__WEBPACK_IMPORTED_MODULE_1__["Scene"].prototype._internalPickSprites = fu
|
|
|
}
|
|
|
return pickingInfo || new _Collisions_pickingInfo__WEBPACK_IMPORTED_MODULE_3__["PickingInfo"]();
|
|
|
};
|
|
|
+_scene__WEBPACK_IMPORTED_MODULE_1__["Scene"].prototype._internalMultiPickSprites = function (ray, predicate, camera) {
|
|
|
+ if (!_Collisions_pickingInfo__WEBPACK_IMPORTED_MODULE_3__["PickingInfo"]) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ var pickingInfos = new Array();
|
|
|
+ if (!camera) {
|
|
|
+ if (!this.activeCamera) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ camera = this.activeCamera;
|
|
|
+ }
|
|
|
+ if (this.spriteManagers.length > 0) {
|
|
|
+ for (var spriteIndex = 0; spriteIndex < this.spriteManagers.length; spriteIndex++) {
|
|
|
+ var spriteManager = this.spriteManagers[spriteIndex];
|
|
|
+ if (!spriteManager.isPickable) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ var results = spriteManager.multiIntersects(ray, camera, predicate);
|
|
|
+ if (results !== null) {
|
|
|
+ pickingInfos = pickingInfos.concat(results);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return pickingInfos;
|
|
|
+};
|
|
|
_scene__WEBPACK_IMPORTED_MODULE_1__["Scene"].prototype.pickSprite = function (x, y, predicate, fastCheck, camera) {
|
|
|
this.createPickingRayInCameraSpaceToRef(x, y, this._tempSpritePickingRay, camera);
|
|
|
return this._internalPickSprites(this._tempSpritePickingRay, predicate, fastCheck, camera);
|
|
@@ -154803,6 +154879,23 @@ _scene__WEBPACK_IMPORTED_MODULE_1__["Scene"].prototype.pickSpriteWithRay = funct
|
|
|
_Culling_ray__WEBPACK_IMPORTED_MODULE_2__["Ray"].TransformToRef(ray, camera.getViewMatrix(), this._tempSpritePickingRay);
|
|
|
return this._internalPickSprites(this._tempSpritePickingRay, predicate, fastCheck, camera);
|
|
|
};
|
|
|
+_scene__WEBPACK_IMPORTED_MODULE_1__["Scene"].prototype.multiPickSprite = function (x, y, predicate, camera) {
|
|
|
+ this.createPickingRayInCameraSpaceToRef(x, y, this._tempSpritePickingRay, camera);
|
|
|
+ return this._internalMultiPickSprites(this._tempSpritePickingRay, predicate, camera);
|
|
|
+};
|
|
|
+_scene__WEBPACK_IMPORTED_MODULE_1__["Scene"].prototype.multiPickSpriteWithRay = function (ray, predicate, camera) {
|
|
|
+ if (!this._tempSpritePickingRay) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (!camera) {
|
|
|
+ if (!this.activeCamera) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ camera = this.activeCamera;
|
|
|
+ }
|
|
|
+ _Culling_ray__WEBPACK_IMPORTED_MODULE_2__["Ray"].TransformToRef(ray, camera.getViewMatrix(), this._tempSpritePickingRay);
|
|
|
+ return this._internalMultiPickSprites(this._tempSpritePickingRay, predicate, camera);
|
|
|
+};
|
|
|
_scene__WEBPACK_IMPORTED_MODULE_1__["Scene"].prototype.setPointerOverSprite = function (sprite) {
|
|
|
if (this._pointerOverSprite === sprite) {
|
|
|
return;
|