@galacean/engine-physics-physx 0.0.0-experimental-backup.0 → 0.0.0-experimental-2.0-game

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.js","sources":["../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_instanceof.js","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_set_prototype_of.js","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_inherits.js","../src/shape/PhysXColliderShape.ts","../src/shape/PhysXBoxColliderShape.ts","../src/shape/PhysXCapsuleColliderShape.ts","../src/PhysXCharacterController.ts","../src/PhysXCollider.ts","../src/PhysXDynamicCollider.ts","../src/PhysXPhysicsManager.ts","../src/PhysXPhysicsMaterial.ts","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_create_class.js","../src/PhysXPhysicsScene.ts","../src/PhysXStaticCollider.ts","../src/enum/PhysXRuntimeMode.ts","../src/joint/PhysXJoint.ts","../src/joint/PhysXFixedJoint.ts","../src/joint/PhysXHingeJoint.ts","../src/joint/PhysXSpringJoint.ts","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_assert_this_initialized.js","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_type_of.js","../../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_possible_constructor_return.js","../src/shape/PhysXMeshColliderShape.ts","../src/shape/PhysXPlaneColliderShape.ts","../src/shape/PhysXSphereColliderShape.ts","../src/PhysXPhysics.ts","../src/index.ts"],"sourcesContent":["function _instanceof(left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return !!right[Symbol.hasInstance](left);\n } else return left instanceof right;\n}\nexport { _instanceof as _ };\n","function _set_prototype_of(o, p) {\n _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {\n o.__proto__ = p;\n\n return o;\n };\n\n return _set_prototype_of(o, p);\n}\nexport { _set_prototype_of as _ };\n","import { _ as _set_prototype_of } from \"./_set_prototype_of.js\";\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });\n\n if (superClass) _set_prototype_of(subClass, superClass);\n}\nexport { _inherits as _ };\n","import { Quaternion, Vector3, DisorderedArray, Vector4, MathUtil } from \"@galacean/engine\";\nimport { IColliderShape } from \"@galacean/engine-design\";\nimport { PhysXCharacterController } from \"../PhysXCharacterController\";\nimport { PhysXPhysics } from \"../PhysXPhysics\";\nimport { PhysXPhysicsMaterial } from \"../PhysXPhysicsMaterial\";\n\n/**\n * Flags which affect the behavior of Shapes.\n */\nexport enum ShapeFlag {\n /** The shape will partake in collision in the physical simulation. */\n SIMULATION_SHAPE = 1 << 0,\n /** The shape will partake in scene queries (ray casts, overlap tests, sweeps, ...). */\n SCENE_QUERY_SHAPE = 1 << 1,\n /** The shape is a trigger which can send reports whenever other shapes enter/leave its volume. */\n TRIGGER_SHAPE = 1 << 2\n}\n\n/**\n * Abstract class for collider shapes.\n */\nexport abstract class PhysXColliderShape implements IColliderShape {\n static readonly halfSqrt: number = 0.70710678118655;\n static transform = {\n translation: new Vector3(),\n rotation: null\n };\n\n protected static _tempVector4 = new Vector4();\n\n /** @internal */\n _controllers: DisorderedArray<PhysXCharacterController> = new DisorderedArray<PhysXCharacterController>();\n /** @internal */\n _contractOffset: number = 0.02;\n\n /** @internal */\n _worldScale: Vector3 = new Vector3(1, 1, 1);\n /** @internal */\n _position: Vector3 = new Vector3();\n /** @internal */\n _pxMaterial: any;\n /** @internal */\n _pxShape: any;\n /** @internal */\n /** @internal */\n _id: number;\n /** @internal */\n _rotation: Vector3 = new Vector3();\n\n protected _physXPhysics: PhysXPhysics;\n protected _pxGeometry: any;\n protected _axis: Quaternion = null;\n protected _physXRotation: Quaternion = new Quaternion();\n\n private _shapeFlags: ShapeFlag = ShapeFlag.SCENE_QUERY_SHAPE | ShapeFlag.SIMULATION_SHAPE;\n\n constructor(physXPhysics: PhysXPhysics) {\n this._physXPhysics = physXPhysics;\n }\n\n /**\n * {@inheritDoc IColliderShape.setRotation }\n */\n setRotation(value: Vector3): void {\n const rotation = this._rotation.set(\n MathUtil.degreeToRadian(value.x),\n MathUtil.degreeToRadian(value.y),\n MathUtil.degreeToRadian(value.z)\n );\n Quaternion.rotationYawPitchRoll(rotation.y, rotation.x, rotation.z, this._physXRotation);\n this._axis && Quaternion.multiply(this._physXRotation, this._axis, this._physXRotation);\n this._physXRotation.normalize();\n this._setLocalPose();\n }\n\n /**\n * {@inheritDoc IColliderShape.setPosition }\n */\n setPosition(value: Vector3): void {\n if (value !== this._position) {\n this._position.copyFrom(value);\n }\n const controllers = this._controllers;\n for (let i = 0, n = controllers.length; i < n; i++) {\n controllers.get(i)._updateShapePosition(this._position, this._worldScale);\n }\n\n this._setLocalPose();\n }\n\n /**\n * {@inheritDoc IColliderShape.setWorldScale }\n */\n setWorldScale(scale: Vector3): void {\n this._worldScale.set(Math.abs(scale.x), Math.abs(scale.y), Math.abs(scale.z));\n this._setLocalPose();\n\n const controllers = this._controllers;\n for (let i = 0, n = controllers.length; i < n; i++) {\n controllers.get(i)._updateShapePosition(this._position, this._worldScale);\n }\n }\n\n /**\n * {@inheritDoc IColliderShape.setContactOffset }\n * @default 0.02f * PxTolerancesScale::length\n */\n setContactOffset(offset: number): void {\n this._contractOffset = offset;\n const controllers = this._controllers;\n if (controllers.length) {\n for (let i = 0, n = controllers.length; i < n; i++) {\n controllers.get(i)._pxController?.setContactOffset(offset);\n }\n } else {\n this._pxShape.setContactOffset(offset);\n }\n }\n\n /**\n * {@inheritDoc IColliderShape.setMaterial }\n */\n setMaterial(value: PhysXPhysicsMaterial): void {\n this._pxMaterial = value._pxMaterial;\n this._pxShape.setMaterial(this._pxMaterial);\n }\n\n /**\n * {@inheritDoc IColliderShape.setIsTrigger }\n */\n setIsTrigger(value: boolean): void {\n this._modifyFlag(ShapeFlag.SIMULATION_SHAPE, !value);\n this._modifyFlag(ShapeFlag.TRIGGER_SHAPE, value);\n this._setShapeFlags(this._shapeFlags);\n }\n\n /**\n * {@inheritDoc IColliderShape.pointDistance }\n */\n pointDistance(point: Vector3): Vector4 {\n const info = this._pxGeometry.pointDistance(this._pxShape.getGlobalPose(), point);\n const closestPoint = info.closestPoint;\n const res = PhysXColliderShape._tempVector4;\n res.set(closestPoint.x, closestPoint.y, closestPoint.z, info.distance);\n return res;\n }\n\n /**\n * {@inheritDoc IColliderShape.destroy }\n */\n destroy(): void {\n this._pxShape.release();\n this._pxGeometry?.delete();\n }\n\n /**\n * @internal\n */\n _setShapeFlags(flags: ShapeFlag) {\n this._shapeFlags = flags;\n const shapeFlags = new this._physXPhysics._physX.PxShapeFlags(this._shapeFlags);\n this._pxShape.setFlags(shapeFlags);\n shapeFlags.delete();\n }\n\n protected _setLocalPose(): void {\n const transform = PhysXColliderShape.transform;\n Vector3.multiply(this._position, this._worldScale, transform.translation);\n transform.rotation = this._physXRotation;\n this._pxShape.setLocalPose(transform);\n }\n\n protected _initialize(material: PhysXPhysicsMaterial, id: number): void {\n this._id = id;\n this._pxMaterial = material._pxMaterial;\n const shapeFlags = new this._physXPhysics._physX.PxShapeFlags(this._shapeFlags);\n this._pxShape = this._physXPhysics._pxPhysics.createShape(this._pxGeometry, material._pxMaterial, true, shapeFlags);\n shapeFlags.delete();\n this._pxShape.setUUID(id);\n }\n\n private _modifyFlag(flag: ShapeFlag, value: boolean): void {\n this._shapeFlags = value ? this._shapeFlags | flag : this._shapeFlags & ~flag;\n }\n}\n","import { Vector3 } from \"@galacean/engine\";\nimport { IBoxColliderShape } from \"@galacean/engine-design\";\nimport { PhysXPhysics } from \"../PhysXPhysics\";\nimport { PhysXPhysicsMaterial } from \"../PhysXPhysicsMaterial\";\nimport { PhysXColliderShape } from \"./PhysXColliderShape\";\n\n/**\n * Box collider shape in PhysX.\n */\nexport class PhysXBoxColliderShape extends PhysXColliderShape implements IBoxColliderShape {\n private static _tempHalfExtents = new Vector3();\n /** @internal */\n _halfSize: Vector3 = new Vector3();\n\n constructor(physXPhysics: PhysXPhysics, uniqueID: number, size: Vector3, material: PhysXPhysicsMaterial) {\n super(physXPhysics);\n const halfSize = this._halfSize;\n halfSize.set(size.x * 0.5, size.y * 0.5, size.z * 0.5);\n this._pxGeometry = new physXPhysics._physX.PxBoxGeometry(halfSize.x, halfSize.y, halfSize.z);\n this._initialize(material, uniqueID);\n this._setLocalPose();\n }\n\n /**\n * {@inheritDoc IBoxColliderShape.setSize }\n */\n setSize(value: Vector3): void {\n const halfSize = this._halfSize;\n const tempExtents = PhysXBoxColliderShape._tempHalfExtents;\n halfSize.set(value.x * 0.5, value.y * 0.5, value.z * 0.5);\n Vector3.multiply(halfSize, this._worldScale, tempExtents);\n this._pxGeometry.halfExtents = tempExtents;\n this._pxShape.setGeometry(this._pxGeometry);\n\n this._updateController(tempExtents);\n }\n\n /**\n * {@inheritDoc IColliderShape.setRotation }\n */\n override setRotation(value: Vector3): void {\n super.setRotation(value);\n if (this._controllers.length > 0) {\n console.warn(\"Box character controller `rotation` is not supported in PhysX and will be ignored\");\n }\n }\n\n /**\n * {@inheritDoc IColliderShape.setWorldScale }\n */\n override setWorldScale(scale: Vector3): void {\n super.setWorldScale(scale);\n const tempExtents = PhysXBoxColliderShape._tempHalfExtents;\n Vector3.multiply(this._halfSize, this._worldScale, tempExtents);\n this._pxGeometry.halfExtents = tempExtents;\n this._pxShape.setGeometry(this._pxGeometry);\n\n this._updateController(tempExtents);\n }\n\n private _updateController(extents: Vector3) {\n const controllers = this._controllers;\n for (let i = 0, n = controllers.length; i < n; i++) {\n const pxController = controllers.get(i)._pxController;\n\n if (pxController) {\n pxController.setHalfHeight(extents.y);\n pxController.setHalfSideExtent(extents.x);\n pxController.setHalfForwardExtent(extents.z);\n }\n }\n }\n}\n","import { ICapsuleColliderShape } from \"@galacean/engine-design\";\nimport { Quaternion, Vector3 } from \"@galacean/engine\";\nimport { PhysXPhysics } from \"../PhysXPhysics\";\nimport { PhysXPhysicsMaterial } from \"../PhysXPhysicsMaterial\";\nimport { PhysXColliderShape } from \"./PhysXColliderShape\";\n/**\n * Capsule collider shape in PhysX.\n */\nexport class PhysXCapsuleColliderShape extends PhysXColliderShape implements ICapsuleColliderShape {\n /** @internal */\n _radius: number;\n /** @internal */\n _halfHeight: number;\n /** @internal */\n _upAxis: ColliderShapeUpAxis = ColliderShapeUpAxis.Y;\n\n constructor(\n physXPhysics: PhysXPhysics,\n uniqueID: number,\n radius: number,\n height: number,\n material: PhysXPhysicsMaterial\n ) {\n super(physXPhysics);\n\n this._radius = radius;\n this._halfHeight = height * 0.5;\n this._axis = new Quaternion(0, 0, PhysXColliderShape.halfSqrt, PhysXColliderShape.halfSqrt);\n this._physXRotation.copyFrom(this._axis);\n\n this._pxGeometry = new physXPhysics._physX.PxCapsuleGeometry(radius, this._halfHeight);\n this._initialize(material, uniqueID);\n this._setLocalPose();\n }\n\n /**\n * {@inheritDoc ICapsuleColliderShape.setRadius }\n */\n setRadius(value: number): void {\n this._radius = value;\n const sizeScale = this._worldScale;\n switch (this._upAxis) {\n case ColliderShapeUpAxis.X:\n this._pxGeometry.radius = this._radius * Math.max(sizeScale.y, sizeScale.z);\n break;\n case ColliderShapeUpAxis.Y:\n this._pxGeometry.radius = this._radius * Math.max(sizeScale.x, sizeScale.z);\n break;\n case ColliderShapeUpAxis.Z:\n this._pxGeometry.radius = this._radius * Math.max(sizeScale.x, sizeScale.y);\n break;\n }\n this._pxShape.setGeometry(this._pxGeometry);\n\n const radius = this._pxGeometry.radius;\n const controllers = this._controllers;\n for (let i = 0, n = controllers.length; i < n; i++) {\n controllers.get(i)._pxController?.setRadius(radius);\n }\n }\n\n /**\n * {@inheritDoc ICapsuleColliderShape.setHeight }\n */\n setHeight(value: number): void {\n this._halfHeight = value * 0.5;\n const sizeScale = this._worldScale;\n switch (this._upAxis) {\n case ColliderShapeUpAxis.X:\n this._pxGeometry.halfHeight = this._halfHeight * sizeScale.x;\n break;\n case ColliderShapeUpAxis.Y:\n this._pxGeometry.halfHeight = this._halfHeight * sizeScale.y;\n break;\n case ColliderShapeUpAxis.Z:\n this._pxGeometry.halfHeight = this._halfHeight * sizeScale.z;\n break;\n }\n this._pxShape.setGeometry(this._pxGeometry);\n\n const height = this._pxGeometry.halfHeight * 2;\n const controllers = this._controllers;\n for (let i = 0, n = controllers.length; i < n; i++) {\n controllers.get(i)._pxController?.setHeight(height);\n }\n }\n\n /**\n * {@inheritDoc ICapsuleColliderShape.setRotation }\n */\n override setRotation(value: Vector3): void {\n super.setRotation(value);\n if (this._controllers.length > 0) {\n console.warn(\"Capsule character controller `rotation` is not supported in PhysX and will be ignored\");\n }\n }\n\n /**\n * {@inheritDoc ICapsuleColliderShape.setUpAxis }\n */\n setUpAxis(upAxis: ColliderShapeUpAxis): void {\n const { _rotation: rotation, _axis: axis, _physXRotation: physXRotation } = this;\n\n this._upAxis = upAxis;\n switch (this._upAxis) {\n case ColliderShapeUpAxis.X:\n axis.set(0, 0, 0, 1);\n break;\n case ColliderShapeUpAxis.Y:\n axis.set(0, 0, PhysXColliderShape.halfSqrt, PhysXColliderShape.halfSqrt);\n break;\n case ColliderShapeUpAxis.Z:\n axis.set(0, PhysXColliderShape.halfSqrt, 0, PhysXColliderShape.halfSqrt);\n break;\n }\n if (rotation) {\n Quaternion.rotationYawPitchRoll(rotation.y, rotation.x, rotation.z, physXRotation);\n Quaternion.multiply(physXRotation, axis, physXRotation);\n } else {\n physXRotation.copyFrom(axis);\n }\n this._setLocalPose();\n\n if (this._controllers.length > 0) {\n console.warn(\"Capsule character controller `upAxis` is not supported in PhysX and will be ignored\");\n }\n }\n\n /**\n * {@inheritDoc IColliderShape.setWorldScale }\n */\n override setWorldScale(scale: Vector3): void {\n super.setWorldScale(scale);\n const sizeScale = this._worldScale;\n const geometry = this._pxGeometry;\n switch (this._upAxis) {\n case ColliderShapeUpAxis.X:\n geometry.radius = this._radius * Math.max(sizeScale.y, sizeScale.z);\n geometry.halfHeight = this._halfHeight * sizeScale.x;\n break;\n case ColliderShapeUpAxis.Y:\n geometry.radius = this._radius * Math.max(sizeScale.x, sizeScale.z);\n geometry.halfHeight = this._halfHeight * sizeScale.y;\n break;\n case ColliderShapeUpAxis.Z:\n geometry.radius = this._radius * Math.max(sizeScale.x, sizeScale.y);\n geometry.halfHeight = this._halfHeight * sizeScale.z;\n break;\n }\n this._pxShape.setGeometry(geometry);\n\n const radius = geometry.radius;\n const height = geometry.halfHeight * 2;\n const controllers = this._controllers;\n for (let i = 0, n = controllers.length; i < n; i++) {\n const pxController = controllers.get(i)._pxController;\n if (pxController) {\n pxController.setRadius(radius);\n pxController.setHeight(height);\n }\n }\n }\n}\n\n/**\n * The up axis of the collider shape.\n */\nexport enum ColliderShapeUpAxis {\n /** Up axis is X. */\n X,\n /** Up axis is Y. */\n Y,\n /** Up axis is Z. */\n Z\n}\n","import { ICharacterController } from \"@galacean/engine-design\";\nimport { Vector3 } from \"@galacean/engine\";\nimport { PhysXPhysics } from \"./PhysXPhysics\";\nimport { PhysXPhysicsScene } from \"./PhysXPhysicsScene\";\nimport { PhysXBoxColliderShape } from \"./shape/PhysXBoxColliderShape\";\nimport { ColliderShapeUpAxis, PhysXCapsuleColliderShape } from \"./shape/PhysXCapsuleColliderShape\";\nimport { PhysXColliderShape } from \"./shape/PhysXColliderShape\";\n\n/**\n * Base class for character controllers.\n */\nexport class PhysXCharacterController implements ICharacterController {\n private static _tempVec = new Vector3();\n\n /** @internal */\n _scene: PhysXPhysicsScene = null;\n /** @internal */\n _id: number;\n /** @internal */\n _pxController: any;\n /** @internal */\n _pxManager: PhysXPhysicsScene;\n /** @internal */\n _shape: PhysXColliderShape;\n private _shapeScaledPosition = new Vector3();\n private _worldPosition: Vector3 = null;\n\n private _physXPhysics: PhysXPhysics;\n\n constructor(physXPhysics: PhysXPhysics) {\n this._physXPhysics = physXPhysics;\n }\n\n /**\n * {@inheritDoc ICharacterController.move }\n */\n move(disp: Vector3, minDist: number, elapsedTime: number): number {\n return this._pxController?.move(disp, minDist, elapsedTime) ?? 0;\n }\n\n /**\n * {@inheritDoc ICharacterController.setWorldPosition }\n */\n setWorldPosition(position: Vector3): void {\n this._worldPosition = position;\n this._updateNativePosition();\n }\n\n /**\n * {@inheritDoc ICharacterController.getWorldPosition }\n */\n getWorldPosition(position: Vector3): void {\n if (this._pxController) {\n position.copyFrom(this._pxController.getPosition());\n position.subtract(this._shapeScaledPosition);\n }\n }\n\n /**\n * {@inheritDoc ICharacterController.setStepOffset }\n */\n setStepOffset(offset: number): void {\n this._pxController?.setStepOffset(offset);\n }\n\n /**\n * {@inheritDoc ICharacterController.setNonWalkableMode }\n */\n setNonWalkableMode(flag: number): void {\n this._pxController?.setNonWalkableMode(flag);\n }\n\n /**\n * {@inheritDoc ICharacterController.setUpDirection }\n */\n setUpDirection(up: Vector3): void {\n this._pxController?.setUpDirection(up);\n }\n\n /**\n * {@inheritDoc ICharacterController.setSlopeLimit }\n */\n setSlopeLimit(slopeLimit: number): void {\n this._pxController?.setSlopeLimit(Math.cos((slopeLimit * Math.PI) / 180));\n }\n\n /**\n * {@inheritDoc ICharacterController.addShape }\n */\n addShape(shape: PhysXColliderShape): void {\n // Add shape should sync latest position and world scale to pxController\n this._updateShapePosition(shape._position, shape._worldScale);\n // When CharacterController is disabled, set shape property need check pxController whether exist because of this._pxManager is null and won't create pxController\n this._pxManager && this._createPXController(this._pxManager, shape);\n this._shape = shape;\n shape._controllers.add(this);\n this._pxController?.setContactOffset(shape._contractOffset);\n this._scene?._addColliderShape(shape._id);\n }\n\n /**\n * {@inheritDoc ICharacterController.removeShape }\n */\n removeShape(shape: PhysXColliderShape): void {\n this._destroyPXController();\n this._shape = null;\n shape._controllers.delete(this);\n this._scene?._removeColliderShape(shape._id);\n }\n\n /**\n * {@inheritDoc ICollider.setCollisionLayer }\n */\n setCollisionLayer(layer: number): void {\n const actor = this._pxController?.getActor();\n\n if (actor) {\n this._physXPhysics._physX.setGroup(actor, layer);\n }\n }\n\n /**\n * {@inheritDoc ICharacterController.destroy }\n */\n destroy(): void {\n this._destroyPXController();\n }\n\n /**\n * @internal\n */\n _createPXController(pxManager: PhysXPhysicsScene, shape: PhysXColliderShape): void {\n let desc: any;\n if (shape instanceof PhysXBoxColliderShape) {\n desc = new this._physXPhysics._physX.PxBoxControllerDesc();\n desc.halfHeight = shape._halfSize.y;\n desc.halfSideExtent = shape._halfSize.x;\n desc.halfForwardExtent = shape._halfSize.z;\n if (shape._rotation.lengthSquared() > 0) {\n console.warn(\"Box character controller `rotation` is not supported in PhysX and will be ignored\");\n }\n } else if (shape instanceof PhysXCapsuleColliderShape) {\n desc = new this._physXPhysics._physX.PxCapsuleControllerDesc();\n desc.radius = shape._radius;\n desc.height = shape._halfHeight * 2;\n desc.climbingMode = 1; // constraint mode\n\n if (shape._rotation.lengthSquared() > 0) {\n console.warn(\"Capsule character controller `rotation` is not supported in PhysX and will be ignored\");\n }\n if (shape._upAxis !== ColliderShapeUpAxis.Y) {\n console.warn(\"Capsule character controller `upAxis` is not supported in PhysX and will be ignored\");\n }\n } else {\n throw \"unsupported shape type\";\n }\n\n desc.setMaterial(shape._pxMaterial);\n this._pxController = pxManager._getControllerManager().createController(desc);\n desc.delete();\n\n this._pxController.setUUID(shape._id);\n\n this._updateNativePosition();\n }\n\n /**\n * @internal\n */\n _destroyPXController(): void {\n if (this._pxController) {\n this._pxController.release();\n this._pxController = null;\n }\n }\n\n /**\n * @internal\n */\n _updateShapePosition(shapePosition: Vector3, worldScale: Vector3): void {\n Vector3.multiply(shapePosition, worldScale, this._shapeScaledPosition);\n this._updateNativePosition();\n }\n\n private _updateNativePosition(): void {\n const worldPosition = this._worldPosition;\n if (this._pxController && worldPosition) {\n Vector3.add(worldPosition, this._shapeScaledPosition, PhysXCharacterController._tempVec);\n this._pxController.setPosition(PhysXCharacterController._tempVec);\n }\n }\n}\n","import { ICollider } from \"@galacean/engine-design\";\nimport { Quaternion, Vector3 } from \"@galacean/engine\";\nimport { PhysXPhysics } from \"./PhysXPhysics\";\nimport { PhysXColliderShape } from \"./shape/PhysXColliderShape\";\nimport { PhysXPhysicsScene } from \"./PhysXPhysicsScene\";\n\n/**\n * Abstract class of physical collider.\n */\nexport abstract class PhysXCollider implements ICollider {\n private static _tempTransform: {\n translation: Vector3;\n rotation: Quaternion;\n } = { translation: null, rotation: null };\n\n /** @internal */\n _scene: PhysXPhysicsScene = null;\n /** @internal */\n _pxActor: any;\n /** @internal */\n _shapes = new Array<PhysXColliderShape>();\n\n protected _physXPhysics: PhysXPhysics;\n\n constructor(physXPhysics: PhysXPhysics) {\n this._physXPhysics = physXPhysics;\n }\n\n /**\n * {@inheritDoc ICollider.addShape }\n */\n addShape(shape: PhysXColliderShape): void {\n this._pxActor.attachShape(shape._pxShape);\n this._shapes.push(shape);\n this._scene?._addColliderShape(shape._id);\n }\n\n /**\n * {@inheritDoc ICollider.removeShape }\n */\n removeShape(shape: PhysXColliderShape): void {\n this._pxActor.detachShape(shape._pxShape, true);\n const shapes = this._shapes;\n shapes.splice(shapes.indexOf(shape), 1);\n this._scene?._removeColliderShape(shape._id);\n }\n\n /**\n * {@inheritDoc ICollider.setWorldTransform }\n */\n setWorldTransform(position: Vector3, rotation: Quaternion): void {\n this._pxActor.setGlobalPose(this._transform(position, rotation), true);\n }\n\n /**\n * {@inheritDoc ICollider.getWorldTransform }\n */\n getWorldTransform(outPosition: Vector3, outRotation: Quaternion): void {\n const transform = this._pxActor.getGlobalPose();\n outPosition.set(transform.translation.x, transform.translation.y, transform.translation.z);\n outRotation.set(transform.rotation.x, transform.rotation.y, transform.rotation.z, transform.rotation.w);\n }\n\n /**\n * {@inheritDoc ICollider.setCollisionLayer }\n */\n setCollisionLayer(layer: number): void {\n this._physXPhysics._physX.setGroup(this._pxActor, layer);\n }\n\n /**\n * {@inheritDoc ICollider.destroy }\n */\n destroy(): void {\n this._pxActor.release();\n }\n\n /**\n * @internal\n */\n _transform(pos: Vector3, rot: Quaternion): { translation: Vector3; rotation: Quaternion } {\n const transform = PhysXCollider._tempTransform;\n transform.translation = pos;\n transform.rotation = rot.normalize();\n return transform;\n }\n}\n","import { IDynamicCollider } from \"@galacean/engine-design\";\nimport { MathUtil, Quaternion, Vector3 } from \"@galacean/engine\";\nimport { PhysXCollider } from \"./PhysXCollider\";\nimport { PhysXPhysics } from \"./PhysXPhysics\";\n\n/**\n * The collision detection mode constants used for PhysXDynamicCollider.collisionDetectionMode.\n * */\nexport enum CollisionDetectionMode {\n /** Continuous collision detection is off for this dynamic collider. */\n Discrete,\n /** Continuous collision detection is on for colliding with static mesh geometry. */\n Continuous,\n /** Continuous collision detection is on for colliding with static and dynamic geometry. */\n ContinuousDynamic,\n /** Speculative continuous collision detection is on for static and dynamic geometries */\n ContinuousSpeculative\n}\n\n/**\n * A dynamic collider can act with self-defined movement or physical force\n */\nexport class PhysXDynamicCollider extends PhysXCollider implements IDynamicCollider {\n private static _tempTranslation = new Vector3();\n private static _tempRotation = new Quaternion();\n\n constructor(physXPhysics: PhysXPhysics, position: Vector3, rotation: Quaternion) {\n super(physXPhysics);\n const transform = this._transform(position, rotation);\n this._pxActor = physXPhysics._pxPhysics.createRigidDynamic(transform);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setLinearDamping }\n */\n setLinearDamping(value: number): void {\n this._pxActor.setLinearDamping(value);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setAngularDamping }\n */\n setAngularDamping(value: number): void {\n this._pxActor.setAngularDamping(value);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.getLinearVelocity }\n */\n getLinearVelocity(out: Vector3): Vector3 {\n const velocity = this._pxActor.getLinearVelocity();\n return out.set(velocity.x, velocity.y, velocity.z);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setLinearVelocity }\n */\n setLinearVelocity(value: Vector3): void {\n this._pxActor.setLinearVelocity(value, true);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.getAngularVelocity }\n */\n getAngularVelocity(out: Vector3): Vector3 {\n const velocity = this._pxActor.getAngularVelocity();\n return out.set(\n MathUtil.radianToDegree(velocity.x),\n MathUtil.radianToDegree(velocity.y),\n MathUtil.radianToDegree(velocity.z)\n );\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setAngularVelocity }\n */\n setAngularVelocity(value: Vector3): void {\n PhysXDynamicCollider._tempTranslation.set(\n MathUtil.degreeToRadian(value.x),\n MathUtil.degreeToRadian(value.y),\n MathUtil.degreeToRadian(value.z)\n );\n this._pxActor.setAngularVelocity(PhysXDynamicCollider._tempTranslation, true);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setMass }\n */\n setMass(value: number): void {\n this._pxActor.setMass(value);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.getCenterOfMass }\n */\n getCenterOfMass(out: Vector3): Vector3 {\n const { translation } = this._pxActor.getCMassLocalPose();\n return out.set(translation.x, translation.y, translation.z);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setCenterOfMass }\n */\n setCenterOfMass(position: Vector3): void {\n this._pxActor.setCMassLocalPose(position);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setInertiaTensor }\n */\n setInertiaTensor(value: Vector3): void {\n this._pxActor.setMassSpaceInertiaTensor(value);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.getInertiaTensor }\n */\n getInertiaTensor(out: Vector3): Vector3 {\n const inertia = this._pxActor.getMassSpaceInertiaTensor();\n return out.set(inertia.x, inertia.y, inertia.z);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setMassAndUpdateInertia }\n */\n setMassAndUpdateInertia(mass: number): void {\n this._pxActor.setMassAndUpdateInertia(mass);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setMaxAngularVelocity }\n */\n setMaxAngularVelocity(value: number): void {\n this._pxActor.setMaxAngularVelocity(MathUtil.degreeToRadian(value));\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setMaxDepenetrationVelocity }\n */\n setMaxDepenetrationVelocity(value: number): void {\n this._pxActor.setMaxDepenetrationVelocity(value);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setSleepThreshold }\n * @default 1e-5f * PxTolerancesScale::speed * PxTolerancesScale::speed\n */\n setSleepThreshold(value: number): void {\n this._pxActor.setSleepThreshold(value);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setSolverIterations }\n */\n setSolverIterations(value: number): void {\n this._pxActor.setSolverIterationCounts(value, 1);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setCollisionDetectionMode }\n */\n setCollisionDetectionMode(value: number): void {\n const physX = this._physXPhysics._physX;\n\n switch (value) {\n case CollisionDetectionMode.Continuous:\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eENABLE_CCD, true);\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eENABLE_CCD_FRICTION, false);\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eENABLE_SPECULATIVE_CCD, false);\n break;\n case CollisionDetectionMode.ContinuousDynamic:\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eENABLE_CCD, true);\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eENABLE_CCD_FRICTION, true);\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eENABLE_SPECULATIVE_CCD, false);\n break;\n case CollisionDetectionMode.ContinuousSpeculative:\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eENABLE_CCD, false);\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eENABLE_CCD_FRICTION, false);\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eENABLE_SPECULATIVE_CCD, true);\n break;\n case CollisionDetectionMode.Discrete:\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eENABLE_CCD, false);\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eENABLE_CCD_FRICTION, false);\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eENABLE_SPECULATIVE_CCD, false);\n break;\n }\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setUseGravity }\n */\n setUseGravity(value: boolean): void {\n this._pxActor.setActorFlag(this._physXPhysics._physX.PxActorFlag.eDISABLE_GRAVITY, !value);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setIsKinematic }\n */\n setIsKinematic(value: boolean): void {\n if (value) {\n this._pxActor.setRigidBodyFlag(this._physXPhysics._physX.PxRigidBodyFlag.eKINEMATIC, true);\n } else {\n this._pxActor.setRigidBodyFlag(this._physXPhysics._physX.PxRigidBodyFlag.eKINEMATIC, false);\n }\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setConstraints }\n */\n setConstraints(flags: number): void {\n this._pxActor.setRigidDynamicLockFlags(flags);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.addForce }\n */\n addForce(force: Vector3) {\n this._pxActor.addForce({ x: force.x, y: force.y, z: force.z });\n }\n\n /**\n * {@inheritDoc IDynamicCollider.addTorque }\n */\n addTorque(torque: Vector3) {\n this._pxActor.addTorque({ x: torque.x, y: torque.y, z: torque.z });\n }\n\n /**\n * {@inheritDoc IDynamicCollider.move }\n */\n move(positionOrRotation: Vector3 | Quaternion, rotation?: Quaternion): void {\n if (rotation) {\n this._pxActor.setKinematicTarget(positionOrRotation, rotation);\n return;\n }\n\n const tempTranslation = PhysXDynamicCollider._tempTranslation;\n const tempRotation = PhysXDynamicCollider._tempRotation;\n this.getWorldTransform(tempTranslation, tempRotation);\n if (positionOrRotation instanceof Vector3) {\n this._pxActor.setKinematicTarget(positionOrRotation, tempRotation);\n } else {\n this._pxActor.setKinematicTarget(tempTranslation, positionOrRotation);\n }\n }\n\n /**\n * {@inheritDoc IDynamicCollider.sleep }\n */\n sleep(): void {\n return this._pxActor.putToSleep();\n }\n\n /**\n * {@inheritDoc IDynamicCollider.isSleeping }\n */\n isSleeping(): boolean {\n return this._pxActor.isSleeping();\n }\n\n /**\n * {@inheritDoc IDynamicCollider.wakeUp }\n */\n wakeUp(): void {\n return this._pxActor.wakeUp();\n }\n}\n","import { IPhysicsManager } from \"@galacean/engine-design\";\nimport { TriggerEvent } from \"./PhysXPhysicsScene\";\n\nexport class PhysXPhysicsManager implements IPhysicsManager {\n /** @internal */\n _eventMap: Record<number, Record<number, TriggerEvent>> = {};\n}\n","import { IPhysicsMaterial } from \"@galacean/engine-design\";\nimport { PhysXPhysics } from \"./PhysXPhysics\";\n\n/**\n * Physics material describes how to handle colliding objects (friction, bounciness).\n */\nexport class PhysXPhysicsMaterial implements IPhysicsMaterial {\n /** @internal */\n _pxMaterial: any;\n\n protected _physXPhysics: PhysXPhysics;\n\n constructor(\n physXPhysics: PhysXPhysics,\n staticFriction: number,\n dynamicFriction: number,\n bounciness: number,\n frictionCombine: CombineMode,\n bounceCombine: CombineMode\n ) {\n this._physXPhysics = physXPhysics;\n const pxMaterial = physXPhysics._pxPhysics.createMaterial(staticFriction, dynamicFriction, bounciness);\n pxMaterial.setFrictionCombineMode(frictionCombine);\n pxMaterial.setRestitutionCombineMode(bounceCombine);\n this._pxMaterial = pxMaterial;\n }\n\n /**\n * {@inheritDoc IPhysicsMaterial.setBounciness }\n */\n setBounciness(value: number) {\n this._pxMaterial.setRestitution(value);\n }\n\n /**\n * {@inheritDoc IPhysicsMaterial.setDynamicFriction }\n */\n setDynamicFriction(value: number) {\n this._pxMaterial.setDynamicFriction(value);\n }\n\n /**\n * {@inheritDoc IPhysicsMaterial.setStaticFriction }\n */\n setStaticFriction(value: number) {\n this._pxMaterial.setStaticFriction(value);\n }\n\n /**\n * {@inheritDoc IPhysicsMaterial.setBounceCombine }\n */\n setBounceCombine(value: CombineMode) {\n this._pxMaterial.setRestitutionCombineMode(value);\n }\n\n /**\n * {@inheritDoc IPhysicsMaterial.setFrictionCombine }\n */\n setFrictionCombine(value: CombineMode) {\n this._pxMaterial.setFrictionCombineMode(value);\n }\n\n /**\n * {@inheritDoc IPhysicsMaterial.destroy }\n */\n destroy(): void {\n this._pxMaterial.release();\n }\n}\n\n/**\n * Describes how physics materials of the colliding objects are combined.\n */\nenum CombineMode {\n /** Averages the friction/bounce of the two colliding materials. */\n Average,\n /** Uses the smaller friction/bounce of the two colliding materials. */\n Minimum,\n /** Multiplies the friction/bounce of the two colliding materials. */\n Multiply,\n /** Uses the larger friction/bounce of the two colliding materials. */\n Maximum\n}\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n\n if (\"value\" in descriptor) descriptor.writable = true;\n\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n\n return Constructor;\n}\nexport { _create_class as _ };\n","import { Ray, Vector3, DisorderedArray, Quaternion } from \"@galacean/engine\";\nimport { ICollision, IPhysicsScene, IPhysicsEvents, IContactEvent, ITriggerEvent } from \"@galacean/engine-design\";\nimport { PhysXCharacterController } from \"./PhysXCharacterController\";\nimport { PhysXCollider } from \"./PhysXCollider\";\nimport { PhysXPhysics } from \"./PhysXPhysics\";\nimport { PhysXPhysicsManager } from \"./PhysXPhysicsManager\";\n\n/**\n * A manager is a collection of colliders and constraints which can interact.\n */\nexport class PhysXPhysicsScene implements IPhysicsScene {\n /** @internal */\n _pxControllerManager: any = null;\n\n private static _tempPosition: Vector3 = new Vector3();\n private static _tempQuaternion: Quaternion = new Quaternion();\n private static _tempNormal: Vector3 = new Vector3();\n private static _tempPose: { translation: Vector3; rotation: Quaternion } = {\n translation: new Vector3(),\n rotation: new Quaternion()\n };\n private static _tempShapeIDs: number[] = [];\n\n // Cached geometry objects for reuse\n private _boxGeometry: any = null;\n private _sphereGeometry: any = null;\n private _capsuleGeometry: any = null;\n\n private _physXPhysics: PhysXPhysics;\n private _physXManager: PhysXPhysicsManager;\n private _pxRaycastHit: any;\n private _pxFilterData: any;\n\n private _pxScene: any;\n private _physXSimulationCallbackInstance: any;\n\n private _activeTriggers: DisorderedArray<TriggerEvent> = new DisorderedArray<TriggerEvent>();\n private _contactEvents: ContactEvent[] = [];\n private _contactEventCount = 0;\n private _triggerEvents: TriggerEvent[] = [];\n private _physicsEvents: IPhysicsEvents = { contactEvents: [], contactEventCount: 0, triggerEvents: [] };\n\n private _triggerEventPool: TriggerEvent[] = [];\n\n constructor(physXPhysics: PhysXPhysics, physicsManager: PhysXPhysicsManager) {\n this._physXPhysics = physXPhysics;\n this._physXManager = physicsManager;\n\n const physX = physXPhysics._physX;\n\n this._pxRaycastHit = new physX.PxRaycastHit();\n this._pxFilterData = new physX.PxQueryFilterData();\n this._pxFilterData.flags = new physX.PxQueryFlags(\n QueryFlag.STATIC | QueryFlag.DYNAMIC | QueryFlag.PRE_FILTER | QueryFlag.POST_FILTER\n );\n\n const triggerCallback = {\n onContactBegin: (collision) => {\n this._bufferContactEvent(collision, PhysicsEventState.Enter);\n },\n onContactEnd: (collision) => {\n this._bufferContactEvent(collision, PhysicsEventState.Exit);\n },\n onContactPersist: (collision) => {\n this._bufferContactEvent(collision, PhysicsEventState.Stay);\n },\n onTriggerBegin: (index1, index2) => {\n const event = index1 < index2 ? this._getTrigger(index1, index2) : this._getTrigger(index2, index1);\n event.state = PhysicsEventState.Enter;\n this._activeTriggers.add(event);\n },\n onTriggerEnd: (index1, index2) => {\n let event: TriggerEvent;\n if (index1 < index2) {\n const subMap = this._physXManager._eventMap[index1];\n event = subMap[index2];\n subMap[index2] = undefined;\n } else {\n const subMap = this._physXManager._eventMap[index2];\n event = subMap[index1];\n subMap[index1] = undefined;\n }\n event.state = PhysicsEventState.Exit;\n }\n };\n\n const pxPhysics = physXPhysics._pxPhysics;\n this._physXSimulationCallbackInstance = physX.PxSimulationEventCallback.implement(triggerCallback);\n const sceneDesc = physX.getDefaultSceneDesc(\n pxPhysics.getTolerancesScale(),\n 0,\n this._physXSimulationCallbackInstance\n );\n this._pxScene = pxPhysics.createScene(sceneDesc);\n sceneDesc.delete();\n }\n\n /**\n * {@inheritDoc IPhysicsScene.setGravity }\n */\n setGravity(value: Vector3) {\n this._pxScene.setGravity(value);\n }\n\n /**\n * {@inheritDoc IPhysicsScene.addCollider }\n */\n addCollider(collider: PhysXCollider): void {\n collider._scene = this;\n this._pxScene.addActor(collider._pxActor, null);\n const shapes = collider._shapes;\n for (let i = 0, n = shapes.length; i < n; i++) {\n this._addColliderShape(shapes[i]._id);\n }\n }\n\n /**\n * {@inheritDoc IPhysicsScene.removeCollider }\n */\n removeCollider(collider: PhysXCollider): void {\n collider._scene = null;\n this._pxScene.removeActor(collider._pxActor, true);\n const shapes = collider._shapes;\n for (let i = 0, n = shapes.length; i < n; i++) {\n this._removeColliderShape(shapes[i]._id);\n }\n }\n\n /**\n * {@inheritDoc IPhysicsScene.addCharacterController }\n */\n addCharacterController(characterController: PhysXCharacterController): void {\n characterController._scene = this;\n\n // Physx have no API to remove/readd cct into scene.\n if (!characterController._pxController) {\n const shape = characterController._shape;\n if (shape) {\n const lastPXManager = characterController._pxManager;\n if (lastPXManager !== this) {\n lastPXManager && characterController._destroyPXController();\n characterController._createPXController(this, shape);\n }\n this._addColliderShape(shape._id);\n }\n }\n characterController._pxManager = this;\n }\n\n /**\n * {@inheritDoc IPhysicsScene.removeCharacterController }\n */\n removeCharacterController(characterController: PhysXCharacterController): void {\n characterController._scene = null;\n characterController._pxManager = null;\n characterController._destroyPXController();\n const shape = characterController._shape;\n shape && this._removeColliderShape(shape._id);\n }\n\n /**\n * {@inheritDoc IPhysicsScene.update }\n */\n update(elapsedTime: number): void {\n this._contactEventCount = 0;\n this._simulate(elapsedTime);\n this._fetchResults();\n }\n\n /**\n * {@inheritDoc IPhysicsScene.updateEvents }\n */\n updateEvents(): IPhysicsEvents {\n const physicsEvents = this._physicsEvents;\n\n // Collect trigger events: snapshot state for dispatch, then advance\n const {\n _triggerEventPool: triggerEventPool,\n _activeTriggers: activeTriggers,\n _triggerEvents: triggerEvents\n } = this;\n triggerEvents.length = 0;\n activeTriggers.forEach((event, i) => {\n event.dispatchState = event.state;\n triggerEvents.push(event);\n if (event.state === PhysicsEventState.Enter) {\n event.state = PhysicsEventState.Stay;\n } else if (event.state === PhysicsEventState.Exit) {\n activeTriggers.deleteByIndex(i);\n triggerEventPool.push(event);\n }\n });\n\n physicsEvents.contactEvents = this._contactEvents;\n physicsEvents.contactEventCount = this._contactEventCount;\n physicsEvents.triggerEvents = triggerEvents;\n return physicsEvents;\n }\n\n /**\n * {@inheritDoc IPhysicsScene.raycast }\n */\n raycast(\n ray: Ray,\n distance: number,\n onRaycast: (obj: number) => boolean,\n hit?: (shapeUniqueID: number, distance: number, position: Vector3, normal: Vector3) => void\n ): boolean {\n const { _pxRaycastHit: pxHitResult } = this;\n distance = Math.min(distance, 3.4e38); // float32 max value limit in physX raycast.\n\n const raycastCallback = {\n preFilter: (filterData, index, actor) => {\n if (onRaycast(index)) {\n return 2; // eBLOCK\n } else {\n return 0; // eNONE\n }\n },\n postFilter: (filterData, distance) => {\n if (distance <= 0) {\n return 0; // eNONE — skip initial overlap\n }\n return 2; // eBLOCK\n }\n };\n\n const pxRaycastCallback = this._physXPhysics._physX.PxQueryFilterCallback.implement(raycastCallback);\n const result = this._pxScene.raycastSingle(\n ray.origin,\n ray.direction,\n distance,\n pxHitResult,\n this._pxFilterData,\n pxRaycastCallback\n );\n\n pxRaycastCallback.delete();\n\n if (result && hit != undefined) {\n const { _tempPosition: position, _tempNormal: normal } = PhysXPhysicsScene;\n const { position: pxPosition, normal: pxNormal } = pxHitResult;\n position.set(pxPosition.x, pxPosition.y, pxPosition.z);\n normal.set(pxNormal.x, pxNormal.y, pxNormal.z);\n\n hit(pxHitResult.getShape().getUUID(), pxHitResult.distance, position, normal);\n }\n return result;\n }\n\n /**\n * {@inheritDoc IPhysicsScene.boxCast }\n */\n boxCast(\n center: Vector3,\n orientation: Quaternion,\n halfExtents: Vector3,\n direction: Vector3,\n distance: number,\n onSweep: (obj: number) => boolean,\n outHitResult?: (shapeUniqueID: number, distance: number, position: Vector3, normal: Vector3) => void\n ): boolean {\n if (!this._boxGeometry) {\n this._boxGeometry = new this._physXPhysics._physX.PxBoxGeometry(halfExtents.x, halfExtents.y, halfExtents.z);\n } else {\n this._boxGeometry.halfExtents = halfExtents;\n }\n\n const pose = PhysXPhysicsScene._tempPose;\n pose.translation.copyFrom(center);\n pose.rotation.copyFrom(orientation);\n return this._sweepSingle(this._boxGeometry, pose, direction, distance, onSweep, outHitResult);\n }\n\n /**\n * {@inheritDoc IPhysicsScene.sphereCast }\n */\n sphereCast(\n center: Vector3,\n radius: number,\n direction: Vector3,\n distance: number,\n onSweep: (obj: number) => boolean,\n outHitResult?: (shapeUniqueID: number, distance: number, position: Vector3, normal: Vector3) => void\n ): boolean {\n if (!this._sphereGeometry) {\n this._sphereGeometry = new this._physXPhysics._physX.PxSphereGeometry(radius);\n } else {\n this._sphereGeometry.radius = radius;\n }\n\n const tempQuat = PhysXPhysicsScene._tempQuaternion;\n tempQuat.set(0, 0, 0, 1); // Identity quaternion\n const pose = { translation: center, rotation: tempQuat };\n return this._sweepSingle(this._sphereGeometry, pose, direction, distance, onSweep, outHitResult);\n }\n\n /**\n * {@inheritDoc IPhysicsScene.capsuleCast }\n */\n capsuleCast(\n center: Vector3,\n radius: number,\n height: number,\n orientation: Quaternion,\n direction: Vector3,\n distance: number,\n onSweep: (obj: number) => boolean,\n outHitResult?: (shapeUniqueID: number, distance: number, position: Vector3, normal: Vector3) => void\n ): boolean {\n if (!this._capsuleGeometry) {\n this._capsuleGeometry = new this._physXPhysics._physX.PxCapsuleGeometry(radius, height * 0.5);\n } else {\n this._capsuleGeometry.radius = radius;\n this._capsuleGeometry.halfHeight = height * 0.5;\n }\n\n const pose = PhysXPhysicsScene._tempPose;\n pose.translation.copyFrom(center);\n pose.rotation.copyFrom(orientation);\n return this._sweepSingle(this._capsuleGeometry, pose, direction, distance, onSweep, outHitResult);\n }\n\n /**\n * {@inheritDoc IPhysicsScene.overlapBoxAll }\n */\n overlapBoxAll(\n center: Vector3,\n orientation: Quaternion,\n halfExtents: Vector3,\n onOverlap: (obj: number) => boolean\n ): number[] {\n if (!this._boxGeometry) {\n this._boxGeometry = new this._physXPhysics._physX.PxBoxGeometry(halfExtents.x, halfExtents.y, halfExtents.z);\n } else {\n this._boxGeometry.halfExtents = halfExtents;\n }\n\n const pose = PhysXPhysicsScene._tempPose;\n pose.translation.copyFrom(center);\n pose.rotation.copyFrom(orientation);\n return this._overlapMultiple(this._boxGeometry, pose, onOverlap);\n }\n\n /**\n * {@inheritDoc IPhysicsScene.overlapSphereAll }\n */\n overlapSphereAll(center: Vector3, radius: number, onOverlap: (obj: number) => boolean): number[] {\n if (!this._sphereGeometry) {\n this._sphereGeometry = new this._physXPhysics._physX.PxSphereGeometry(radius);\n } else {\n this._sphereGeometry.radius = radius;\n }\n\n const tempQuat = PhysXPhysicsScene._tempQuaternion;\n tempQuat.set(0, 0, 0, 1);\n const pose = { translation: center, rotation: tempQuat };\n return this._overlapMultiple(this._sphereGeometry, pose, onOverlap);\n }\n\n /**\n * {@inheritDoc IPhysicsScene.overlapCapsuleAll }\n */\n overlapCapsuleAll(\n center: Vector3,\n radius: number,\n height: number,\n orientation: Quaternion,\n onOverlap: (obj: number) => boolean\n ): number[] {\n if (!this._capsuleGeometry) {\n this._capsuleGeometry = new this._physXPhysics._physX.PxCapsuleGeometry(radius, height * 0.5);\n } else {\n this._capsuleGeometry.radius = radius;\n this._capsuleGeometry.halfHeight = height * 0.5;\n }\n\n const pose = PhysXPhysicsScene._tempPose;\n pose.translation.copyFrom(center);\n pose.rotation.copyFrom(orientation);\n return this._overlapMultiple(this._capsuleGeometry, pose, onOverlap);\n }\n\n /**\n * {@inheritDoc IPhysicsScene.gc }\n */\n gc(): void {\n this._contactEvents.length = this._contactEventCount;\n }\n\n /**\n * {@inheritDoc IPhysicsScene.destroy }\n */\n destroy(): void {\n this._boxGeometry?.delete();\n this._sphereGeometry?.delete();\n this._capsuleGeometry?.delete();\n\n this._physXSimulationCallbackInstance.delete();\n this._pxRaycastHit.delete();\n this._pxFilterData.flags.delete();\n this._pxFilterData.delete();\n // Need to release the controller manager before release the scene.\n this._pxControllerManager?.release();\n this._pxScene.release();\n }\n\n /**\n * @internal\n */\n _getControllerManager(): any {\n let pxControllerManager = this._pxControllerManager;\n if (pxControllerManager === null) {\n this._pxControllerManager = pxControllerManager = this._pxScene.createControllerManager();\n }\n return pxControllerManager;\n }\n\n /**\n * @internal\n */\n _addColliderShape(id: number) {\n this._physXManager._eventMap[id] = Object.create(null);\n }\n\n /**\n * @internal\n */\n _removeColliderShape(id: number) {\n const { _triggerEventPool: triggerEventPool, _activeTriggers: activeTriggers } = this;\n const { _eventMap: eventMap } = this._physXManager;\n activeTriggers.forEach((event, i) => {\n if (event.index1 == id) {\n activeTriggers.deleteByIndex(i);\n triggerEventPool.push(event);\n } else if (event.index2 == id) {\n activeTriggers.deleteByIndex(i);\n triggerEventPool.push(event);\n // If the shape is big index, should clear from the small index shape subMap\n eventMap[event.index1][id] = undefined;\n }\n });\n delete eventMap[id];\n }\n\n private _sweepSingle(\n geometry: any,\n pose: { translation: Vector3; rotation: Quaternion },\n direction: Vector3,\n distance: number,\n onSweep: (obj: number) => boolean,\n outHitResult?: (shapeUniqueID: number, distance: number, position: Vector3, normal: Vector3) => void\n ): boolean {\n distance = Math.min(distance, 3.4e38); // float32 max value limit in physx sweep\n\n const sweepCallback = {\n preFilter: (filterData, index, actor) => {\n if (onSweep(index)) {\n return 2; // eBLOCK\n } else {\n return 0; // eNONE\n }\n },\n postFilter: (filterData, distance) => {\n if (distance <= 0) {\n return 0; // eNONE — skip initial overlap\n }\n return 2; // eBLOCK\n }\n };\n\n const pxSweepCallback = this._physXPhysics._physX.PxQueryFilterCallback.implement(sweepCallback);\n const pxSweepHit = new this._physXPhysics._physX.PxSweepHit();\n const result = this._pxScene.sweepSingle(\n geometry,\n pose,\n direction,\n distance,\n pxSweepHit,\n this._pxFilterData,\n pxSweepCallback\n );\n\n if (result && outHitResult != undefined) {\n const { _tempPosition: position, _tempNormal: normal } = PhysXPhysicsScene;\n const { position: pxPosition, normal: pxNormal } = pxSweepHit;\n position.set(pxPosition.x, pxPosition.y, pxPosition.z);\n normal.set(pxNormal.x, pxNormal.y, pxNormal.z);\n outHitResult(pxSweepHit.getShape().getUUID(), pxSweepHit.distance, position, normal);\n }\n\n pxSweepCallback.delete();\n pxSweepHit.delete();\n\n return result;\n }\n\n private _overlapMultiple(\n geometry: any,\n pose: { translation: Vector3; rotation: Quaternion },\n onOverlap: (obj: number) => boolean\n ): number[] {\n const overlapCallback = {\n preFilter: (filterData, index, actor) => (onOverlap(index) ? 2 : 0)\n };\n\n const pxOverlapCallback = this._physXPhysics._physX.PxQueryFilterCallback.implement(overlapCallback);\n const maxHits = 256;\n const hits: any = (this._pxScene as any).overlapMultiple(\n geometry,\n pose,\n maxHits,\n this._pxFilterData,\n pxOverlapCallback\n );\n\n const result = PhysXPhysicsScene._tempShapeIDs;\n result.length = 0;\n if (hits) {\n // PhysX overlapMultiple returns a collection with size() method\n for (let i = 0, n = hits.size(); i < n; i++) {\n result.push(hits.get(i).getShape().getUUID());\n }\n }\n\n pxOverlapCallback.delete();\n hits?.delete();\n return result;\n }\n\n private _simulate(elapsedTime: number): void {\n this._pxScene.simulate(elapsedTime, true);\n }\n\n private _fetchResults(block: boolean = true): void {\n this._pxScene.fetchResults(block);\n }\n\n private _getTrigger(index1: number, index2: number): TriggerEvent {\n let event: TriggerEvent;\n if (this._triggerEventPool.length) {\n event = this._triggerEventPool.pop();\n event.index1 = index1;\n event.index2 = index2;\n } else {\n event = new TriggerEvent(index1, index2);\n }\n this._physXManager._eventMap[index1][index2] = event;\n return event;\n }\n\n private _bufferContactEvent(collision: ICollision, state: number): void {\n const index = this._contactEventCount++;\n const event = (this._contactEvents[index] ||= new ContactEvent());\n event.shape0Id = collision.shape0Id;\n event.shape1Id = collision.shape1Id;\n event.state = state;\n\n // Copy contact points from PhysX (the native data is only valid during fetchResults)\n const nativeContacts = collision.getContacts();\n const count = nativeContacts.size();\n const bufferedContacts = event._bufferedContacts;\n bufferedContacts.contactCount = count;\n for (let i = 0; i < count; i++) {\n const src = nativeContacts.get(i);\n const dst = (bufferedContacts.contacts[i] ||= new BufferedContactPoint());\n dst.position.copyFrom(src.position);\n dst.normal.copyFrom(src.normal);\n dst.impulse.copyFrom(src.impulse);\n dst.separation = src.separation;\n }\n }\n}\n\n/**\n * Filtering flags for scene queries.\n */\nenum QueryFlag {\n STATIC = 1 << 0,\n DYNAMIC = 1 << 1,\n PRE_FILTER = 1 << 2,\n POST_FILTER = 1 << 3,\n ANY_HIT = 1 << 4,\n NO_BLOCK = 1 << 5\n}\n\nenum PhysicsEventState {\n Enter = 0,\n Stay = 1,\n Exit = 2\n}\n\n/**\n * Trigger event to store interactive object ids and state.\n */\nexport class TriggerEvent implements ITriggerEvent {\n state: number;\n dispatchState: number;\n index1: number;\n index2: number;\n\n constructor(index1: number, index2: number) {\n this.index1 = index1;\n this.index2 = index2;\n }\n}\n\n/**\n * Buffered contact point data, copied from PhysX during fetchResults.\n */\nclass BufferedContactPoint {\n position = new Vector3();\n normal = new Vector3();\n impulse = new Vector3();\n separation = 0;\n}\n\n/**\n * Contact event buffered from PhysX fetchResults callback.\n * Implements ICollision so it can be passed directly to the core layer.\n */\nclass BufferedContacts {\n contactCount = 0;\n contacts: BufferedContactPoint[] = [];\n\n size(): number {\n return this.contactCount;\n }\n\n get(index: number): BufferedContactPoint {\n return this.contacts[index];\n }\n}\n\nclass ContactEvent implements IContactEvent {\n state: number;\n shape0Id: number;\n shape1Id: number;\n\n /** @internal */\n _bufferedContacts = new BufferedContacts();\n\n get contactCount(): number {\n return this._bufferedContacts.contactCount;\n }\n\n getContacts(): BufferedContacts {\n return this._bufferedContacts;\n }\n}\n","import { IStaticCollider } from \"@galacean/engine-design\";\nimport { Quaternion, Vector3 } from \"@galacean/engine\";\nimport { PhysXCollider } from \"./PhysXCollider\";\nimport { PhysXPhysics } from \"./PhysXPhysics\";\n\n/**\n * A static collider component that will not move.\n * @remarks Mostly used for object which always stays at the same place and never moves around.\n */\nexport class PhysXStaticCollider extends PhysXCollider implements IStaticCollider {\n constructor(physXPhysics: PhysXPhysics, position: Vector3, rotation: Quaternion) {\n super(physXPhysics);\n this._pxActor = physXPhysics._pxPhysics.createRigidStatic(this._transform(position, rotation));\n }\n}\n","/**\n * PhysX runtime mode.\n */\nexport enum PhysXRuntimeMode {\n /** Use WebAssembly SIMD mode first, then WebAssembly as fallback. */\n Auto,\n /** WebAssembly mode. */\n WebAssembly,\n /** WebAssembly SIMD mode. */\n WebAssemblySIMD\n}\n","import { IJoint } from \"@galacean/engine-design\";\nimport { Quaternion, Vector3 } from \"@galacean/engine\";\nimport { PhysXCollider } from \"../PhysXCollider\";\nimport { PhysXPhysics } from \"../PhysXPhysics\";\n\n/**\n * a base interface providing common functionality for PhysX joints\n */\nexport class PhysXJoint implements IJoint {\n protected static _defaultVec = new Vector3();\n protected static _defaultQuat = new Quaternion();\n\n protected _pxJoint: any;\n protected _anchor: Vector3;\n protected _connectedAnchor: Vector3;\n protected _rotation: Quaternion = new Quaternion();\n protected _collider: PhysXCollider;\n private _breakForce: number = Number.MAX_VALUE;\n private _breakTorque: number = Number.MAX_VALUE;\n\n protected _physXPhysics: PhysXPhysics;\n\n constructor(physXPhysics: PhysXPhysics) {\n this._physXPhysics = physXPhysics;\n }\n\n /**\n * {@inheritDoc IJoint.setConnectedCollider }\n */\n setConnectedCollider(value: PhysXCollider): void {\n this._pxJoint.setActors(this._collider?._pxActor || null, value?._pxActor || null);\n }\n\n /**\n * {@inheritDoc IJoint.setConnectedAnchor }\n */\n setAnchor(value: Vector3): void {\n this._setLocalPose(0, value, PhysXJoint._defaultQuat);\n this._anchor = value;\n }\n\n /**\n * {@inheritDoc IJoint.setConnectedAnchor }\n */\n setConnectedAnchor(value: Vector3): void {\n this._setLocalPose(1, value, this._rotation);\n this._connectedAnchor = value;\n }\n\n setRotation(value: Quaternion): void {\n this._setLocalPose(1, this._connectedAnchor, value);\n this._rotation.copyFrom(value);\n }\n\n /**\n * {@inheritDoc IJoint.setMassScale }\n */\n setMassScale(value: number): void {\n this._pxJoint.setInvMassScale0(1 / value);\n }\n\n /**\n * {@inheritDoc IJoint.setConnectedMassScale }\n */\n setConnectedMassScale(value: number): void {\n this._pxJoint.setInvMassScale1(1 / value);\n }\n\n /**\n * {@inheritDoc IJoint.setInertiaScale }\n */\n setInertiaScale(value: number): void {\n this._pxJoint.setInvInertiaScale0(value);\n }\n\n /**\n * {@inheritDoc IJoint.setConnectedInertiaScale }\n */\n setConnectedInertiaScale(value: number): void {\n this._pxJoint.setInvInertiaScale1(value);\n }\n\n /**\n * {@inheritDoc IJoint.setBreakForce }\n */\n setBreakForce(value: number): void {\n this._breakForce = value;\n this._pxJoint.setBreakForce(this._breakForce, this._breakTorque);\n }\n\n /**\n * {@inheritDoc IJoint.setBreakTorque }\n */\n setBreakTorque(value: number): void {\n this._breakTorque = value;\n this._pxJoint.setBreakForce(this._breakForce, this._breakTorque);\n }\n\n /**\n * {@inheritDoc IJoint.destroy }\n */\n destroy(): void {\n if (!this._pxJoint) return;\n this._pxJoint.release();\n this._collider = null;\n }\n /**\n * Set the joint local pose for an actor.\n * @param actor 0 for the first actor, 1 for the second actor.\n * @param position the local position for the actor this joint\n * @param rotation the local rotation for the actor this joint\n */\n protected _setLocalPose(actor: number, position: Vector3, rotation: Quaternion): void {\n this._pxJoint.setLocalPose(actor, position, rotation);\n }\n}\n","import { IFixedJoint } from \"@galacean/engine-design\";\nimport { PhysXCollider } from \"../PhysXCollider\";\nimport { PhysXPhysics } from \"../PhysXPhysics\";\nimport { PhysXJoint } from \"./PhysXJoint\";\n\n/**\n * A fixed joint permits no relative movement between two colliders. ie the bodies are glued together.\n */\nexport class PhysXFixedJoint extends PhysXJoint implements IFixedJoint {\n constructor(physXPhysics: PhysXPhysics, collider: PhysXCollider) {\n super(physXPhysics);\n this._collider = collider;\n this._pxJoint = physXPhysics._pxPhysics.createFixedJoint(\n collider._pxActor,\n PhysXJoint._defaultVec,\n PhysXJoint._defaultQuat,\n null,\n PhysXJoint._defaultVec,\n PhysXJoint._defaultQuat\n );\n }\n}\n","import { IHingeJoint } from \"@galacean/engine-design\";\nimport { MathUtil, Quaternion, Vector3 } from \"@galacean/engine\";\nimport { PhysXCollider } from \"../PhysXCollider\";\nimport { PhysXPhysics } from \"../PhysXPhysics\";\nimport { PhysXJoint } from \"./PhysXJoint\";\n\n/**\n * A joint which behaves in a similar way to a hinge or axle.\n */\nexport class PhysXHingeJoint extends PhysXJoint implements IHingeJoint {\n protected static _xAxis = new Vector3(1, 0, 0);\n\n private _axis: Vector3;\n private _axisRotationQuaternion = new Quaternion();\n private _connectedAxisRotationQuaternion = new Quaternion();\n\n constructor(physXPhysics: PhysXPhysics, collider: PhysXCollider) {\n super(physXPhysics);\n this._collider = collider;\n this._pxJoint = physXPhysics._pxPhysics.createRevoluteJoint(\n collider._pxActor,\n PhysXJoint._defaultVec,\n PhysXJoint._defaultQuat,\n null,\n PhysXJoint._defaultVec,\n PhysXJoint._defaultQuat\n );\n }\n\n override setRotation(value: Quaternion): void {\n const axis = this._axis;\n this._rotation.copyFrom(value);\n axis && this.setAxis(axis);\n }\n\n /**\n * {@inheritDoc IHingeJoint.setAxis }\n */\n setAxis(value: Vector3): void {\n this._axis = value;\n const xAxis = PhysXHingeJoint._xAxis;\n const axisRotationQuaternion = this._axisRotationQuaternion;\n xAxis.set(1, 0, 0);\n const angle = Math.acos(Vector3.dot(xAxis, value));\n Vector3.cross(xAxis, value, xAxis);\n Quaternion.rotationAxisAngle(xAxis, angle, axisRotationQuaternion);\n this._setLocalPose(0, this._anchor, axisRotationQuaternion);\n const connectedAxisRotationQuaternion = this._connectedAxisRotationQuaternion;\n Quaternion.multiply(this._rotation, axisRotationQuaternion, connectedAxisRotationQuaternion);\n this._setLocalPose(1, this._connectedAnchor, connectedAxisRotationQuaternion);\n }\n\n override setAnchor(value: Vector3): void {\n this._setLocalPose(0, value, this._axisRotationQuaternion);\n this._anchor = value;\n }\n\n /**\n * {@inheritDoc IJoint.setConnectedAnchor }\n */\n override setConnectedAnchor(value: Vector3): void {\n this._setLocalPose(1, value, this._connectedAxisRotationQuaternion);\n this._connectedAnchor = value;\n }\n\n /**\n * {@inheritDoc IHingeJoint.getAngle }\n */\n getAngle(): number {\n return MathUtil.radianToDegree(this._pxJoint.getAngle());\n }\n\n /**\n * {@inheritDoc IHingeJoint.getVelocity }\n */\n getVelocity(): Readonly<number> {\n return this._pxJoint.getVelocity();\n }\n\n /**\n * {@inheritDoc IHingeJoint.setHardLimitCone }\n */\n setHardLimit(lowerLimit: number, upperLimit: number, contactDist: number): void {\n this._pxJoint.setHardLimit(MathUtil.degreeToRadian(lowerLimit), MathUtil.degreeToRadian(upperLimit), contactDist);\n }\n\n /**\n * {@inheritDoc IHingeJoint.setHardLimitCone }\n */\n setSoftLimit(lowerLimit: number, upperLimit: number, stiffness: number, damping: number): void {\n this._pxJoint.setSoftLimit(\n MathUtil.degreeToRadian(lowerLimit),\n MathUtil.degreeToRadian(upperLimit),\n stiffness,\n damping\n );\n }\n\n /**\n * {@inheritDoc IHingeJoint.setDriveVelocity }\n */\n setDriveVelocity(velocity: number, autowake: boolean = true): void {\n this._pxJoint.setDriveVelocity(velocity, autowake);\n }\n\n /**\n * {@inheritDoc IHingeJoint.setDriveForceLimit }\n */\n setDriveForceLimit(limit: number): void {\n this._pxJoint.setDriveForceLimit(limit);\n }\n\n /**\n * {@inheritDoc IHingeJoint.setDriveGearRatio }\n */\n setDriveGearRatio(ratio: number): void {\n this._pxJoint.setDriveGearRatio(ratio);\n }\n\n /**\n * {@inheritDoc IHingeJoint.setHingeJointFlag }\n */\n setHingeJointFlag(flag: number, value: boolean): void {\n this._pxJoint.setRevoluteJointFlag(flag, value);\n }\n}\n","import { PhysXPhysics } from \"../PhysXPhysics\";\nimport { PhysXJoint } from \"./PhysXJoint\";\nimport { ISpringJoint } from \"@galacean/engine-design\";\nimport { PhysXCollider } from \"../PhysXCollider\";\nimport { Vector3 } from \"@galacean/engine\";\n\n/**\n * a joint that maintains an upper or lower bound (or both) on the distance between two points on different objects\n */\nexport class PhysXSpringJoint extends PhysXJoint implements ISpringJoint {\n constructor(physXPhysics: PhysXPhysics, collider: PhysXCollider) {\n super(physXPhysics);\n this._collider = collider;\n this._pxJoint = physXPhysics._pxPhysics.createDistanceJoint(\n null,\n PhysXJoint._defaultVec,\n PhysXJoint._defaultQuat,\n collider._pxActor,\n PhysXJoint._defaultVec,\n PhysXJoint._defaultQuat\n );\n this._pxJoint.setDistanceJointFlag(2, true); // enable max distance;\n this._pxJoint.setDistanceJointFlag(4, true); // enable min distance;\n this._pxJoint.setDistanceJointFlag(8, true); // enable spring;\n }\n\n /**\n * {@inheritDoc ISpringJoint.setMinDistance }\n */\n setMinDistance(distance: number): void {\n this._pxJoint.setMinDistance(distance);\n }\n\n /**\n * {@inheritDoc ISpringJoint.setMaxDistance }\n */\n setMaxDistance(distance: number): void {\n this._pxJoint.setMaxDistance(distance);\n }\n\n /**\n * {@inheritDoc ISpringJoint.setTolerance }\n */\n setTolerance(tolerance: number): void {\n this._pxJoint.setTolerance(tolerance);\n }\n\n /**\n * {@inheritDoc ISpringJoint.setStiffness }\n */\n setStiffness(stiffness: number): void {\n this._pxJoint.setStiffness(stiffness);\n }\n\n /**\n * {@inheritDoc ISpringJoint.setDamping }\n */\n setDamping(damping: number): void {\n this._pxJoint.setDamping(damping);\n }\n}\n","function _assert_this_initialized(self) {\n if (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n\n return self;\n}\nexport { _assert_this_initialized as _ };\n","function _type_of(obj) {\n \"@swc/helpers - typeof\";\n\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nexport { _type_of as _ };\n","import { _ as _assert_this_initialized } from \"./_assert_this_initialized.js\";\nimport { _ as _type_of } from \"./_type_of.js\";\n\nfunction _possible_constructor_return(self, call) {\n if (call && (_type_of(call) === \"object\" || typeof call === \"function\")) return call;\n\n return _assert_this_initialized(self);\n}\nexport { _possible_constructor_return as _ };\n","import { MeshColliderShapeCookingFlag, Vector3 } from \"@galacean/engine\";\nimport { IMeshColliderShape } from \"@galacean/engine-design\";\nimport { PhysXPhysics } from \"../PhysXPhysics\";\nimport { PhysXPhysicsMaterial } from \"../PhysXPhysicsMaterial\";\nimport { PhysXColliderShape, ShapeFlag } from \"./PhysXColliderShape\";\n\n/**\n * Mesh collider shape in PhysX.\n */\nexport class PhysXMeshColliderShape extends PhysXColliderShape implements IMeshColliderShape {\n private static _tightBoundsFlag = 1; // eTIGHT_BOUNDS = 1 (1<<0)\n\n private _pxMesh: any = null;\n private _isConvex: boolean;\n\n constructor(\n physXPhysics: PhysXPhysics,\n uniqueID: number,\n positions: Vector3[],\n indices: Uint8Array | Uint16Array | Uint32Array | null,\n isConvex: boolean,\n material: PhysXPhysicsMaterial,\n cookingFlags: number\n ) {\n super(physXPhysics);\n this._isConvex = isConvex;\n\n if (!this._cookMesh(positions, indices, cookingFlags)) {\n return;\n }\n\n const { _physX: physX, _pxPhysics: physics } = physXPhysics;\n const { x: scaleX, y: scaleY, z: scaleZ } = this._worldScale;\n const shapeFlags = ShapeFlag.SCENE_QUERY_SHAPE | ShapeFlag.SIMULATION_SHAPE;\n const meshFlag = isConvex ? PhysXMeshColliderShape._tightBoundsFlag : 0;\n const createShapeFn = isConvex ? physX.createConvexMeshShape : physX.createTriMeshShape;\n\n this._pxShape = createShapeFn(\n this._pxMesh,\n scaleX,\n scaleY,\n scaleZ,\n meshFlag,\n shapeFlags,\n material._pxMaterial,\n physics\n );\n\n this._id = uniqueID;\n this._pxMaterial = material._pxMaterial;\n this._pxShape.setUUID(uniqueID);\n this._setLocalPose();\n }\n\n /**\n * {@inheritDoc IMeshColliderShape.setMeshData }\n */\n setMeshData(\n positions: Vector3[],\n indices: Uint8Array | Uint16Array | Uint32Array | null,\n isConvex: boolean,\n cookingFlags: number\n ): boolean {\n this._pxMesh?.release();\n this._pxGeometry?.delete();\n this._pxMesh = null;\n this._pxGeometry = null;\n this._isConvex = isConvex;\n\n if (!this._cookMesh(positions, indices, cookingFlags)) {\n return false;\n }\n\n this._pxShape.setGeometry(this._pxGeometry);\n return true;\n }\n\n /**\n * {@inheritDoc IColliderShape.setWorldScale }\n */\n override setWorldScale(scale: Vector3): void {\n super.setWorldScale(scale);\n this._updateGeometry();\n }\n\n /**\n * {@inheritDoc IColliderShape.destroy }\n */\n override destroy(): void {\n this._pxMesh?.release();\n super.destroy();\n }\n\n private _cookMesh(\n positions: Vector3[],\n indices: Uint8Array | Uint16Array | Uint32Array | null,\n cookingFlags: number\n ): boolean {\n const {\n _physX: physX,\n _pxPhysics: physics,\n _pxCooking: cooking,\n _pxCookingParams: cookingParams\n } = this._physXPhysics;\n\n // Apply per-shape cooking flags\n let preprocessFlags = 0;\n if (cookingFlags & MeshColliderShapeCookingFlag.VertexWelding) {\n preprocessFlags |= 1; // eWELD_VERTICES\n }\n if (!(cookingFlags & MeshColliderShapeCookingFlag.Cleaning)) {\n preprocessFlags |= 2; // eDISABLE_CLEAN_MESH\n }\n physX.setCookingMeshPreprocessParams(cookingParams, preprocessFlags);\n cooking.setParams(cookingParams);\n\n const verticesPtr = this._allocatePositions(positions);\n\n if (this._isConvex) {\n this._pxMesh = cooking.createConvexMesh(verticesPtr, positions.length, physics);\n physX._free(verticesPtr);\n\n if (!this._pxMesh) {\n this._logConvexCookingError(physX);\n return false;\n }\n } else {\n if (!indices) {\n physX._free(verticesPtr);\n console.error(\"PhysXMeshColliderShape: Triangle mesh requires indices.\");\n return false;\n }\n\n const isU32 = indices instanceof Uint32Array;\n const indicesPtr = this._allocateIndices(indices, isU32);\n this._pxMesh = cooking.createTriMesh(\n verticesPtr,\n positions.length,\n indicesPtr,\n indices.length / 3,\n !isU32,\n physics\n );\n physX._free(verticesPtr);\n physX._free(indicesPtr);\n\n if (!this._pxMesh) {\n this._logTriMeshCookingError(physX);\n return false;\n }\n }\n\n const { x: scaleX, y: scaleY, z: scaleZ } = this._worldScale;\n const meshFlag = this._isConvex ? PhysXMeshColliderShape._tightBoundsFlag : 0;\n this._pxGeometry = this._isConvex\n ? physX.createConvexMeshGeometry(this._pxMesh, scaleX, scaleY, scaleZ, meshFlag)\n : physX.createTriMeshGeometry(this._pxMesh, scaleX, scaleY, scaleZ, meshFlag);\n\n return true;\n }\n\n private _logConvexCookingError(physX: any): void {\n switch (physX.getLastConvexCookingResult()) {\n case 1: // eZERO_AREA_TEST_FAILED\n console.error(\n \"PhysXMeshColliderShape: Failed to create convex mesh. Could not find 4 vertices that do not form a zero-area triangle.\"\n );\n break;\n case 2: // ePOLYGONS_LIMIT_REACHED\n console.error(\n \"PhysXMeshColliderShape: Failed to create convex mesh within the maximum polygons limit (256). Consider simplifying the mesh.\"\n );\n break;\n default: // eFAILURE\n console.error(\"PhysXMeshColliderShape: Failed to create convex mesh. The input geometry may be invalid.\");\n break;\n }\n }\n\n private _logTriMeshCookingError(physX: any): void {\n switch (physX.getLastTriMeshCookingResult()) {\n case 1: // eLARGE_TRIANGLE\n console.error(\n \"PhysXMeshColliderShape: Failed to create triangle mesh. One of the triangles is too large. Consider tessellating large triangles.\"\n );\n break;\n default: // eFAILURE\n console.error(\"PhysXMeshColliderShape: Failed to create triangle mesh. The input geometry may be invalid.\");\n break;\n }\n }\n\n private _allocatePositions(positions: Vector3[]): number {\n const physX = this._physXPhysics._physX;\n const length = positions.length;\n const ptr = physX._malloc(length * 3 * 4);\n const view = new Float32Array(physX.HEAPF32.buffer, ptr, length * 3);\n for (let i = 0, offset = 0; i < length; i++, offset += 3) {\n positions[i].copyToArray(view, offset);\n }\n return ptr;\n }\n\n private _allocateIndices(indices: Uint8Array | Uint16Array | Uint32Array, isU32: boolean): number {\n const physX = this._physXPhysics._physX;\n // Uint8Array and Uint16Array both write as Uint16 (PhysX minimum index size)\n const TypedArrayCtor = isU32 ? Uint32Array : Uint16Array;\n const heap = isU32 ? physX.HEAPU32 : physX.HEAPU16;\n const ptr = physX._malloc(indices.length * TypedArrayCtor.BYTES_PER_ELEMENT);\n new TypedArrayCtor(heap.buffer, ptr, indices.length).set(indices);\n return ptr;\n }\n\n private _updateGeometry(): void {\n if (!this._pxMesh) return;\n const physX = this._physXPhysics._physX;\n const { x: scaleX, y: scaleY, z: scaleZ } = this._worldScale;\n const meshFlag = this._isConvex ? PhysXMeshColliderShape._tightBoundsFlag : 0;\n\n const newGeometry = this._isConvex\n ? physX.createConvexMeshGeometry(this._pxMesh, scaleX, scaleY, scaleZ, meshFlag)\n : physX.createTriMeshGeometry(this._pxMesh, scaleX, scaleY, scaleZ, meshFlag);\n\n this._pxGeometry.delete();\n this._pxGeometry = newGeometry;\n this._pxShape.setGeometry(this._pxGeometry);\n }\n}\n","import { IPlaneColliderShape } from \"@galacean/engine-design\";\nimport { Quaternion } from \"@galacean/engine\";\nimport { PhysXPhysics } from \"../PhysXPhysics\";\nimport { PhysXPhysicsMaterial } from \"../PhysXPhysicsMaterial\";\nimport { PhysXColliderShape } from \"./PhysXColliderShape\";\n\n/**\n * Plane collider shape in PhysX.\n */\nexport class PhysXPlaneColliderShape extends PhysXColliderShape implements IPlaneColliderShape {\n constructor(physXPhysics: PhysXPhysics, uniqueID: number, material: PhysXPhysicsMaterial) {\n super(physXPhysics);\n this._axis = new Quaternion(0, 0, PhysXColliderShape.halfSqrt, PhysXColliderShape.halfSqrt);\n this._physXRotation.copyFrom(this._axis);\n\n this._pxGeometry = new physXPhysics._physX.PxPlaneGeometry();\n this._initialize(material, uniqueID);\n this._setLocalPose();\n }\n}\n","import { Vector3 } from \"@galacean/engine\";\nimport { ISphereColliderShape } from \"@galacean/engine-design\";\nimport { PhysXPhysics } from \"../PhysXPhysics\";\nimport { PhysXPhysicsMaterial } from \"../PhysXPhysicsMaterial\";\nimport { PhysXColliderShape } from \"./PhysXColliderShape\";\n\n/**\n * Sphere collider shape in PhysX.\n */\nexport class PhysXSphereColliderShape extends PhysXColliderShape implements ISphereColliderShape {\n private _radius: number;\n private _maxScale: number = 1;\n\n constructor(physXPhysics: PhysXPhysics, uniqueID: number, radius: number, material: PhysXPhysicsMaterial) {\n super(physXPhysics);\n\n this._radius = radius;\n this._pxGeometry = new physXPhysics._physX.PxSphereGeometry(radius * this._maxScale);\n this._initialize(material, uniqueID);\n this._setLocalPose();\n }\n\n /**\n * {@inheritDoc ISphereColliderShape.setRadius }\n */\n setRadius(value: number): void {\n this._radius = value;\n this._pxGeometry.radius = value * this._maxScale;\n this._pxShape.setGeometry(this._pxGeometry);\n }\n\n /**\n * {@inheritDoc IColliderShape.setWorldScale }\n */\n override setWorldScale(scale: Vector3): void {\n super.setWorldScale(scale);\n\n this._maxScale = Math.max(Math.abs(scale.x), Math.abs(scale.y), Math.abs(scale.z));\n this._pxGeometry.radius = this._radius * this._maxScale;\n this._pxShape.setGeometry(this._pxGeometry);\n }\n}\n","import { Quaternion, SystemInfo, Vector3 } from \"@galacean/engine\";\nimport {\n IBoxColliderShape,\n ICapsuleColliderShape,\n ICharacterController,\n IDynamicCollider,\n IFixedJoint,\n IHingeJoint,\n IMeshColliderShape,\n IPhysics,\n IPhysicsManager,\n IPhysicsMaterial,\n IPhysicsScene,\n IPlaneColliderShape,\n ISphereColliderShape,\n ISpringJoint,\n IStaticCollider\n} from \"@galacean/engine-design\";\nimport { PhysXCharacterController } from \"./PhysXCharacterController\";\nimport { PhysXCollider } from \"./PhysXCollider\";\nimport { PhysXDynamicCollider } from \"./PhysXDynamicCollider\";\nimport { PhysXPhysicsManager } from \"./PhysXPhysicsManager\";\nimport { PhysXPhysicsMaterial } from \"./PhysXPhysicsMaterial\";\nimport { PhysXPhysicsScene } from \"./PhysXPhysicsScene\";\nimport { PhysXStaticCollider } from \"./PhysXStaticCollider\";\nimport { PhysXRuntimeMode } from \"./enum/PhysXRuntimeMode\";\nimport { PhysXFixedJoint } from \"./joint/PhysXFixedJoint\";\nimport { PhysXHingeJoint } from \"./joint/PhysXHingeJoint\";\nimport { PhysXSpringJoint } from \"./joint/PhysXSpringJoint\";\nimport { PhysXBoxColliderShape } from \"./shape/PhysXBoxColliderShape\";\nimport { PhysXCapsuleColliderShape } from \"./shape/PhysXCapsuleColliderShape\";\nimport { PhysXMeshColliderShape } from \"./shape/PhysXMeshColliderShape\";\nimport { PhysXPlaneColliderShape } from \"./shape/PhysXPlaneColliderShape\";\nimport { PhysXSphereColliderShape } from \"./shape/PhysXSphereColliderShape\";\n\n/**\n * PhysX object creation.\n */\n\nexport class PhysXPhysics implements IPhysics {\n /** @internal PhysX wasm object */\n _physX: any;\n /** @internal PhysX Foundation SDK singleton class */\n _pxFoundation: any;\n /** @internal PhysX physics object */\n _pxPhysics: any;\n /** @internal PhysX cooking object for mesh colliders */\n _pxCooking: any;\n /** @internal PhysX cooking params */\n _pxCookingParams: any;\n\n private _runTimeMode: PhysXRuntimeMode;\n private _initializeState: InitializeState = InitializeState.Uninitialized;\n private _initializePromise: Promise<void>;\n private _defaultErrorCallback: any;\n private _allocator: any;\n private _tolerancesScale: any;\n private _wasmSIMDModeUrl: string;\n private _wasmModeUrl: string;\n\n /**\n * Create a PhysXPhysics instance.\n * @param runtimeMode - Runtime mode, `Auto` prefers WebAssembly SIMD if supported @see {@link PhysXRuntimeMode}\n * @param runtimeUrls - Manually specify the runtime URLs\n */\n constructor(runtimeMode: PhysXRuntimeMode = PhysXRuntimeMode.Auto, runtimeUrls?: PhysXRuntimeUrls) {\n this._runTimeMode = runtimeMode;\n this._wasmSIMDModeUrl =\n runtimeUrls?.wasmSIMDModeUrl ??\n \"https://mdn.alipayobjects.com/rms/afts/file/A*iHrYQKBrgTAAAAAAQ4AAAAgAehQnAQ/physx.release.simd.js\";\n this._wasmModeUrl =\n runtimeUrls?.wasmModeUrl ??\n \"https://mdn.alipayobjects.com/rms/afts/file/A*DFuvR6Mv5C0AAAAAQ4AAAAgAehQnAQ/physx.release.js\";\n }\n\n /**\n * Initialize PhysXPhysics.\n * @param runtimeMode - Runtime mode\n * @returns Promise object\n */\n initialize(): Promise<void> {\n if (this._initializeState === InitializeState.Initialized) {\n return Promise.resolve();\n } else if (this._initializeState === InitializeState.Initializing) {\n return this._initializePromise;\n }\n\n this._initializeState = InitializeState.Initializing;\n let runtimeMode = this._runTimeMode;\n const scriptPromise = new Promise((resolve, reject) => {\n const script = document.createElement(\"script\");\n document.body.appendChild(script);\n script.async = true;\n script.onload = resolve;\n script.onerror = reject;\n if (runtimeMode == PhysXRuntimeMode.Auto) {\n runtimeMode = (SystemInfo as any)._detectSIMDSupported()\n ? PhysXRuntimeMode.WebAssemblySIMD\n : PhysXRuntimeMode.WebAssembly;\n }\n\n if (runtimeMode == PhysXRuntimeMode.WebAssemblySIMD) {\n script.src = this._wasmSIMDModeUrl;\n } else {\n script.src = this._wasmModeUrl;\n }\n });\n\n const initializePromise = new Promise<void>((resolve, reject) => {\n scriptPromise\n .then(\n () =>\n (<any>window).PHYSX().then((PHYSX: any) => {\n this._runTimeMode = runtimeMode;\n this._init(PHYSX);\n this._initializeState = InitializeState.Initialized;\n this._initializePromise = null;\n console.log(\"PhysX loaded.\");\n resolve();\n }, reject),\n reject\n )\n .catch(reject);\n });\n\n this._initializePromise = initializePromise;\n return initializePromise;\n }\n\n /**\n * Destroy PhysXPhysics.\n */\n destroy(): void {\n this._pxCooking.release();\n this._pxCookingParams.delete();\n this._physX.PxCloseExtensions();\n this._pxPhysics.release();\n this._pxFoundation.release();\n this._defaultErrorCallback.delete();\n this._allocator.delete();\n this._tolerancesScale.delete();\n }\n\n /**\n * {@inheritDoc IPhysics.createPhysicsManager }\n */\n createPhysicsManager(): IPhysicsManager {\n return new PhysXPhysicsManager();\n }\n\n /**\n * {@inheritDoc IPhysics.createPhysicsScene }\n */\n createPhysicsScene(physicsManager: PhysXPhysicsManager): IPhysicsScene {\n const scene = new PhysXPhysicsScene(this, physicsManager);\n return scene;\n }\n\n /**\n * {@inheritDoc IPhysics.createStaticCollider }\n */\n createStaticCollider(position: Vector3, rotation: Quaternion): IStaticCollider {\n return new PhysXStaticCollider(this, position, rotation);\n }\n\n /**\n * {@inheritDoc IPhysics.createDynamicCollider }\n */\n createDynamicCollider(position: Vector3, rotation: Quaternion): IDynamicCollider {\n return new PhysXDynamicCollider(this, position, rotation);\n }\n\n /**\n * {@inheritDoc IPhysics.createCharacterController }\n */\n createCharacterController(): ICharacterController {\n return new PhysXCharacterController(this);\n }\n\n /**\n * {@inheritDoc IPhysics.createPhysicsMaterial }\n */\n createPhysicsMaterial(\n staticFriction: number,\n dynamicFriction: number,\n bounciness: number,\n frictionCombine: number,\n bounceCombine: number\n ): IPhysicsMaterial {\n return new PhysXPhysicsMaterial(this, staticFriction, dynamicFriction, bounciness, frictionCombine, bounceCombine);\n }\n\n /**\n * {@inheritDoc IPhysics.createBoxColliderShape }\n */\n createBoxColliderShape(uniqueID: number, size: Vector3, material: PhysXPhysicsMaterial): IBoxColliderShape {\n return new PhysXBoxColliderShape(this, uniqueID, size, material);\n }\n\n /**\n * {@inheritDoc IPhysics.createSphereColliderShape }\n */\n createSphereColliderShape(uniqueID: number, radius: number, material: PhysXPhysicsMaterial): ISphereColliderShape {\n return new PhysXSphereColliderShape(this, uniqueID, radius, material);\n }\n\n /**\n * {@inheritDoc IPhysics.createPlaneColliderShape }\n */\n createPlaneColliderShape(uniqueID: number, material: PhysXPhysicsMaterial): IPlaneColliderShape {\n return new PhysXPlaneColliderShape(this, uniqueID, material);\n }\n\n /**\n * {@inheritDoc IPhysics.createCapsuleColliderShape }\n */\n createCapsuleColliderShape(\n uniqueID: number,\n radius: number,\n height: number,\n material: PhysXPhysicsMaterial\n ): ICapsuleColliderShape {\n return new PhysXCapsuleColliderShape(this, uniqueID, radius, height, material);\n }\n\n /**\n * {@inheritDoc IPhysics.createMeshColliderShape }\n */\n createMeshColliderShape(\n uniqueID: number,\n positions: Vector3[],\n indices: Uint8Array | Uint16Array | Uint32Array | null,\n isConvex: boolean,\n material: PhysXPhysicsMaterial,\n cookingFlags: number\n ): IMeshColliderShape | null {\n const shape = new PhysXMeshColliderShape(this, uniqueID, positions, indices, isConvex, material, cookingFlags);\n return shape._pxShape ? shape : null;\n }\n\n /**\n * {@inheritDoc IPhysics.createFixedJoint }\n */\n createFixedJoint(collider: PhysXCollider): IFixedJoint {\n return new PhysXFixedJoint(this, collider);\n }\n\n /**\n * {@inheritDoc IPhysics.createHingeJoint }\n */\n createHingeJoint(collider: PhysXCollider): IHingeJoint {\n return new PhysXHingeJoint(this, collider);\n }\n\n /**\n * {@inheritDoc IPhysics.createSpringJoint }\n */\n createSpringJoint(collider: PhysXCollider): ISpringJoint {\n return new PhysXSpringJoint(this, collider);\n }\n\n /**\n * {@inheritDoc IPhysics.getColliderLayerCollision }\n */\n getColliderLayerCollision(layer1: number, layer2: number): boolean {\n return this._physX.getGroupCollisionFlag(layer1, layer2);\n }\n\n /**\n * {@inheritDoc IPhysics.setColliderLayerCollision }\n */\n setColliderLayerCollision(layer1: number, layer2: number, isCollide: boolean): void {\n this._physX.setGroupCollisionFlag(layer1, layer2, isCollide);\n }\n\n private _init(physX: any): void {\n const version = physX.PX_PHYSICS_VERSION;\n const defaultErrorCallback = new physX.PxDefaultErrorCallback();\n const allocator = new physX.PxDefaultAllocator();\n const pxFoundation = physX.PxCreateFoundation(version, allocator, defaultErrorCallback);\n const tolerancesScale = new physX.PxTolerancesScale();\n const pxPhysics = physX.PxCreatePhysics(version, pxFoundation, tolerancesScale, false, null);\n\n physX.PxInitExtensions(pxPhysics, null);\n\n // Initialize cooking for mesh colliders\n const cookingParams = new physX.PxCookingParams(tolerancesScale);\n physX.setCookingMeshPreprocessParams(cookingParams, 1); // eWELD_VERTICES\n cookingParams.meshWeldTolerance = 0.001;\n // BVH34 midphase requires SSE2; SIMD WASM provides SSE2 via WASM SIMD\n if (this._runTimeMode === PhysXRuntimeMode.WebAssemblySIMD) {\n physX.setCookingMidphaseType(cookingParams, 1); // eBVH34\n }\n const pxCooking = physX.PxCreateCooking(version, pxFoundation, cookingParams);\n\n this._physX = physX;\n this._pxFoundation = pxFoundation;\n this._pxPhysics = pxPhysics;\n this._pxCooking = pxCooking;\n this._pxCookingParams = cookingParams;\n this._defaultErrorCallback = defaultErrorCallback;\n this._allocator = allocator;\n this._tolerancesScale = tolerancesScale;\n }\n}\n\nenum InitializeState {\n Uninitialized,\n Initializing,\n Initialized\n}\n\ninterface PhysXRuntimeUrls {\n /*** The URL of `PhysXRuntimeMode.WebAssembly` mode. */\n wasmModeUrl?: string;\n /*** The URL of `PhysXRuntimeMode.WebAssemblySIMD` mode. */\n wasmSIMDModeUrl?: string;\n}\n","export { PhysXPhysics } from \"./PhysXPhysics\";\nexport { PhysXRuntimeMode } from \"./enum/PhysXRuntimeMode\";\n\n//@ts-ignore\nexport const version = `__buildVersion`;\n\nconsole.log(`Galacean Engine Physics PhysX Version: ${version}`);\n"],"names":["ShapeFlag","PhysXColliderShape","physXPhysics","_controllers","DisorderedArray","_contractOffset","_worldScale","Vector3","_position","_rotation","_axis","_physXRotation","Quaternion","_shapeFlags","_physXPhysics","setRotation","value","rotation","set","MathUtil","degreeToRadian","x","y","z","rotationYawPitchRoll","multiply","normalize","_setLocalPose","setPosition","copyFrom","controllers","i","n","length","get","_updateShapePosition","setWorldScale","scale","Math","abs","setContactOffset","offset","_pxController","_pxShape","setMaterial","_pxMaterial","setIsTrigger","_modifyFlag","_setShapeFlags","pointDistance","point","info","_pxGeometry","getGlobalPose","closestPoint","res","_tempVector4","distance","destroy","release","delete","flags","shapeFlags","_physX","PxShapeFlags","setFlags","transform","translation","setLocalPose","_initialize","material","id","_id","_pxPhysics","createShape","setUUID","flag","halfSqrt","Vector4","PhysXBoxColliderShape","uniqueID","size","_halfSize","halfSize","PxBoxGeometry","setSize","tempExtents","_tempHalfExtents","halfExtents","setGeometry","_updateController","console","warn","extents","pxController","setHalfHeight","setHalfSideExtent","setHalfForwardExtent","PhysXCapsuleColliderShape","radius","height","_upAxis","_radius","_halfHeight","PxCapsuleGeometry","setRadius","sizeScale","max","setHeight","halfHeight","setUpAxis","upAxis","axis","physXRotation","geometry","ColliderShapeUpAxis","PhysXCharacterController","_scene","_shapeScaledPosition","_worldPosition","move","disp","minDist","elapsedTime","setWorldPosition","position","_updateNativePosition","getWorldPosition","getPosition","subtract","setStepOffset","setNonWalkableMode","setUpDirection","up","setSlopeLimit","slopeLimit","cos","PI","addShape","shape","_pxManager","_createPXController","_shape","add","_addColliderShape","removeShape","_destroyPXController","_removeColliderShape","setCollisionLayer","layer","actor","getActor","setGroup","pxManager","desc","PxBoxControllerDesc","halfSideExtent","halfForwardExtent","lengthSquared","PxCapsuleControllerDesc","climbingMode","Y","_getControllerManager","createController","shapePosition","worldScale","worldPosition","_tempVec","PhysXCollider","_shapes","Array","_pxActor","attachShape","push","detachShape","shapes","splice","indexOf","setWorldTransform","setGlobalPose","_transform","getWorldTransform","outPosition","outRotation","w","pos","rot","_tempTransform","PhysXDynamicCollider","createRigidDynamic","setLinearDamping","setAngularDamping","getLinearVelocity","out","velocity","setLinearVelocity","getAngularVelocity","radianToDegree","setAngularVelocity","_tempTranslation","setMass","getCenterOfMass","getCMassLocalPose","setCenterOfMass","setCMassLocalPose","setInertiaTensor","setMassSpaceInertiaTensor","getInertiaTensor","inertia","getMassSpaceInertiaTensor","setMassAndUpdateInertia","mass","setMaxAngularVelocity","setMaxDepenetrationVelocity","setSleepThreshold","setSolverIterations","setSolverIterationCounts","setCollisionDetectionMode","physX","setRigidBodyFlag","PxRigidBodyFlag","eENABLE_CCD","eENABLE_CCD_FRICTION","eENABLE_SPECULATIVE_CCD","setUseGravity","setActorFlag","PxActorFlag","eDISABLE_GRAVITY","setIsKinematic","eKINEMATIC","setConstraints","setRigidDynamicLockFlags","addForce","force","addTorque","torque","positionOrRotation","setKinematicTarget","tempTranslation","tempRotation","_tempRotation","sleep","putToSleep","isSleeping","wakeUp","PhysXPhysicsManager","_eventMap","PhysXPhysicsMaterial","staticFriction","dynamicFriction","bounciness","frictionCombine","bounceCombine","pxMaterial","createMaterial","setFrictionCombineMode","setRestitutionCombineMode","setBounciness","setRestitution","setDynamicFriction","setStaticFriction","setBounceCombine","setFrictionCombine","PhysXPhysicsScene","physicsManager","_pxControllerManager","_boxGeometry","_sphereGeometry","_capsuleGeometry","_activeTriggers","_contactEvents","_contactEventCount","_triggerEvents","_physicsEvents","contactEvents","contactEventCount","triggerEvents","_triggerEventPool","_physXManager","_pxRaycastHit","PxRaycastHit","_pxFilterData","PxQueryFilterData","PxQueryFlags","QueryFlag","triggerCallback","onContactBegin","collision","_bufferContactEvent","onContactEnd","onContactPersist","onTriggerBegin","index1","index2","event","_getTrigger","state","onTriggerEnd","subMap","undefined","pxPhysics","_physXSimulationCallbackInstance","PxSimulationEventCallback","implement","sceneDesc","getDefaultSceneDesc","getTolerancesScale","_pxScene","createScene","setGravity","addCollider","collider","addActor","removeCollider","removeActor","addCharacterController","characterController","lastPXManager","removeCharacterController","update","_simulate","_fetchResults","updateEvents","physicsEvents","triggerEventPool","activeTriggers","forEach","dispatchState","deleteByIndex","raycast","ray","onRaycast","hit","pxHitResult","min","raycastCallback","preFilter","filterData","index","postFilter","pxRaycastCallback","PxQueryFilterCallback","result","raycastSingle","origin","direction","_tempPosition","_tempNormal","normal","pxNormal","pxPosition","getShape","getUUID","boxCast","center","orientation","onSweep","outHitResult","pose","_tempPose","_sweepSingle","sphereCast","PxSphereGeometry","tempQuat","_tempQuaternion","capsuleCast","overlapBoxAll","onOverlap","_overlapMultiple","overlapSphereAll","overlapCapsuleAll","gc","pxControllerManager","createControllerManager","Object","create","eventMap","sweepCallback","pxSweepCallback","pxSweepHit","PxSweepHit","sweepSingle","overlapCallback","pxOverlapCallback","maxHits","hits","overlapMultiple","_tempShapeIDs","simulate","block","fetchResults","pop","TriggerEvent","ContactEvent","shape0Id","shape1Id","nativeContacts","getContacts","count","bufferedContacts","_bufferedContacts","contactCount","src","dst","contacts","BufferedContactPoint","impulse","separation","BufferedContacts","PhysXStaticCollider","createRigidStatic","PhysXRuntimeMode","PhysXJoint","_breakForce","Number","MAX_VALUE","_breakTorque","setConnectedCollider","_pxJoint","setActors","_collider","setAnchor","_defaultQuat","_anchor","setConnectedAnchor","_connectedAnchor","setMassScale","setInvMassScale0","setConnectedMassScale","setInvMassScale1","setInertiaScale","setInvInertiaScale0","setConnectedInertiaScale","setInvInertiaScale1","setBreakForce","setBreakTorque","_defaultVec","PhysXFixedJoint","createFixedJoint","PhysXHingeJoint","_axisRotationQuaternion","_connectedAxisRotationQuaternion","createRevoluteJoint","setAxis","xAxis","_xAxis","axisRotationQuaternion","angle","acos","dot","cross","rotationAxisAngle","connectedAxisRotationQuaternion","getAngle","getVelocity","setHardLimit","lowerLimit","upperLimit","contactDist","setSoftLimit","stiffness","damping","setDriveVelocity","autowake","setDriveForceLimit","limit","setDriveGearRatio","ratio","setHingeJointFlag","setRevoluteJointFlag","PhysXSpringJoint","createDistanceJoint","setDistanceJointFlag","setMinDistance","setMaxDistance","setTolerance","tolerance","setStiffness","setDamping","PhysXMeshColliderShape","positions","indices","isConvex","cookingFlags","_pxMesh","_isConvex","_cookMesh","physics","scaleY","scaleZ","SCENE_QUERY_SHAPE","SIMULATION_SHAPE","meshFlag","_tightBoundsFlag","createShapeFn","createConvexMeshShape","createTriMeshShape","scaleX","setMeshData","_updateGeometry","_pxCooking","cooking","_pxCookingParams","cookingParams","preprocessFlags","MeshColliderShapeCookingFlag","VertexWelding","Cleaning","setCookingMeshPreprocessParams","setParams","verticesPtr","_allocatePositions","createConvexMesh","_free","_logConvexCookingError","error","isU32","Uint32Array","indicesPtr","_allocateIndices","createTriMesh","_logTriMeshCookingError","createConvexMeshGeometry","createTriMeshGeometry","getLastConvexCookingResult","getLastTriMeshCookingResult","ptr","_malloc","view","Float32Array","HEAPF32","buffer","copyToArray","TypedArrayCtor","Uint16Array","heap","HEAPU32","HEAPU16","BYTES_PER_ELEMENT","newGeometry","PhysXPlaneColliderShape","PxPlaneGeometry","PhysXSphereColliderShape","_maxScale","PhysXPhysics","runtimeMode","runtimeUrls","Auto","_initializeState","_runTimeMode","_wasmSIMDModeUrl","wasmSIMDModeUrl","_wasmModeUrl","wasmModeUrl","initialize","Promise","resolve","_initializePromise","scriptPromise","reject","script","document","createElement","body","appendChild","async","onload","onerror","SystemInfo","_detectSIMDSupported","WebAssemblySIMD","WebAssembly","initializePromise","then","window","PHYSX","_init","log","catch","PxCloseExtensions","_pxFoundation","_defaultErrorCallback","_allocator","_tolerancesScale","createPhysicsManager","createPhysicsScene","scene","createStaticCollider","createDynamicCollider","createCharacterController","createPhysicsMaterial","createBoxColliderShape","createSphereColliderShape","createPlaneColliderShape","createCapsuleColliderShape","createMeshColliderShape","createHingeJoint","createSpringJoint","getColliderLayerCollision","layer1","layer2","getGroupCollisionFlag","setColliderLayerCollision","isCollide","setGroupCollisionFlag","version","PX_PHYSICS_VERSION","defaultErrorCallback","PxDefaultErrorCallback","allocator","PxDefaultAllocator","pxFoundation","PxCreateFoundation","tolerancesScale","PxTolerancesScale","PxCreatePhysics","PxInitExtensions","PxCookingParams","meshWeldTolerance","setCookingMidphaseType","pxCooking","PxCreateCooking"],"mappings":";;;;;;IAAA,SAAS,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE;IAClC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;IACrF,QAAQ,OAAO,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;IACjD,KAAK,MAAM,OAAO,IAAI,YAAY,KAAK,CAAC;IACxC;;ICJA,SAAS,iBA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UAAW,8BAAgB;IAExClgB,OAAQse,CAAAA,GAAG,CAAE,yCAAyC4B,GAAAA,OAAAA,CAAAA;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@galacean/engine")):"function"==typeof define&&define.amd?define(["exports","@galacean/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).Galacean=t.Galacean||{},t.Galacean.PhysicsPhysX={}),t.Galacean)}(this,function(t,e){"use strict";function i(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}var n,r,a,l=((n={})[n.SIMULATION_SHAPE=1]="SIMULATION_SHAPE",n[n.SCENE_QUERY_SHAPE=2]="SCENE_QUERY_SHAPE",n[n.TRIGGER_SHAPE=4]="TRIGGER_SHAPE",n),h=/*#__PURE__*/function(){function t(t){this._controllers=new e.DisorderedArray,this._contractOffset=.02,this._worldScale=new e.Vector3(1,1,1),this._position=new e.Vector3,this._rotation=new e.Vector3,this._axis=null,this._physXRotation=new e.Quaternion,this._shapeFlags=3,this._physXPhysics=t}var i=t.prototype;return i.setRotation=function(t){var i=this._rotation.set(e.MathUtil.degreeToRadian(t.x),e.MathUtil.degreeToRadian(t.y),e.MathUtil.degreeToRadian(t.z));e.Quaternion.rotationYawPitchRoll(i.y,i.x,i.z,this._physXRotation),this._axis&&e.Quaternion.multiply(this._physXRotation,this._axis,this._physXRotation),this._physXRotation.normalize(),this._setLocalPose()},i.setPosition=function(t){t!==this._position&&this._position.copyFrom(t);for(var e=this._controllers,i=0,s=e.length;i<s;i++)e.get(i)._updateShapePosition(this._position,this._worldScale);this._setLocalPose()},i.setWorldScale=function(t){this._worldScale.set(Math.abs(t.x),Math.abs(t.y),Math.abs(t.z)),this._setLocalPose();for(var e=this._controllers,i=0,s=e.length;i<s;i++)e.get(i)._updateShapePosition(this._position,this._worldScale)},i.setContactOffset=function(t){this._contractOffset=t;var e=this._controllers;if(e.length)for(var i,s=0,o=e.length;s<o;s++)null==(i=e.get(s)._pxController)||i.setContactOffset(t);else this._pxShape.setContactOffset(t)},i.setMaterial=function(t){this._pxMaterial=t._pxMaterial,this._pxShape.setMaterial(this._pxMaterial)},i.setIsTrigger=function(t){this._modifyFlag(1,!t),this._modifyFlag(4,t),this._setShapeFlags(this._shapeFlags)},i.pointDistance=function(e){var i=this._pxGeometry.pointDistance(this._pxShape.getGlobalPose(),e),s=i.closestPoint,o=t._tempVector4;return o.set(s.x,s.y,s.z,i.distance),o},i.destroy=function(){var t;this._pxShape.release(),null==(t=this._pxGeometry)||t.delete()},i._setShapeFlags=function(t){this._shapeFlags=t;var e=new this._physXPhysics._physX.PxShapeFlags(this._shapeFlags);this._pxShape.setFlags(e),e.delete()},i._setLocalPose=function(){var i=t.transform;e.Vector3.multiply(this._position,this._worldScale,i.translation),i.rotation=this._physXRotation,this._pxShape.setLocalPose(i)},i._initialize=function(t,e){this._id=e,this._pxMaterial=t._pxMaterial;var i=new this._physXPhysics._physX.PxShapeFlags(this._shapeFlags);this._pxShape=this._physXPhysics._pxPhysics.createShape(this._pxGeometry,t._pxMaterial,!0,i),i.delete(),this._pxShape.setUUID(e)},i._modifyFlag=function(t,e){this._shapeFlags=e?this._shapeFlags|t:this._shapeFlags&~t},t}();h.halfSqrt=.70710678118655,h.transform={translation:new e.Vector3,rotation:null},h._tempVector4=new e.Vector4;var c=/*#__PURE__*/function(t){function i(i,s,o,n){(r=t.call(this,i)||this)._halfSize=new e.Vector3;var r,a=r._halfSize;return a.set(.5*o.x,.5*o.y,.5*o.z),r._pxGeometry=new i._physX.PxBoxGeometry(a.x,a.y,a.z),r._initialize(n,s),r._setLocalPose(),r}o(i,t);var s=i.prototype;return s.setSize=function(t){var s=this._halfSize,o=i._tempHalfExtents;s.set(.5*t.x,.5*t.y,.5*t.z),e.Vector3.multiply(s,this._worldScale,o),this._pxGeometry.halfExtents=o,this._pxShape.setGeometry(this._pxGeometry),this._updateController(o)},s.setRotation=function(e){t.prototype.setRotation.call(this,e),this._controllers.length>0&&console.warn("Box character controller `rotation` is not supported in PhysX and will be ignored")},s.setWorldScale=function(s){t.prototype.setWorldScale.call(this,s);var o=i._tempHalfExtents;e.Vector3.multiply(this._halfSize,this._worldScale,o),this._pxGeometry.halfExtents=o,this._pxShape.setGeometry(this._pxGeometry),this._updateController(o)},s._updateController=function(t){for(var e=this._controllers,i=0,s=e.length;i<s;i++){var o=e.get(i)._pxController;o&&(o.setHalfHeight(t.y),o.setHalfSideExtent(t.x),o.setHalfForwardExtent(t.z))}},i}(h);c._tempHalfExtents=new e.Vector3;var _=/*#__PURE__*/function(t){function i(i,s,o,n,r){var a;return(a=t.call(this,i)||this)._upAxis=1,a._radius=o,a._halfHeight=.5*n,a._axis=new e.Quaternion(0,0,h.halfSqrt,h.halfSqrt),a._physXRotation.copyFrom(a._axis),a._pxGeometry=new i._physX.PxCapsuleGeometry(o,a._halfHeight),a._initialize(r,s),a._setLocalPose(),a}o(i,t);var s=i.prototype;return s.setRadius=function(t){this._radius=t;var e,i=this._worldScale;switch(this._upAxis){case 0:this._pxGeometry.radius=this._radius*Math.max(i.y,i.z);break;case 1:this._pxGeometry.radius=this._radius*Math.max(i.x,i.z);break;case 2:this._pxGeometry.radius=this._radius*Math.max(i.x,i.y)}this._pxShape.setGeometry(this._pxGeometry);for(var s=this._pxGeometry.radius,o=this._controllers,n=0,r=o.length;n<r;n++)null==(e=o.get(n)._pxController)||e.setRadius(s)},s.setHeight=function(t){this._halfHeight=.5*t;var e,i=this._worldScale;switch(this._upAxis){case 0:this._pxGeometry.halfHeight=this._halfHeight*i.x;break;case 1:this._pxGeometry.halfHeight=this._halfHeight*i.y;break;case 2:this._pxGeometry.halfHeight=this._halfHeight*i.z}this._pxShape.setGeometry(this._pxGeometry);for(var s=2*this._pxGeometry.halfHeight,o=this._controllers,n=0,r=o.length;n<r;n++)null==(e=o.get(n)._pxController)||e.setHeight(s)},s.setRotation=function(e){t.prototype.setRotation.call(this,e),this._controllers.length>0&&console.warn("Capsule character controller `rotation` is not supported in PhysX and will be ignored")},s.setUpAxis=function(t){var i=this._rotation,s=this._axis,o=this._physXRotation;switch(this._upAxis=t,this._upAxis){case 0:s.set(0,0,0,1);break;case 1:s.set(0,0,h.halfSqrt,h.halfSqrt);break;case 2:s.set(0,h.halfSqrt,0,h.halfSqrt)}i?(e.Quaternion.rotationYawPitchRoll(i.y,i.x,i.z,o),e.Quaternion.multiply(o,s,o)):o.copyFrom(s),this._setLocalPose(),this._controllers.length>0&&console.warn("Capsule character controller `upAxis` is not supported in PhysX and will be ignored")},s.setWorldScale=function(e){t.prototype.setWorldScale.call(this,e);var i=this._worldScale,s=this._pxGeometry;switch(this._upAxis){case 0:s.radius=this._radius*Math.max(i.y,i.z),s.halfHeight=this._halfHeight*i.x;break;case 1:s.radius=this._radius*Math.max(i.x,i.z),s.halfHeight=this._halfHeight*i.y;break;case 2:s.radius=this._radius*Math.max(i.x,i.y),s.halfHeight=this._halfHeight*i.z}this._pxShape.setGeometry(s);for(var o=s.radius,n=2*s.halfHeight,r=this._controllers,a=0,l=r.length;a<l;a++){var h=r.get(a)._pxController;h&&(h.setRadius(o),h.setHeight(n))}},i}(h),p=((r={})[r.X=0]="X",r[r.Y=1]="Y",r[r.Z=2]="Z",r),u=/*#__PURE__*/function(){function t(t){this._scene=null,this._shapeScaledPosition=new e.Vector3,this._worldPosition=null,this._physXPhysics=t}var s=t.prototype;return s.move=function(t,e,i){var s,o;return null!=(o=null==(s=this._pxController)?void 0:s.move(t,e,i))?o:0},s.setWorldPosition=function(t){this._worldPosition=t,this._updateNativePosition()},s.getWorldPosition=function(t){this._pxController&&(t.copyFrom(this._pxController.getPosition()),t.subtract(this._shapeScaledPosition))},s.setStepOffset=function(t){var e;null==(e=this._pxController)||e.setStepOffset(t)},s.setNonWalkableMode=function(t){var e;null==(e=this._pxController)||e.setNonWalkableMode(t)},s.setUpDirection=function(t){var e;null==(e=this._pxController)||e.setUpDirection(t)},s.setSlopeLimit=function(t){var e;null==(e=this._pxController)||e.setSlopeLimit(Math.cos(t*Math.PI/180))},s.addShape=function(t){var e,i;this._updateShapePosition(t._position,t._worldScale),this._pxManager&&this._createPXController(this._pxManager,t),this._shape=t,t._controllers.add(this),null==(e=this._pxController)||e.setContactOffset(t._contractOffset),null==(i=this._scene)||i._addColliderShape(t._id)},s.removeShape=function(t){var e;this._destroyPXController(),this._shape=null,t._controllers.delete(this),null==(e=this._scene)||e._removeColliderShape(t._id)},s.setCollisionLayer=function(t){var e,i=null==(e=this._pxController)?void 0:e.getActor();i&&this._physXPhysics._physX.setGroup(i,t)},s.destroy=function(){this._destroyPXController()},s._createPXController=function(t,e){var s;if(i(e,c))(s=new this._physXPhysics._physX.PxBoxControllerDesc).halfHeight=e._halfSize.y,s.halfSideExtent=e._halfSize.x,s.halfForwardExtent=e._halfSize.z,e._rotation.lengthSquared()>0&&console.warn("Box character controller `rotation` is not supported in PhysX and will be ignored");else if(i(e,_))(s=new this._physXPhysics._physX.PxCapsuleControllerDesc).radius=e._radius,s.height=2*e._halfHeight,s.climbingMode=1,e._rotation.lengthSquared()>0&&console.warn("Capsule character controller `rotation` is not supported in PhysX and will be ignored"),e._upAxis!==p.Y&&console.warn("Capsule character controller `upAxis` is not supported in PhysX and will be ignored");else throw"unsupported shape type";s.setMaterial(e._pxMaterial),this._pxController=t._getControllerManager().createController(s),s.delete(),this._pxController.setUUID(e._id),this._updateNativePosition()},s._destroyPXController=function(){this._pxController&&(this._pxController.release(),this._pxController=null)},s._updateShapePosition=function(t,i){e.Vector3.multiply(t,i,this._shapeScaledPosition),this._updateNativePosition()},s._updateNativePosition=function(){var i=this._worldPosition;this._pxController&&i&&(e.Vector3.add(i,this._shapeScaledPosition,t._tempVec),this._pxController.setPosition(t._tempVec))},t}();u._tempVec=new e.Vector3;var d=/*#__PURE__*/function(){function t(t){this._scene=null,this._shapes=[],this._physXPhysics=t}var e=t.prototype;return e.addShape=function(t){var e;this._pxActor.attachShape(t._pxShape),this._shapes.push(t),null==(e=this._scene)||e._addColliderShape(t._id)},e.removeShape=function(t){this._pxActor.detachShape(t._pxShape,!0);var e,i=this._shapes;i.splice(i.indexOf(t),1),null==(e=this._scene)||e._removeColliderShape(t._id)},e.setWorldTransform=function(t,e){this._pxActor.setGlobalPose(this._transform(t,e),!0)},e.getWorldTransform=function(t,e){var i=this._pxActor.getGlobalPose();t.set(i.translation.x,i.translation.y,i.translation.z),e.set(i.rotation.x,i.rotation.y,i.rotation.z,i.rotation.w)},e.setCollisionLayer=function(t){this._physXPhysics._physX.setGroup(this._pxActor,t)},e.destroy=function(){this._pxActor.release()},e._transform=function(e,i){var s=t._tempTransform;return s.translation=e,s.rotation=i.normalize(),s},t}();d._tempTransform={translation:null,rotation:null};var y=/*#__PURE__*/function(t){function s(e,i,s){var o,n=(o=t.call(this,e)||this)._transform(i,s);return o._pxActor=e._pxPhysics.createRigidDynamic(n),o}o(s,t);var n=s.prototype;return n.setLinearDamping=function(t){this._pxActor.setLinearDamping(t)},n.setAngularDamping=function(t){this._pxActor.setAngularDamping(t)},n.getLinearVelocity=function(t){var e=this._pxActor.getLinearVelocity();return t.set(e.x,e.y,e.z)},n.setLinearVelocity=function(t){this._pxActor.setLinearVelocity(t,!0)},n.getAngularVelocity=function(t){var i=this._pxActor.getAngularVelocity();return t.set(e.MathUtil.radianToDegree(i.x),e.MathUtil.radianToDegree(i.y),e.MathUtil.radianToDegree(i.z))},n.setAngularVelocity=function(t){s._tempTranslation.set(e.MathUtil.degreeToRadian(t.x),e.MathUtil.degreeToRadian(t.y),e.MathUtil.degreeToRadian(t.z)),this._pxActor.setAngularVelocity(s._tempTranslation,!0)},n.setMass=function(t){this._pxActor.setMass(t)},n.getCenterOfMass=function(t){var e=this._pxActor.getCMassLocalPose().translation;return t.set(e.x,e.y,e.z)},n.setCenterOfMass=function(t){this._pxActor.setCMassLocalPose(t)},n.setInertiaTensor=function(t){this._pxActor.setMassSpaceInertiaTensor(t)},n.getInertiaTensor=function(t){var e=this._pxActor.getMassSpaceInertiaTensor();return t.set(e.x,e.y,e.z)},n.setMassAndUpdateInertia=function(t){this._pxActor.setMassAndUpdateInertia(t)},n.setMaxAngularVelocity=function(t){this._pxActor.setMaxAngularVelocity(e.MathUtil.degreeToRadian(t))},n.setMaxDepenetrationVelocity=function(t){this._pxActor.setMaxDepenetrationVelocity(t)},n.setSleepThreshold=function(t){this._pxActor.setSleepThreshold(t)},n.setSolverIterations=function(t){this._pxActor.setSolverIterationCounts(t,1)},n.setCollisionDetectionMode=function(t){var e=this._physXPhysics._physX;switch(t){case 1:this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eENABLE_CCD,!0),this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eENABLE_CCD_FRICTION,!1),this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eENABLE_SPECULATIVE_CCD,!1);break;case 2:this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eENABLE_CCD,!0),this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eENABLE_CCD_FRICTION,!0),this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eENABLE_SPECULATIVE_CCD,!1);break;case 3:this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eENABLE_CCD,!1),this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eENABLE_CCD_FRICTION,!1),this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eENABLE_SPECULATIVE_CCD,!0);break;case 0:this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eENABLE_CCD,!1),this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eENABLE_CCD_FRICTION,!1),this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eENABLE_SPECULATIVE_CCD,!1)}},n.setUseGravity=function(t){this._pxActor.setActorFlag(this._physXPhysics._physX.PxActorFlag.eDISABLE_GRAVITY,!t)},n.setIsKinematic=function(t){t?this._pxActor.setRigidBodyFlag(this._physXPhysics._physX.PxRigidBodyFlag.eKINEMATIC,!0):this._pxActor.setRigidBodyFlag(this._physXPhysics._physX.PxRigidBodyFlag.eKINEMATIC,!1)},n.setConstraints=function(t){this._pxActor.setRigidDynamicLockFlags(t)},n.addForce=function(t){this._pxActor.addForce({x:t.x,y:t.y,z:t.z})},n.addTorque=function(t){this._pxActor.addTorque({x:t.x,y:t.y,z:t.z})},n.move=function(t,o){if(o){this._pxActor.setKinematicTarget(t,o);return}var n=s._tempTranslation,r=s._tempRotation;this.getWorldTransform(n,r),i(t,e.Vector3)?this._pxActor.setKinematicTarget(t,r):this._pxActor.setKinematicTarget(n,t)},n.sleep=function(){return this._pxActor.putToSleep()},n.isSleeping=function(){return this._pxActor.isSleeping()},n.wakeUp=function(){return this._pxActor.wakeUp()},s}(d);y._tempTranslation=new e.Vector3,y._tempRotation=new e.Quaternion;var x=function(){this._eventMap={}},f=/*#__PURE__*/function(){function t(t,e,i,s,o,n){this._physXPhysics=t;var r=t._pxPhysics.createMaterial(e,i,s);r.setFrictionCombineMode(o),r.setRestitutionCombineMode(n),this._pxMaterial=r}var e=t.prototype;return e.setBounciness=function(t){this._pxMaterial.setRestitution(t)},e.setDynamicFriction=function(t){this._pxMaterial.setDynamicFriction(t)},e.setStaticFriction=function(t){this._pxMaterial.setStaticFriction(t)},e.setBounceCombine=function(t){this._pxMaterial.setRestitutionCombineMode(t)},e.setFrictionCombine=function(t){this._pxMaterial.setFrictionCombineMode(t)},e.destroy=function(){this._pxMaterial.release()},t}(),g=/*#__PURE__*/function(){function t(t,i){var s=this;this._pxControllerManager=null,this._boxGeometry=null,this._sphereGeometry=null,this._capsuleGeometry=null,this._activeTriggers=new e.DisorderedArray,this._contactEvents=[],this._contactEventCount=0,this._triggerEvents=[],this._physicsEvents={contactEvents:[],contactEventCount:0,triggerEvents:[]},this._triggerEventPool=[],this._physXPhysics=t,this._physXManager=i;var o=t._physX;this._pxRaycastHit=new o.PxRaycastHit,this._pxFilterData=new o.PxQueryFilterData,this._pxFilterData.flags=new o.PxQueryFlags(15);var n=t._pxPhysics;this._physXSimulationCallbackInstance=o.PxSimulationEventCallback.implement({onContactBegin:function(t){s._bufferContactEvent(t,0)},onContactEnd:function(t){s._bufferContactEvent(t,2)},onContactPersist:function(t){s._bufferContactEvent(t,1)},onTriggerBegin:function(t,e){var i=t<e?s._getTrigger(t,e):s._getTrigger(e,t);i.state=0,s._activeTriggers.add(i)},onTriggerEnd:function(t,e){var i;if(t<e){var o=s._physXManager._eventMap[t];i=o[e],o[e]=void 0}else{var n=s._physXManager._eventMap[e];i=n[t],n[t]=void 0}i.state=2}});var r=o.getDefaultSceneDesc(n.getTolerancesScale(),0,this._physXSimulationCallbackInstance);this._pxScene=n.createScene(r),r.delete()}var i=t.prototype;return i.setGravity=function(t){this._pxScene.setGravity(t)},i.addCollider=function(t){t._scene=this,this._pxScene.addActor(t._pxActor,null);for(var e=t._shapes,i=0,s=e.length;i<s;i++)this._addColliderShape(e[i]._id)},i.removeCollider=function(t){t._scene=null,this._pxScene.removeActor(t._pxActor,!0);for(var e=t._shapes,i=0,s=e.length;i<s;i++)this._removeColliderShape(e[i]._id)},i.addCharacterController=function(t){if(t._scene=this,!t._pxController){var e=t._shape;if(e){var i=t._pxManager;i!==this&&(i&&t._destroyPXController(),t._createPXController(this,e)),this._addColliderShape(e._id)}}t._pxManager=this},i.removeCharacterController=function(t){t._scene=null,t._pxManager=null,t._destroyPXController();var e=t._shape;e&&this._removeColliderShape(e._id)},i.update=function(t){this._contactEventCount=0,this._simulate(t),this._fetchResults()},i.updateEvents=function(){var t=this._physicsEvents,e=this._triggerEventPool,i=this._activeTriggers,s=this._triggerEvents;return s.length=0,i.forEach(function(t,o){t.dispatchState=t.state,s.push(t),0===t.state?t.state=1:2===t.state&&(i.deleteByIndex(o),e.push(t))}),t.contactEvents=this._contactEvents,t.contactEventCount=this._contactEventCount,t.triggerEvents=s,t},i.raycast=function(e,i,s,o){var n=this._pxRaycastHit;i=Math.min(i,34e37);var r=this._physXPhysics._physX.PxQueryFilterCallback.implement({preFilter:function(t,e,i){return s(e)?2:0},postFilter:function(t,e){return e<=0?0:2}}),a=this._pxScene.raycastSingle(e.origin,e.direction,i,n,this._pxFilterData,r);if(r.delete(),a&&void 0!=o){var l=t._tempPosition,h=t._tempNormal,c=n.position,_=n.normal;l.set(c.x,c.y,c.z),h.set(_.x,_.y,_.z),o(n.getShape().getUUID(),n.distance,l,h)}return a},i.boxCast=function(e,i,s,o,n,r,a){this._boxGeometry?this._boxGeometry.halfExtents=s:this._boxGeometry=new this._physXPhysics._physX.PxBoxGeometry(s.x,s.y,s.z);var l=t._tempPose;return l.translation.copyFrom(e),l.rotation.copyFrom(i),this._sweepSingle(this._boxGeometry,l,o,n,r,a)},i.sphereCast=function(e,i,s,o,n,r){this._sphereGeometry?this._sphereGeometry.radius=i:this._sphereGeometry=new this._physXPhysics._physX.PxSphereGeometry(i);var a=t._tempQuaternion;return a.set(0,0,0,1),this._sweepSingle(this._sphereGeometry,{translation:e,rotation:a},s,o,n,r)},i.capsuleCast=function(e,i,s,o,n,r,a,l){this._capsuleGeometry?(this._capsuleGeometry.radius=i,this._capsuleGeometry.halfHeight=.5*s):this._capsuleGeometry=new this._physXPhysics._physX.PxCapsuleGeometry(i,.5*s);var h=t._tempPose;return h.translation.copyFrom(e),h.rotation.copyFrom(o),this._sweepSingle(this._capsuleGeometry,h,n,r,a,l)},i.overlapBoxAll=function(e,i,s,o){this._boxGeometry?this._boxGeometry.halfExtents=s:this._boxGeometry=new this._physXPhysics._physX.PxBoxGeometry(s.x,s.y,s.z);var n=t._tempPose;return n.translation.copyFrom(e),n.rotation.copyFrom(i),this._overlapMultiple(this._boxGeometry,n,o)},i.overlapSphereAll=function(e,i,s){this._sphereGeometry?this._sphereGeometry.radius=i:this._sphereGeometry=new this._physXPhysics._physX.PxSphereGeometry(i);var o=t._tempQuaternion;return o.set(0,0,0,1),this._overlapMultiple(this._sphereGeometry,{translation:e,rotation:o},s)},i.overlapCapsuleAll=function(e,i,s,o,n){this._capsuleGeometry?(this._capsuleGeometry.radius=i,this._capsuleGeometry.halfHeight=.5*s):this._capsuleGeometry=new this._physXPhysics._physX.PxCapsuleGeometry(i,.5*s);var r=t._tempPose;return r.translation.copyFrom(e),r.rotation.copyFrom(o),this._overlapMultiple(this._capsuleGeometry,r,n)},i.gc=function(){this._contactEvents.length=this._contactEventCount},i.destroy=function(){var t,e,i,s;null==(t=this._boxGeometry)||t.delete(),null==(e=this._sphereGeometry)||e.delete(),null==(i=this._capsuleGeometry)||i.delete(),this._physXSimulationCallbackInstance.delete(),this._pxRaycastHit.delete(),this._pxFilterData.flags.delete(),this._pxFilterData.delete(),null==(s=this._pxControllerManager)||s.release(),this._pxScene.release()},i._getControllerManager=function(){var t=this._pxControllerManager;return null===t&&(this._pxControllerManager=t=this._pxScene.createControllerManager()),t},i._addColliderShape=function(t){this._physXManager._eventMap[t]=Object.create(null)},i._removeColliderShape=function(t){var e=this._triggerEventPool,i=this._activeTriggers,s=this._physXManager._eventMap;i.forEach(function(o,n){o.index1==t?(i.deleteByIndex(n),e.push(o)):o.index2==t&&(i.deleteByIndex(n),e.push(o),s[o.index1][t]=void 0)}),delete s[t]},i._sweepSingle=function(e,i,s,o,n,r){o=Math.min(o,34e37);var a=this._physXPhysics._physX.PxQueryFilterCallback.implement({preFilter:function(t,e,i){return n(e)?2:0},postFilter:function(t,e){return e<=0?0:2}}),l=new this._physXPhysics._physX.PxSweepHit,h=this._pxScene.sweepSingle(e,i,s,o,l,this._pxFilterData,a);if(h&&void 0!=r){var c=t._tempPosition,_=t._tempNormal,p=l.position,u=l.normal;c.set(p.x,p.y,p.z),_.set(u.x,u.y,u.z),r(l.getShape().getUUID(),l.distance,c,_)}return a.delete(),l.delete(),h},i._overlapMultiple=function(e,i,s){var o=this._physXPhysics._physX.PxQueryFilterCallback.implement({preFilter:function(t,e,i){return s(e)?2:0}}),n=this._pxScene.overlapMultiple(e,i,256,this._pxFilterData,o),r=t._tempShapeIDs;if(r.length=0,n)for(var a=0,l=n.size();a<l;a++)r.push(n.get(a).getShape().getUUID());return o.delete(),null==n||n.delete(),r},i._simulate=function(t){this._pxScene.simulate(t,!0)},i._fetchResults=function(t){void 0===t&&(t=!0),this._pxScene.fetchResults(t)},i._getTrigger=function(t,e){var i;return this._triggerEventPool.length?((i=this._triggerEventPool.pop()).index1=t,i.index2=e):i=new m(t,e),this._physXManager._eventMap[t][e]=i,i},i._bufferContactEvent=function(t,e){var i=this._contactEventCount++,s=(l=this._contactEvents)[i]||(l[i]=new S);s.shape0Id=t.shape0Id,s.shape1Id=t.shape1Id,s.state=e;var o=t.getContacts(),n=o.size(),r=s._bufferedContacts;r.contactCount=n;for(var a=0;a<n;a++){var l,h,c,_=o.get(a),p=(h=r.contacts)[c=a]||(h[c]=new v);p.position.copyFrom(_.position),p.normal.copyFrom(_.normal),p.impulse.copyFrom(_.impulse),p.separation=_.separation}},t}();g._tempPosition=new e.Vector3,g._tempQuaternion=new e.Quaternion,g._tempNormal=new e.Vector3,g._tempPose={translation:new e.Vector3,rotation:new e.Quaternion},g._tempShapeIDs=[];var m=function(t,e){this.index1=t,this.index2=e},v=function(){this.position=new e.Vector3,this.normal=new e.Vector3,this.impulse=new e.Vector3,this.separation=0},C=/*#__PURE__*/function(){function t(){this.contactCount=0,this.contacts=[]}var e=t.prototype;return e.size=function(){return this.contactCount},e.get=function(t){return this.contacts[t]},t}(),S=/*#__PURE__*/function(){function t(){this._bufferedContacts=new C}return t.prototype.getContacts=function(){return this._bufferedContacts},function(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}(t.prototype,[{key:"contactCount",get:function(){return this._bufferedContacts.contactCount}}]),t}(),P=/*#__PURE__*/function(t){function e(e,i,s){var o;return(o=t.call(this,e)||this)._pxActor=e._pxPhysics.createRigidStatic(o._transform(i,s)),o}return o(e,t),e}(d),A=((a={})[a.Auto=0]="Auto",a[a.WebAssembly=1]="WebAssembly",a[a.WebAssemblySIMD=2]="WebAssemblySIMD",a),M=/*#__PURE__*/function(){function t(t){this._rotation=new e.Quaternion,this._breakForce=Number.MAX_VALUE,this._breakTorque=Number.MAX_VALUE,this._physXPhysics=t}var i=t.prototype;return i.setConnectedCollider=function(t){var e;this._pxJoint.setActors((null==(e=this._collider)?void 0:e._pxActor)||null,(null==t?void 0:t._pxActor)||null)},i.setAnchor=function(e){this._setLocalPose(0,e,t._defaultQuat),this._anchor=e},i.setConnectedAnchor=function(t){this._setLocalPose(1,t,this._rotation),this._connectedAnchor=t},i.setRotation=function(t){this._setLocalPose(1,this._connectedAnchor,t),this._rotation.copyFrom(t)},i.setMassScale=function(t){this._pxJoint.setInvMassScale0(1/t)},i.setConnectedMassScale=function(t){this._pxJoint.setInvMassScale1(1/t)},i.setInertiaScale=function(t){this._pxJoint.setInvInertiaScale0(t)},i.setConnectedInertiaScale=function(t){this._pxJoint.setInvInertiaScale1(t)},i.setBreakForce=function(t){this._breakForce=t,this._pxJoint.setBreakForce(this._breakForce,this._breakTorque)},i.setBreakTorque=function(t){this._breakTorque=t,this._pxJoint.setBreakForce(this._breakForce,this._breakTorque)},i.destroy=function(){this._pxJoint&&(this._pxJoint.release(),this._collider=null)},i._setLocalPose=function(t,e,i){this._pxJoint.setLocalPose(t,e,i)},t}();M._defaultVec=new e.Vector3,M._defaultQuat=new e.Quaternion;var w=/*#__PURE__*/function(t){function e(e,i){var s;return(s=t.call(this,e)||this)._collider=i,s._pxJoint=e._pxPhysics.createFixedJoint(i._pxActor,M._defaultVec,M._defaultQuat,null,M._defaultVec,M._defaultQuat),s}return o(e,t),e}(M),F=/*#__PURE__*/function(t){function i(i,s){var o;return(o=t.call(this,i)||this)._axisRotationQuaternion=new e.Quaternion,o._connectedAxisRotationQuaternion=new e.Quaternion,o._collider=s,o._pxJoint=i._pxPhysics.createRevoluteJoint(s._pxActor,M._defaultVec,M._defaultQuat,null,M._defaultVec,M._defaultQuat),o}o(i,t);var s=i.prototype;return s.setRotation=function(t){var e=this._axis;this._rotation.copyFrom(t),e&&this.setAxis(e)},s.setAxis=function(t){this._axis=t;var s=i._xAxis,o=this._axisRotationQuaternion;s.set(1,0,0);var n=Math.acos(e.Vector3.dot(s,t));e.Vector3.cross(s,t,s),e.Quaternion.rotationAxisAngle(s,n,o),this._setLocalPose(0,this._anchor,o);var r=this._connectedAxisRotationQuaternion;e.Quaternion.multiply(this._rotation,o,r),this._setLocalPose(1,this._connectedAnchor,r)},s.setAnchor=function(t){this._setLocalPose(0,t,this._axisRotationQuaternion),this._anchor=t},s.setConnectedAnchor=function(t){this._setLocalPose(1,t,this._connectedAxisRotationQuaternion),this._connectedAnchor=t},s.getAngle=function(){return e.MathUtil.radianToDegree(this._pxJoint.getAngle())},s.getVelocity=function(){return this._pxJoint.getVelocity()},s.setHardLimit=function(t,i,s){this._pxJoint.setHardLimit(e.MathUtil.degreeToRadian(t),e.MathUtil.degreeToRadian(i),s)},s.setSoftLimit=function(t,i,s,o){this._pxJoint.setSoftLimit(e.MathUtil.degreeToRadian(t),e.MathUtil.degreeToRadian(i),s,o)},s.setDriveVelocity=function(t,e){void 0===e&&(e=!0),this._pxJoint.setDriveVelocity(t,e)},s.setDriveForceLimit=function(t){this._pxJoint.setDriveForceLimit(t)},s.setDriveGearRatio=function(t){this._pxJoint.setDriveGearRatio(t)},s.setHingeJointFlag=function(t,e){this._pxJoint.setRevoluteJointFlag(t,e)},i}(M);F._xAxis=new e.Vector3(1,0,0);var E=/*#__PURE__*/function(t){function e(e,i){var s;return(s=t.call(this,e)||this)._collider=i,s._pxJoint=e._pxPhysics.createDistanceJoint(null,M._defaultVec,M._defaultQuat,i._pxActor,M._defaultVec,M._defaultQuat),s._pxJoint.setDistanceJointFlag(2,!0),s._pxJoint.setDistanceJointFlag(4,!0),s._pxJoint.setDistanceJointFlag(8,!0),s}o(e,t);var i=e.prototype;return i.setMinDistance=function(t){this._pxJoint.setMinDistance(t)},i.setMaxDistance=function(t){this._pxJoint.setMaxDistance(t)},i.setTolerance=function(t){this._pxJoint.setTolerance(t)},i.setStiffness=function(t){this._pxJoint.setStiffness(t)},i.setDamping=function(t){this._pxJoint.setDamping(t)},e}(M),b=/*#__PURE__*/function(t){function s(e,i,o,n,r,a,h){if((c=t.call(this,e)||this)._pxMesh=null,c._isConvex=r,!c._cookMesh(o,n,h))return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(c);var c,_=e._physX,p=e._pxPhysics,u=c._worldScale,d=u.x,y=u.y,x=u.z,f=l.SCENE_QUERY_SHAPE|l.SIMULATION_SHAPE,g=r?s._tightBoundsFlag:0,m=r?_.createConvexMeshShape:_.createTriMeshShape;return c._pxShape=m(c._pxMesh,d,y,x,g,f,a._pxMaterial,p),c._id=i,c._pxMaterial=a._pxMaterial,c._pxShape.setUUID(i),c._setLocalPose(),c}o(s,t);var n=s.prototype;return n.setMeshData=function(t,e,i,s){var o,n;return null==(o=this._pxMesh)||o.release(),null==(n=this._pxGeometry)||n.delete(),this._pxMesh=null,this._pxGeometry=null,this._isConvex=i,!!this._cookMesh(t,e,s)&&(this._pxShape.setGeometry(this._pxGeometry),!0)},n.setWorldScale=function(e){t.prototype.setWorldScale.call(this,e),this._updateGeometry()},n.destroy=function(){var e;null==(e=this._pxMesh)||e.release(),t.prototype.destroy.call(this)},n._cookMesh=function(t,o,n){var r=this._physXPhysics,a=r._physX,l=r._pxPhysics,h=r._pxCooking,c=r._pxCookingParams,_=0;n&e.MeshColliderShapeCookingFlag.VertexWelding&&(_|=1),n&e.MeshColliderShapeCookingFlag.Cleaning||(_|=2),a.setCookingMeshPreprocessParams(c,_),h.setParams(c);var p=this._allocatePositions(t);if(this._isConvex){if(this._pxMesh=h.createConvexMesh(p,t.length,l),a._free(p),!this._pxMesh)return this._logConvexCookingError(a),!1}else{if(!o)return a._free(p),console.error("PhysXMeshColliderShape: Triangle mesh requires indices."),!1;var u=i(o,Uint32Array),d=this._allocateIndices(o,u);if(this._pxMesh=h.createTriMesh(p,t.length,d,o.length/3,!u,l),a._free(p),a._free(d),!this._pxMesh)return this._logTriMeshCookingError(a),!1}var y=this._worldScale,x=y.x,f=y.y,g=y.z,m=this._isConvex?s._tightBoundsFlag:0;return this._pxGeometry=this._isConvex?a.createConvexMeshGeometry(this._pxMesh,x,f,g,m):a.createTriMeshGeometry(this._pxMesh,x,f,g,m),!0},n._logConvexCookingError=function(t){switch(t.getLastConvexCookingResult()){case 1:console.error("PhysXMeshColliderShape: Failed to create convex mesh. Could not find 4 vertices that do not form a zero-area triangle.");break;case 2:console.error("PhysXMeshColliderShape: Failed to create convex mesh within the maximum polygons limit (256). Consider simplifying the mesh.");break;default:console.error("PhysXMeshColliderShape: Failed to create convex mesh. The input geometry may be invalid.")}},n._logTriMeshCookingError=function(t){1===t.getLastTriMeshCookingResult()?console.error("PhysXMeshColliderShape: Failed to create triangle mesh. One of the triangles is too large. Consider tessellating large triangles."):console.error("PhysXMeshColliderShape: Failed to create triangle mesh. The input geometry may be invalid.")},n._allocatePositions=function(t){for(var e=this._physXPhysics._physX,i=t.length,s=e._malloc(12*i),o=new Float32Array(e.HEAPF32.buffer,s,3*i),n=0,r=0;n<i;n++,r+=3)t[n].copyToArray(o,r);return s},n._allocateIndices=function(t,e){var i=this._physXPhysics._physX,s=e?Uint32Array:Uint16Array,o=e?i.HEAPU32:i.HEAPU16,n=i._malloc(t.length*s.BYTES_PER_ELEMENT);return new s(o.buffer,n,t.length).set(t),n},n._updateGeometry=function(){if(this._pxMesh){var t=this._physXPhysics._physX,e=this._worldScale,i=e.x,o=e.y,n=e.z,r=this._isConvex?s._tightBoundsFlag:0,a=this._isConvex?t.createConvexMeshGeometry(this._pxMesh,i,o,n,r):t.createTriMeshGeometry(this._pxMesh,i,o,n,r);this._pxGeometry.delete(),this._pxGeometry=a,this._pxShape.setGeometry(this._pxGeometry)}},s}(h);b._tightBoundsFlag=1;var X=/*#__PURE__*/function(t){function i(i,s,o){var n;return(n=t.call(this,i)||this)._axis=new e.Quaternion(0,0,h.halfSqrt,h.halfSqrt),n._physXRotation.copyFrom(n._axis),n._pxGeometry=new i._physX.PxPlaneGeometry,n._initialize(o,s),n._setLocalPose(),n}return o(i,t),i}(h),G=/*#__PURE__*/function(t){function e(e,i,s,o){var n;return(n=t.call(this,e)||this)._maxScale=1,n._radius=s,n._pxGeometry=new e._physX.PxSphereGeometry(s*n._maxScale),n._initialize(o,i),n._setLocalPose(),n}o(e,t);var i=e.prototype;return i.setRadius=function(t){this._radius=t,this._pxGeometry.radius=t*this._maxScale,this._pxShape.setGeometry(this._pxGeometry)},i.setWorldScale=function(e){t.prototype.setWorldScale.call(this,e),this._maxScale=Math.max(Math.abs(e.x),Math.abs(e.y),Math.abs(e.z)),this._pxGeometry.radius=this._radius*this._maxScale,this._pxShape.setGeometry(this._pxGeometry)},e}(h),R=/*#__PURE__*/function(){function t(t,e){var i,s;void 0===t&&(t=A.Auto),this._initializeState=0,this._runTimeMode=t,this._wasmSIMDModeUrl=null!=(i=null==e?void 0:e.wasmSIMDModeUrl)?i:"https://mdn.alipayobjects.com/rms/afts/file/A*iHrYQKBrgTAAAAAAQ4AAAAgAehQnAQ/physx.release.simd.js",this._wasmModeUrl=null!=(s=null==e?void 0:e.wasmModeUrl)?s:"https://mdn.alipayobjects.com/rms/afts/file/A*DFuvR6Mv5C0AAAAAQ4AAAAgAehQnAQ/physx.release.js"}var i=t.prototype;return i.initialize=function(){var t=this;if(2===this._initializeState)return Promise.resolve();if(1===this._initializeState)return this._initializePromise;this._initializeState=1;var i=this._runTimeMode,s=new Promise(function(s,o){var n=document.createElement("script");document.body.appendChild(n),n.async=!0,n.onload=s,n.onerror=o,i==A.Auto&&(i=e.SystemInfo._detectSIMDSupported()?A.WebAssemblySIMD:A.WebAssembly),i==A.WebAssemblySIMD?n.src=t._wasmSIMDModeUrl:n.src=t._wasmModeUrl}),o=new Promise(function(e,o){s.then(function(){return window.PHYSX().then(function(s){t._runTimeMode=i,t._init(s),t._initializeState=2,t._initializePromise=null,console.log("PhysX loaded."),e()},o)},o).catch(o)});return this._initializePromise=o,o},i.destroy=function(){this._pxCooking.release(),this._pxCookingParams.delete(),this._physX.PxCloseExtensions(),this._pxPhysics.release(),this._pxFoundation.release(),this._defaultErrorCallback.delete(),this._allocator.delete(),this._tolerancesScale.delete()},i.createPhysicsManager=function(){return new x},i.createPhysicsScene=function(t){return new g(this,t)},i.createStaticCollider=function(t,e){return new P(this,t,e)},i.createDynamicCollider=function(t,e){return new y(this,t,e)},i.createCharacterController=function(){return new u(this)},i.createPhysicsMaterial=function(t,e,i,s,o){return new f(this,t,e,i,s,o)},i.createBoxColliderShape=function(t,e,i){return new c(this,t,e,i)},i.createSphereColliderShape=function(t,e,i){return new G(this,t,e,i)},i.createPlaneColliderShape=function(t,e){return new X(this,t,e)},i.createCapsuleColliderShape=function(t,e,i,s){return new _(this,t,e,i,s)},i.createMeshColliderShape=function(t,e,i,s,o,n){var r=new b(this,t,e,i,s,o,n);return r._pxShape?r:null},i.createFixedJoint=function(t){return new w(this,t)},i.createHingeJoint=function(t){return new F(this,t)},i.createSpringJoint=function(t){return new E(this,t)},i.getColliderLayerCollision=function(t,e){return this._physX.getGroupCollisionFlag(t,e)},i.setColliderLayerCollision=function(t,e,i){this._physX.setGroupCollisionFlag(t,e,i)},i._init=function(t){var e=t.PX_PHYSICS_VERSION,i=new t.PxDefaultErrorCallback,s=new t.PxDefaultAllocator,o=t.PxCreateFoundation(e,s,i),n=new t.PxTolerancesScale,r=t.PxCreatePhysics(e,o,n,!1,null);t.PxInitExtensions(r,null);var a=new t.PxCookingParams(n);t.setCookingMeshPreprocessParams(a,1),a.meshWeldTolerance=.001,this._runTimeMode===A.WebAssemblySIMD&&t.setCookingMidphaseType(a,1);var l=t.PxCreateCooking(e,o,a);this._physX=t,this._pxFoundation=o,this._pxPhysics=r,this._pxCooking=l,this._pxCookingParams=a,this._defaultErrorCallback=i,this._allocator=s,this._tolerancesScale=n},t}(),T="0.0.0-experimental-2.0-game";console.log("Galacean Engine Physics PhysX Version: "+T),t.PhysXPhysics=R,t.PhysXRuntimeMode=A,t.version=T,Object.defineProperty(t,"__esModule",{value:!0})});
2
+ //# sourceMappingURL=browser.min.js.map