@galacean/engine-physics-physx 0.9.1 → 0.9.2

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.
@@ -12989,6 +12989,7 @@ var rePropName = RegExp("[^.[\\]]+" + "|" + // Or match property names within br
12989
12989
  var SkinnedMeshRenderer = function SkinnedMeshRenderer(entity) {
12990
12990
  var _this;
12991
12991
  _this = MeshRenderer.call(this, entity) || this;
12992
+ _this._supportSkinning = false;
12992
12993
  _this._hasInitSkin = false;
12993
12994
  _this._jointDataCreateCache = new miniprogram$7.Vector2(-1, -1);
12994
12995
  _this._localBounds = new miniprogram$7.BoundingBox();
@@ -12998,7 +12999,7 @@ var rePropName = RegExp("[^.[\\]]+" + "|" + // Or match property names within br
12998
12999
  // Limit size to 256 to avoid some problem:
12999
13000
  // For renderer is "Apple GPU", when uniform is large than 256 the skeleton matrix array access in shader very slow in Safari or WKWebview. This may be a apple bug, Chrome and Firefox is OK!
13000
13001
  // For renderer is "ANGLE (AMD, AMD Radeon(TM) Graphics Direct3011 vs_5_0 ps_5_0, D3011)", compile shader si very slow because of max uniform is 4096.
13001
- maxVertexUniformVectors = Math.min(maxVertexUniformVectors, 256);
13002
+ maxVertexUniformVectors = Math.min(maxVertexUniformVectors, rhi._options._maxAllowSkinUniformVectorCount);
13002
13003
  _this._maxVertexUniformVectors = maxVertexUniformVectors;
13003
13004
  _this._onLocalBoundsChanged = _this._onLocalBoundsChanged.bind(_assert_this_initialized(_this));
13004
13005
  var localBounds = _this._localBounds;
@@ -13017,9 +13018,8 @@ var rePropName = RegExp("[^.[\\]]+" + "|" + // Or match property names within br
13017
13018
  this._initSkin();
13018
13019
  this._hasInitSkin = true;
13019
13020
  }
13020
- var skin = this._skin;
13021
- if (skin) {
13022
- var ibms = skin.inverseBindMatrices;
13021
+ if (this._supportSkinning) {
13022
+ var ibms = this._skin.inverseBindMatrices;
13023
13023
  var worldToLocal = this._rootBone.getInvModelMatrix();
13024
13024
  var _this = this, joints = _this._jointEntities, jointMatrices = _this._jointMatrices;
13025
13025
  for(var i = joints.length - 1; i >= 0; i--){
@@ -13038,8 +13038,6 @@ var rePropName = RegExp("[^.[\\]]+" + "|" + // Or match property names within br
13038
13038
  * @override
13039
13039
  */ _proto._updateShaderData = function _updateShaderData(context) {
13040
13040
  var entity = this.entity;
13041
- var worldMatrix = this._rootBone ? this._rootBone.transform.worldMatrix : entity.transform.worldMatrix;
13042
- this._updateTransformShaderData(context, worldMatrix);
13043
13041
  var shaderData = this.shaderData;
13044
13042
  var mesh = this.mesh;
13045
13043
  var blendShapeManager = mesh._blendShapeManager;
@@ -13066,12 +13064,18 @@ var rePropName = RegExp("[^.[\\]]+" + "|" + // Or match property names within br
13066
13064
  shaderData.disableMacro("O3_JOINTS_NUM");
13067
13065
  shaderData.enableMacro("O3_USE_JOINT_TEXTURE");
13068
13066
  shaderData.setTexture(SkinnedMeshRenderer._jointSamplerProperty, this._jointTexture);
13067
+ this._supportSkinning = true;
13069
13068
  } else {
13070
- Logger.error("component's joints count(" + jointCount + ") greater than device's MAX_VERTEX_UNIFORM_VECTORS number " + this._maxVertexUniformVectors + ", and don't support jointTexture in this device. suggest joint count less than " + remainUniformJointCount + ".", this);
13069
+ var _this__jointTexture1;
13070
+ this._supportSkinning = false;
13071
+ (_this__jointTexture1 = this._jointTexture) == null ? void 0 : _this__jointTexture1.destroy();
13072
+ shaderData.disableMacro("O3_HAS_SKIN");
13073
+ Logger.warn("component's joints count(" + jointCount + ") greater than device's MAX_VERTEX_UNIFORM_VECTORS number " + this._maxVertexUniformVectors + ", and don't support jointTexture in this device. suggest joint count less than " + remainUniformJointCount + ".", this);
13071
13074
  }
13072
13075
  } else {
13073
- var _this__jointTexture1;
13074
- (_this__jointTexture1 = this._jointTexture) == null ? void 0 : _this__jointTexture1.destroy();
13076
+ var _this__jointTexture2;
13077
+ this._supportSkinning = true;
13078
+ (_this__jointTexture2 = this._jointTexture) == null ? void 0 : _this__jointTexture2.destroy();
13075
13079
  shaderData.disableMacro("O3_USE_JOINT_TEXTURE");
13076
13080
  shaderData.enableMacro("O3_JOINTS_NUM", remainUniformJointCount.toString());
13077
13081
  shaderData.setFloatArray(SkinnedMeshRenderer._jointMatrixProperty, this._jointMatrices);
@@ -13082,6 +13086,8 @@ var rePropName = RegExp("[^.[\\]]+" + "|" + // Or match property names within br
13082
13086
  this._jointTexture.setPixelBuffer(this._jointMatrices);
13083
13087
  }
13084
13088
  }
13089
+ var worldMatrix = this._supportSkinning && this._rootBone ? this._rootBone.transform.worldMatrix : entity.transform.worldMatrix;
13090
+ this._updateTransformShaderData(context, worldMatrix);
13085
13091
  var layer = entity.layer;
13086
13092
  this._rendererLayer.set(layer & 65535, layer >>> 16 & 65535, 0, 0);
13087
13093
  };
@@ -13276,6 +13282,9 @@ var rePropName = RegExp("[^.[\\]]+" + "|" + // Or match property names within br
13276
13282
  (function() {
13277
13283
  SkinnedMeshRenderer._jointMatrixProperty = Shader.getPropertyByName("u_jointMatrix");
13278
13284
  })();
13285
+ __decorate$1([
13286
+ ignoreClone
13287
+ ], SkinnedMeshRenderer.prototype, "_supportSkinning", void 0);
13279
13288
  __decorate$1([
13280
13289
  ignoreClone
13281
13290
  ], SkinnedMeshRenderer.prototype, "_hasInitSkin", void 0);
@@ -35339,7 +35348,8 @@ exports.WebGLMode = void 0;
35339
35348
  webGLMode: 0,
35340
35349
  alpha: false,
35341
35350
  stencil: true,
35342
- _forceFlush: false
35351
+ _forceFlush: false,
35352
+ _maxAllowSkinUniformVectorCount: 256
35343
35353
  }, initializeOptions);
35344
35354
  if (miniprogram$1$1.SystemInfo.platform === miniprogram$1$1.Platform.IPhone || miniprogram$1$1.SystemInfo.platform === miniprogram$1$1.Platform.IPad) {
35345
35355
  var version = miniprogram$1$1.SystemInfo.operatingSystem.match(/(\d+).?(\d+)?.?(\d+)?/);
@@ -35644,7 +35654,7 @@ function _interopNamespace(e) {
35644
35654
  }
35645
35655
  var CoreObjects__namespace = /*#__PURE__*/ _interopNamespace(CoreObjects);
35646
35656
  //@ts-ignore
35647
- var version = "0.9.1";
35657
+ var version = "0.9.2";
35648
35658
  console.log("Galacean engine version: " + version);
35649
35659
  for(var key in CoreObjects__namespace){
35650
35660
  CoreObjects.Loader.registerClass(key, CoreObjects__namespace[key]);