@galacean/engine-core 1.0.0-beta.19 → 1.0.0-beta.20
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.
- package/dist/main.js +32 -27
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +32 -27
- package/dist/module.js +32 -27
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/physics/PhysicsManager.d.ts +4 -2
package/dist/main.js
CHANGED
|
@@ -375,33 +375,28 @@ function _inherits(subClass, superClass) {
|
|
|
375
375
|
return Color;
|
|
376
376
|
}();
|
|
377
377
|
|
|
378
|
-
/******************************************************************************
|
|
379
|
-
Copyright (c) Microsoft Corporation.
|
|
380
|
-
|
|
381
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
382
|
-
purpose with or without fee is hereby granted.
|
|
383
|
-
|
|
384
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
385
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
386
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
387
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
388
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
389
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
390
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
391
|
-
***************************************************************************** */
|
|
392
|
-
|
|
393
|
-
function __decorate(decorators, target, key, desc) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
378
|
+
/******************************************************************************
|
|
379
|
+
Copyright (c) Microsoft Corporation.
|
|
380
|
+
|
|
381
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
382
|
+
purpose with or without fee is hereby granted.
|
|
383
|
+
|
|
384
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
385
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
386
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
387
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
388
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
389
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
390
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
391
|
+
***************************************************************************** */
|
|
392
|
+
|
|
393
|
+
function __decorate(decorators, target, key, desc) {
|
|
394
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
395
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
396
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
397
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
401
|
-
var e = new Error(message);
|
|
402
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
403
|
-
};
|
|
404
|
-
|
|
405
400
|
function _instanceof(left, right) {
|
|
406
401
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
407
402
|
return !!right[Symbol.hasInstance](left);
|
|
@@ -5665,6 +5660,7 @@ var Collision = function Collision() {
|
|
|
5665
5660
|
var _this = this;
|
|
5666
5661
|
/** @internal */ this._initialized = false;
|
|
5667
5662
|
this._restTime = 0;
|
|
5663
|
+
this._fixedTimeStep = 1 / 60;
|
|
5668
5664
|
this._colliders = new DisorderedArray();
|
|
5669
5665
|
this._gravity = new engineMath.Vector3(0, -9.81, 0);
|
|
5670
5666
|
this._physicalObjectsMap = {};
|
|
@@ -5776,7 +5772,6 @@ var Collision = function Collision() {
|
|
|
5776
5772
|
script1._waitHandlingInValid || script1.onTriggerStay(shape1);
|
|
5777
5773
|
}
|
|
5778
5774
|
};
|
|
5779
|
-
/** The fixed time step in seconds at which physics are performed. */ this.fixedTimeStep = 1 / 60;
|
|
5780
5775
|
this._engine = engine;
|
|
5781
5776
|
this._setGravity = this._setGravity.bind(this);
|
|
5782
5777
|
//@ts-ignore
|
|
@@ -5836,7 +5831,7 @@ var Collision = function Collision() {
|
|
|
5836
5831
|
* Call on every frame to update pose of objects.
|
|
5837
5832
|
* @internal
|
|
5838
5833
|
*/ _proto._update = function _update(deltaTime) {
|
|
5839
|
-
var _this = this, fixedTimeStep = _this.
|
|
5834
|
+
var _this = this, fixedTimeStep = _this._fixedTimeStep, nativePhysicsManager = _this._nativePhysicsManager;
|
|
5840
5835
|
var componentsManager = this._engine._componentsManager;
|
|
5841
5836
|
var simulateTime = this._restTime + deltaTime;
|
|
5842
5837
|
var step = Math.floor(simulateTime / fixedTimeStep);
|
|
@@ -5944,6 +5939,15 @@ var Collision = function Collision() {
|
|
|
5944
5939
|
gravity.copyFrom(value);
|
|
5945
5940
|
}
|
|
5946
5941
|
}
|
|
5942
|
+
},
|
|
5943
|
+
{
|
|
5944
|
+
key: "fixedTimeStep",
|
|
5945
|
+
get: /** The fixed time step in seconds at which physics are performed. */ function get() {
|
|
5946
|
+
return this._fixedTimeStep;
|
|
5947
|
+
},
|
|
5948
|
+
set: function set(value) {
|
|
5949
|
+
this._fixedTimeStep = Math.max(value, engineMath.MathUtil.zeroTolerance);
|
|
5950
|
+
}
|
|
5947
5951
|
}
|
|
5948
5952
|
]);
|
|
5949
5953
|
return PhysicsManager;
|
|
@@ -9536,6 +9540,7 @@ __decorate([
|
|
|
9536
9540
|
CloneManager.deepCloneObject(this.renderStates, target.renderStates);
|
|
9537
9541
|
};
|
|
9538
9542
|
_proto._addReferCount = function _addReferCount(value) {
|
|
9543
|
+
if (this._destroyed) return;
|
|
9539
9544
|
ReferResource.prototype._addReferCount.call(this, value);
|
|
9540
9545
|
this.shaderData._addReferCount(value);
|
|
9541
9546
|
};
|