@galacean/engine-physics-lite 0.9.0 → 1.0.0-beta.0

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/module.js CHANGED
@@ -1,26 +1,4 @@
1
- import { Ray, Vector3, Matrix, Quaternion, MathUtil, BoundingBox, BoundingSphere, CollisionUtil } from '@galacean/engine';
2
-
3
- /******************************************************************************
4
- Copyright (c) Microsoft Corporation.
5
-
6
- Permission to use, copy, modify, and/or distribute this software for any
7
- purpose with or without fee is hereby granted.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
- PERFORMANCE OF THIS SOFTWARE.
16
- ***************************************************************************** */
17
-
18
- function __decorate(decorators, target, key, desc) {
19
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
- 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;
22
- return c > 3 && r && Object.defineProperty(target, key, r), r;
23
- }
1
+ import { Utils, Ray, Vector3, Matrix, Quaternion, MathUtil, BoundingBox, BoundingSphere, CollisionUtil } from '@galacean/engine';
24
2
 
25
3
  function _set_prototype_of(o, p) {
26
4
  _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
@@ -66,22 +44,6 @@ function _instanceof(left, right) {
66
44
  } else return left instanceof right;
67
45
  }
68
46
 
69
- /**
70
- * Fastly remove an element from array.
71
- * @param array - Array
72
- * @param item - Element
73
- */ function removeFromArray(array, item) {
74
- var index = array.indexOf(item);
75
- if (index < 0) {
76
- return false;
77
- }
78
- var last = array.length - 1;
79
- if (index !== last) {
80
- array[index] = array[last];
81
- }
82
- array.length--;
83
- return true;
84
- }
85
47
  /**
86
48
  * Used to update tags.
87
49
  */ var LiteUpdateFlag = /*#__PURE__*/ function() {
@@ -95,7 +57,7 @@ function _instanceof(left, right) {
95
57
  /**
96
58
  * Destroy.
97
59
  */ _proto.destroy = function destroy() {
98
- removeFromArray(this._flags, this);
60
+ Utils.removeFromArray(this._flags, this);
99
61
  this._flags = null;
100
62
  };
101
63
  return LiteUpdateFlag;
@@ -1186,81 +1148,76 @@ var /**
1186
1148
  return LiteStaticCollider;
1187
1149
  }(LiteCollider);
1188
1150
 
1189
- /**
1190
- * Static interface implement decorator.
1191
- * https://stackoverflow.com/questions/13955157/how-to-define-static-property-in-typescript-interface
1192
- */ function StaticInterfaceImplement() {
1193
- return function(constructor) {
1194
- };
1195
- }
1196
-
1197
1151
  var LitePhysics = /*#__PURE__*/ function() {
1198
1152
  function LitePhysics() {}
1153
+ var _proto = LitePhysics.prototype;
1154
+ /**
1155
+ * {@inheritDoc IPhysics.initialize }
1156
+ */ _proto.initialize = function initialize() {
1157
+ return Promise.resolve();
1158
+ };
1199
1159
  /**
1200
1160
  * {@inheritDoc IPhysics.createPhysicsManager }
1201
- */ LitePhysics.createPhysicsManager = function createPhysicsManager(onContactBegin, onContactEnd, onContactPersist, onTriggerBegin, onTriggerEnd, onTriggerPersist) {
1161
+ */ _proto.createPhysicsManager = function createPhysicsManager(onContactBegin, onContactEnd, onContactPersist, onTriggerBegin, onTriggerEnd, onTriggerPersist) {
1202
1162
  return new LitePhysicsManager(onContactBegin, onContactEnd, onContactPersist, onTriggerBegin, onTriggerEnd, onTriggerPersist);
1203
1163
  };
1204
1164
  /**
1205
1165
  * {@inheritDoc IPhysics.createStaticCollider }
1206
- */ LitePhysics.createStaticCollider = function createStaticCollider(position, rotation) {
1166
+ */ _proto.createStaticCollider = function createStaticCollider(position, rotation) {
1207
1167
  return new LiteStaticCollider(position, rotation);
1208
1168
  };
1209
1169
  /**
1210
1170
  * {@inheritDoc IPhysics.createDynamicCollider }
1211
- */ LitePhysics.createDynamicCollider = function createDynamicCollider(position, rotation) {
1171
+ */ _proto.createDynamicCollider = function createDynamicCollider(position, rotation) {
1212
1172
  return new LiteDynamicCollider(position, rotation);
1213
1173
  };
1214
1174
  /**
1215
1175
  * {@inheritDoc IPhysics.createCharacterController }
1216
- */ LitePhysics.createCharacterController = function createCharacterController() {
1176
+ */ _proto.createCharacterController = function createCharacterController() {
1217
1177
  throw "Physics-lite don't support createCharacterController. Use Physics-PhysX instead!";
1218
1178
  };
1219
1179
  /**
1220
1180
  * {@inheritDoc IPhysics.createPhysicsMaterial }
1221
- */ LitePhysics.createPhysicsMaterial = function createPhysicsMaterial(staticFriction, dynamicFriction, bounciness, frictionCombine, bounceCombine) {
1181
+ */ _proto.createPhysicsMaterial = function createPhysicsMaterial(staticFriction, dynamicFriction, bounciness, frictionCombine, bounceCombine) {
1222
1182
  return new LitePhysicsMaterial(staticFriction, dynamicFriction, bounciness, frictionCombine, bounceCombine);
1223
1183
  };
1224
1184
  /**
1225
1185
  * {@inheritDoc IPhysics.createBoxColliderShape }
1226
- */ LitePhysics.createBoxColliderShape = function createBoxColliderShape(uniqueID, size, material) {
1186
+ */ _proto.createBoxColliderShape = function createBoxColliderShape(uniqueID, size, material) {
1227
1187
  return new LiteBoxColliderShape(uniqueID, size, material);
1228
1188
  };
1229
1189
  /**
1230
1190
  * {@inheritDoc IPhysics.createSphereColliderShape }
1231
- */ LitePhysics.createSphereColliderShape = function createSphereColliderShape(uniqueID, radius, material) {
1191
+ */ _proto.createSphereColliderShape = function createSphereColliderShape(uniqueID, radius, material) {
1232
1192
  return new LiteSphereColliderShape(uniqueID, radius, material);
1233
1193
  };
1234
1194
  /**
1235
1195
  * {@inheritDoc IPhysics.createPlaneColliderShape }
1236
- */ LitePhysics.createPlaneColliderShape = function createPlaneColliderShape(uniqueID, material) {
1196
+ */ _proto.createPlaneColliderShape = function createPlaneColliderShape(uniqueID, material) {
1237
1197
  throw "Physics-lite don't support PlaneColliderShape. Use Physics-PhysX instead!";
1238
1198
  };
1239
1199
  /**
1240
1200
  * {@inheritDoc IPhysics.createCapsuleColliderShape }
1241
- */ LitePhysics.createCapsuleColliderShape = function createCapsuleColliderShape(uniqueID, radius, height, material) {
1201
+ */ _proto.createCapsuleColliderShape = function createCapsuleColliderShape(uniqueID, radius, height, material) {
1242
1202
  throw "Physics-lite don't support CapsuleColliderShape. Use Physics-PhysX instead!";
1243
1203
  };
1244
1204
  /**
1245
1205
  * {@inheritDoc IPhysics.createFixedJoint }
1246
- */ LitePhysics.createFixedJoint = function createFixedJoint(collider) {
1206
+ */ _proto.createFixedJoint = function createFixedJoint(collider) {
1247
1207
  throw "Physics-lite don't support CapsuleColliderShape. Use Physics-PhysX instead!";
1248
1208
  };
1249
1209
  /**
1250
1210
  * {@inheritDoc IPhysics.createHingeJoint }
1251
- */ LitePhysics.createHingeJoint = function createHingeJoint(collider) {
1211
+ */ _proto.createHingeJoint = function createHingeJoint(collider) {
1252
1212
  throw "Physics-lite don't support CapsuleColliderShape. Use Physics-PhysX instead!";
1253
1213
  };
1254
1214
  /**
1255
1215
  * {@inheritDoc IPhysics.createSpringJoint }
1256
- */ LitePhysics.createSpringJoint = function createSpringJoint(collider) {
1216
+ */ _proto.createSpringJoint = function createSpringJoint(collider) {
1257
1217
  throw "Physics-lite don't support CapsuleColliderShape. Use Physics-PhysX instead!";
1258
1218
  };
1259
1219
  return LitePhysics;
1260
1220
  }();
1261
- LitePhysics = __decorate([
1262
- StaticInterfaceImplement()
1263
- ], LitePhysics);
1264
1221
 
1265
1222
  export { LitePhysics };
1266
1223
  //# sourceMappingURL=module.js.map