@galacean/engine-physics-physx 0.0.0-experimental-2.0-migrate.6 → 0.0.0-experimental-2.0-migrate.7

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/_type_of.js","../../../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/_possible_constructor_return.js","../src/shape/PhysXMeshColliderShape.ts","../src/shape/PhysXPlaneColliderShape.ts","../src/shape/PhysXSphereColliderShape.ts","../src/PhysXPhysics.ts","../src/index.ts"],"sourcesContent":["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","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 _contactOffset: 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 this._contactOffset = physXPhysics.getDefaultContactOffset();\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._contactOffset = 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._contactOffset);\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 if (!this._pxActor.attachShape(shape._pxShape)) {\n throw new Error(\"PhysXCollider: failed to attach shape to the native actor.\");\n }\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 /**\n * Whether actor is currently kinematic.\n * PhysX 拒绝在 kinematic actor 上启用 CCD(会打印警告并忽略),\n * 所以 setCollisionDetectionMode 在 kinematic 状态下只缓存目标值,\n * 等切回 dynamic 时再真正写到 PhysX。\n */\n private _isKinematic: boolean = false;\n\n /**\n * Cached collision detection mode. Always reflects user's intent.\n * 实际 PhysX CCD flag 可能跟这个不一致(kinematic 时强制 Discrete)。\n */\n private _collisionDetectionMode: number = CollisionDetectionMode.Discrete;\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 5e-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 * PhysX 在 kinematic actor 上调用 setRigidBodyFlag(eENABLE_CCD, true) 会触发警告:\n * \"kinematic bodies with CCD enabled are not supported! CCD will be ignored\"\n * 虽然 PhysX 会忽略这次调用而非真的拒绝(切回 dynamic 时 flag 不会自动恢复),\n * 但每次 setIsKinematic 切换都会让这个 warning 重复打印,污染日志,\n * 同时让 actor 在 dynamic 状态下 CCD flag 状态不确定。\n *\n * 解决: 只在 dynamic 状态时立即 apply CCD flags。kinematic 时仅缓存到\n * `_collisionDetectionMode`,等切回 dynamic 时由 setIsKinematic 重新 apply。\n */\n setCollisionDetectionMode(value: number): void {\n this._collisionDetectionMode = value;\n if (!this._isKinematic) {\n this._applyCollisionDetectionFlags(value);\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 * 切换 kinematic 状态时同步处理 CCD flag:\n * - 切到 kinematic 前先关 CCD(避免 PhysX 警告 + 让状态显式)\n * - 切回 dynamic 后恢复用户期望的 CCD mode(来自 `_collisionDetectionMode` 缓存)\n */\n setIsKinematic(value: boolean): void {\n if (this._isKinematic === value) return;\n const physX = this._physXPhysics._physX;\n if (value) {\n this._applyCollisionDetectionFlags(CollisionDetectionMode.Discrete);\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eKINEMATIC, true);\n } else {\n this._pxActor.setRigidBodyFlag(physX.PxRigidBodyFlag.eKINEMATIC, false);\n this._applyCollisionDetectionFlags(this._collisionDetectionMode);\n }\n this._isKinematic = value;\n }\n\n private _applyCollisionDetectionFlags(value: number): void {\n const physX = this._physXPhysics._physX;\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.setConstraints }\n */\n setConstraints(flags: number): void {\n this._pxActor.setRigidDynamicLockFlags(flags);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.addForce }\n *\n * PhysX 在 kinematic actor 上调 addForce 是 no-op(doc: \"kinematic bodies don't\n * respond to forces\")。提前 return 避免无意义的 wasm boundary cross。\n *\n * Sleeping actor 不需要显式 wakeUp — wasm binding 调用 `addForce(force, eFORCE,\n * autowake=true)`,PhysX 自动唤醒(已通过 `applyForce on sleeping actor` 测试验证)。\n */\n addForce(force: Vector3) {\n if (this._isKinematic) return;\n this._pxActor.addForce(force);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.addForceAtPosition }\n */\n addForceAtPosition(force: Vector3, position: Vector3) {\n this._pxActor.addForceAtPos(force, position);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.addTorque }\n *\n * 同 addForce — kinematic 提前 return,sleeping 由 PhysX autowake 自动处理。\n */\n addTorque(torque: Vector3) {\n if (this._isKinematic) return;\n this._pxActor.addTorque(torque);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.move }\n *\n * PhysX 要求 setKinematicTarget 的 rotation 是 normalized quaternion,否则会触发\n * 内部 assertion / 警告,并把 actor 转到错误的姿态。所以在写入 wasm 边界前统一 normalize。\n */\n move(positionOrRotation: Vector3 | Quaternion, rotation?: Quaternion): void {\n const tempTranslation = PhysXDynamicCollider._tempTranslation;\n const tempRotation = PhysXDynamicCollider._tempRotation;\n\n if (rotation) {\n tempRotation.copyFrom(rotation).normalize();\n this._pxActor.setKinematicTarget(positionOrRotation, tempRotation);\n return;\n }\n\n if (positionOrRotation instanceof Vector3) {\n this.getWorldTransform(tempTranslation, tempRotation);\n // current rotation read from PhysX is already normalized; no extra work needed\n this._pxActor.setKinematicTarget(positionOrRotation, tempRotation);\n } else {\n this.getWorldTransform(tempTranslation, tempRotation);\n tempRotation.copyFrom(positionOrRotation).normalize();\n this._pxActor.setKinematicTarget(tempTranslation, tempRotation);\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 _pxSweepHit: any;\n private _pxFilterData: any;\n private _pxRaycastSweepFilterData: any;\n\n private _pxScene: any;\n private _physXSimulationCallbackInstance: any;\n\n // A single persistent PhysX query filter callback is shared by raycast,\n // sweep and overlap. PhysX SDK guarantees that `postFilter` is only invoked\n // when `PxQueryFlag::ePOSTFILTER` is set on the query's filter data, so\n // overlap (whose filter data omits POST_FILTER) safely uses the same\n // callback that also handles the raycast/sweep initial-overlap skip.\n // The user-supplied predicate is stored in `_currentOnQuery`; reentrant\n // calls save the previous value on the call stack via a local in each\n // query method, recreating C++-style RAII without an explicit stack array.\n private _pxQueryCallback: any;\n private _currentOnQuery: (obj: number) => boolean = null;\n\n private _activeTriggers: DisorderedArray<TriggerEvent> = new DisorderedArray<TriggerEvent>();\n private _contactEvents: ContactEvent[] = [];\n private _contactEventCount = 0;\n private _contactEventEnabled = true;\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._pxSweepHit = new physX.PxSweepHit();\n this._pxFilterData = new physX.PxQueryFilterData();\n this._pxFilterData.flags = new physX.PxQueryFlags(QueryFlag.STATIC | QueryFlag.DYNAMIC | QueryFlag.PRE_FILTER);\n this._pxRaycastSweepFilterData = new physX.PxQueryFilterData();\n this._pxRaycastSweepFilterData.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 this._pxQueryCallback = physX.PxQueryFilterCallback.implement({\n preFilter: (_filterData: any, index: number, _actor: any) =>\n this._currentOnQuery(index) ? QueryHitType.BLOCK : QueryHitType.NONE,\n // distance <= 0 means initial overlap — drop the hit so subsequent hits can be considered.\n // Only invoked when the query's filter data includes POST_FILTER (raycast/sweep, not overlap).\n postFilter: (_filterData: any, distance: number) => (distance <= 0 ? QueryHitType.NONE : QueryHitType.BLOCK)\n });\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.setContactEventEnabled }\n */\n setContactEventEnabled(enabled: boolean): void {\n if (this._contactEventEnabled === enabled) {\n return;\n }\n\n this._contactEventEnabled = enabled;\n if (!enabled) {\n this._contactEventCount = 0;\n }\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 prevOnQuery = this._currentOnQuery;\n this._currentOnQuery = onRaycast;\n let result: boolean;\n try {\n result = this._pxScene.raycastSingle(\n ray.origin,\n ray.direction,\n distance,\n pxHitResult,\n this._pxRaycastSweepFilterData,\n this._pxQueryCallback\n );\n } finally {\n this._currentOnQuery = prevOnQuery;\n }\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._pxSweepHit.delete();\n this._pxFilterData.flags.delete();\n this._pxFilterData.delete();\n this._pxRaycastSweepFilterData.flags.delete();\n this._pxRaycastSweepFilterData.delete();\n this._pxQueryCallback.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 const { _pxSweepHit: pxSweepHit } = this;\n distance = Math.min(distance, 3.4e38); // float32 max value limit in physx sweep\n\n const prevOnQuery = this._currentOnQuery;\n this._currentOnQuery = onSweep;\n let result: boolean;\n try {\n result = this._pxScene.sweepSingle(\n geometry,\n pose,\n direction,\n distance,\n pxSweepHit,\n this._pxRaycastSweepFilterData,\n this._pxQueryCallback\n );\n } finally {\n this._currentOnQuery = prevOnQuery;\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 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 prevOnQuery = this._currentOnQuery;\n this._currentOnQuery = onOverlap;\n const maxHits = 256;\n let hits: any;\n try {\n hits = (this._pxScene as any).overlapMultiple(geometry, pose, maxHits, this._pxFilterData, this._pxQueryCallback);\n } finally {\n this._currentOnQuery = prevOnQuery;\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 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 if (!this._contactEventEnabled) return;\n\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\n/**\n * Result returned from a PhysX query filter callback (mirrors `PxQueryHitType`).\n */\nenum QueryHitType {\n /** Filter the hit out (no further processing). */\n NONE = 0,\n /** Treat the hit as a blocking hit (terminates query for single-hit modes). */\n BLOCK = 2\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","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 const cooked = this._cookMesh(positions, indices, isConvex, cookingFlags);\n if (!cooked) {\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 cooked.mesh,\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._pxMesh = cooked.mesh;\n this._pxGeometry = cooked.geometry;\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 const cooked = this._cookMesh(positions, indices, isConvex, cookingFlags);\n if (!cooked) {\n return false;\n }\n\n const oldMesh = this._pxMesh;\n const oldGeometry = this._pxGeometry;\n\n try {\n this._pxShape.setGeometry(cooked.geometry);\n } catch (error) {\n cooked.mesh?.release();\n cooked.geometry?.delete();\n throw error;\n }\n\n this._pxMesh = cooked.mesh;\n this._pxGeometry = cooked.geometry;\n this._isConvex = isConvex;\n\n oldMesh?.release();\n oldGeometry?.delete();\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 isConvex: boolean,\n cookingFlags: number\n ): { mesh: any; geometry: any } | null {\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 let pxMesh: any = null;\n\n if (isConvex) {\n pxMesh = cooking.createConvexMesh(verticesPtr, positions.length, physics);\n physX._free(verticesPtr);\n\n if (!pxMesh) {\n this._logConvexCookingError(physX);\n return null;\n }\n } else {\n if (!indices) {\n physX._free(verticesPtr);\n console.error(\"PhysXMeshColliderShape: Triangle mesh requires indices.\");\n return null;\n }\n\n const isU32 = indices instanceof Uint32Array;\n const indicesPtr = this._allocateIndices(indices, isU32);\n pxMesh = cooking.createTriMesh(verticesPtr, positions.length, indicesPtr, indices.length / 3, !isU32, physics);\n physX._free(verticesPtr);\n physX._free(indicesPtr);\n\n if (!pxMesh) {\n this._logTriMeshCookingError(physX);\n return null;\n }\n }\n\n const { x: scaleX, y: scaleY, z: scaleZ } = this._worldScale;\n const meshFlag = isConvex ? PhysXMeshColliderShape._tightBoundsFlag : 0;\n const geometry = isConvex\n ? physX.createConvexMeshGeometry(pxMesh, scaleX, scaleY, scaleZ, meshFlag)\n : physX.createTriMeshGeometry(pxMesh, scaleX, scaleY, scaleZ, meshFlag);\n\n return { mesh: pxMesh, geometry };\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 const oldGeometry = this._pxGeometry;\n try {\n this._pxShape.setGeometry(newGeometry);\n } catch (error) {\n newGeometry?.delete();\n throw error;\n }\n this._pxGeometry = newGeometry;\n oldGeometry?.delete();\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 private _tolerancesScaleOptions: PhysXTolerancesScale | undefined;\n private _defaultContactOffset = 0.02;\n private _defaultSleepThreshold = 5e-3;\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 * @param options - PhysX options.\n */\n constructor(runtimeMode?: PhysXRuntimeMode, runtimeUrls?: PhysXRuntimeUrls, options?: PhysXPhysicsOptions);\n constructor(options?: PhysXPhysicsOptions);\n constructor(\n runtimeModeOrOptions: PhysXRuntimeMode | PhysXPhysicsOptions = PhysXRuntimeMode.Auto,\n runtimeUrls?: PhysXRuntimeUrls,\n options?: PhysXPhysicsOptions\n ) {\n const isOptionsObject = typeof runtimeModeOrOptions === \"object\";\n const runtimeMode = isOptionsObject ? PhysXRuntimeMode.Auto : (runtimeModeOrOptions ?? PhysXRuntimeMode.Auto);\n const resolvedOptions = isOptionsObject ? runtimeModeOrOptions : options;\n this._runTimeMode = runtimeMode;\n this._wasmSIMDModeUrl =\n runtimeUrls?.wasmSIMDModeUrl ??\n \"https://mdn.alipayobjects.com/rms/uri/file/as/apwallet/1786450043249/suyi/physx.release.simd.js\";\n this._wasmModeUrl =\n runtimeUrls?.wasmModeUrl ??\n \"https://mdn.alipayobjects.com/rms/uri/file/as/apwallet/1786450043249/suyi/physx.release.js\";\n this._tolerancesScaleOptions = resolvedOptions?.tolerancesScale;\n const length = this._tolerancesScaleOptions?.length ?? 1;\n const speed = this._tolerancesScaleOptions?.speed ?? 10;\n this._validateTolerancesScale(length, speed);\n this._updateScaledDefaults(length, speed);\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.getDefaultContactOffset }\n */\n getDefaultContactOffset(): number {\n return this._defaultContactOffset;\n }\n\n /**\n * {@inheritDoc IPhysics.getDefaultSleepThreshold }\n */\n getDefaultSleepThreshold(): number {\n return this._defaultSleepThreshold;\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 this._applyTolerancesScale(tolerancesScale);\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 private _applyTolerancesScale(tolerancesScale: any): void {\n const length = this._tolerancesScaleOptions?.length ?? tolerancesScale.length;\n const speed = this._tolerancesScaleOptions?.speed ?? tolerancesScale.speed;\n\n this._validateTolerancesScale(length, speed);\n\n tolerancesScale.length = length;\n tolerancesScale.speed = speed;\n this._updateScaledDefaults(length, speed);\n }\n\n private _assertPositiveFinite(value: number, name: string): void {\n if (!Number.isFinite(value) || value <= 0) {\n throw new Error(`PhysXPhysics ${name} must be a positive finite number.`);\n }\n }\n\n private _validateTolerancesScale(length: number, speed: number): void {\n this._assertPositiveFinite(length, \"tolerancesScale.length\");\n this._assertPositiveFinite(speed, \"tolerancesScale.speed\");\n }\n\n private _updateScaledDefaults(length: number, speed: number): void {\n this._defaultContactOffset = 0.02 * length;\n this._defaultSleepThreshold = 5e-5 * speed * speed;\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\nexport interface PhysXTolerancesScale {\n /** Approximate object length in the simulation unit. PhysX default is 1. */\n length?: number;\n /** Typical object speed in the simulation unit. PhysX default is 10. */\n speed?: number;\n}\n\nexport interface PhysXPhysicsOptions {\n /** PhysX world unit scale used before PxPhysics, PxSceneDesc and PxCookingParams are created. */\n tolerancesScale?: PhysXTolerancesScale;\n}\n","export { PhysXPhysics } from \"./PhysXPhysics\";\nexport type { PhysXPhysicsOptions, PhysXTolerancesScale } 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","_contactOffset","_worldScale","Vector3","_position","_rotation","_axis","_physXRotation","Quaternion","_shapeFlags","_physXPhysics","getDefaultContactOffset","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","Error","push","detachShape","shapes","splice","indexOf","setWorldTransform","setGlobalPose","_transform","getWorldTransform","outPosition","outRotation","w","pos","rot","_tempTransform","PhysXDynamicCollider","_isKinematic","_collisionDetectionMode","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","_applyCollisionDetectionFlags","setUseGravity","setActorFlag","PxActorFlag","eDISABLE_GRAVITY","setIsKinematic","physX","setRigidBodyFlag","PxRigidBodyFlag","eKINEMATIC","eENABLE_CCD","eENABLE_CCD_FRICTION","eENABLE_SPECULATIVE_CCD","setConstraints","setRigidDynamicLockFlags","addForce","force","addForceAtPosition","addForceAtPos","addTorque","torque","positionOrRotation","tempTranslation","tempRotation","_tempRotation","setKinematicTarget","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","_currentOnQuery","_activeTriggers","_contactEvents","_contactEventCount","_contactEventEnabled","_triggerEvents","_physicsEvents","contactEvents","contactEventCount","triggerEvents","_triggerEventPool","_physXManager","_pxRaycastHit","PxRaycastHit","_pxSweepHit","PxSweepHit","_pxFilterData","PxQueryFilterData","PxQueryFlags","QueryFlag","_pxRaycastSweepFilterData","triggerCallback","onContactBegin","collision","_bufferContactEvent","onContactEnd","onContactPersist","onTriggerBegin","index1","index2","event","_getTrigger","state","onTriggerEnd","subMap","undefined","pxPhysics","_physXSimulationCallbackInstance","PxSimulationEventCallback","implement","sceneDesc","getDefaultSceneDesc","getTolerancesScale","_pxScene","createScene","_pxQueryCallback","PxQueryFilterCallback","preFilter","_filterData","index","_actor","postFilter","setGravity","addCollider","collider","addActor","removeCollider","removeActor","addCharacterController","characterController","lastPXManager","removeCharacterController","update","_simulate","_fetchResults","setContactEventEnabled","enabled","updateEvents","physicsEvents","triggerEventPool","activeTriggers","forEach","dispatchState","deleteByIndex","raycast","ray","onRaycast","hit","pxHitResult","min","prevOnQuery","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","pxSweepHit","sweepSingle","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","cooked","_cookMesh","physics","scaleY","scaleZ","SCENE_QUERY_SHAPE","SIMULATION_SHAPE","meshFlag","_tightBoundsFlag","createShapeFn","createConvexMeshShape","createTriMeshShape","mesh","scaleX","setMeshData","oldMesh","oldGeometry","error","_updateGeometry","_pxCooking","cooking","_pxCookingParams","cookingParams","preprocessFlags","MeshColliderShapeCookingFlag","VertexWelding","Cleaning","setCookingMeshPreprocessParams","setParams","verticesPtr","_allocatePositions","pxMesh","createConvexMesh","_free","_logConvexCookingError","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","runtimeModeOrOptions","runtimeUrls","options","Auto","_initializeState","_defaultContactOffset","_defaultSleepThreshold","isOptionsObject","runtimeMode","resolvedOptions","_runTimeMode","_wasmSIMDModeUrl","wasmSIMDModeUrl","_wasmModeUrl","wasmModeUrl","_tolerancesScaleOptions","tolerancesScale","speed","_validateTolerancesScale","_updateScaledDefaults","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","getDefaultSleepThreshold","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","PxTolerancesScale","_applyTolerancesScale","PxCreatePhysics","PxInitExtensions","PxCookingParams","meshWeldTolerance","setCookingMidphaseType","pxCooking","PxCreateCooking","_assertPositiveFinite","name","isFinite"],"mappings":";;;;;;IAAA,SAAS,QAAQ,CAAC,GAAG,EAAE;IACvB,IAAI,uBAAuB,CAAC;AAC5B;IACA,IAAI,OAAO,GAAG,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,GAAG,CAAC,WAAW,KAAK,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,CAAC;IACtG;;ICJA,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,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE;IACjC,IAAI,iBAAiB,GAAG,MAAM,CAAC,cAAc,IA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QxE,wBAGP,GAHD,SAAQA,wBAAyBhiB,CAAAA,MAAc,EAAE+hB,KAAa,EAAA;YAC5D,IAAI,CAACwE,qBAAqB,CAACvmB,MAAQ,EAAA,wBAAA,CAAA,CAAA;YACnC,IAAI,CAACumB,qBAAqB,CAACxE,KAAO,EAAA,uBAAA,CAAA,CAAA;IACpC,KAAA,CAAA;IAEA,IAAA,MAAA,CAAQE,qBAGP,GAHD,SAAQA,qBAAsBjiB,CAAAA,MAAc,EAAE+hB,KAAa,EAAA;YACzD,IAAI,CAACZ,qBAAqB,GAAG,IAAOnhB,GAAAA,MAAAA,CAAAA;IACpC,QAAA,IAAI,CAACohB,sBAAsB,GAAG,IAAA,GAAOW,KAAQA,GAAAA,KAAAA,CAAAA;IAC/C,KAAA,CAAA;IApUWlB,IAAAA,OAAAA,YAAAA,CAAAA;IAqUZ,CAAA;;ICxWD;AACO,QAAMyE,UAAW,mCAAgB;IAExC5hB,OAAQ+f,CAAAA,GAAG,CAAE,yCAAyC6B,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._contactOffset=.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,this._contactOffset=t.getDefaultContactOffset()}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._contactOffset=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._contactOffset),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;if(!this._pxActor.attachShape(t._pxShape))throw Error("PhysXCollider: failed to attach shape to the native actor.");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){(o=t.call(this,e)||this)._isKinematic=!1,o._collisionDetectionMode=0;var o,n=o._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){this._collisionDetectionMode=t,this._isKinematic||this._applyCollisionDetectionFlags(t)},n.setUseGravity=function(t){this._pxActor.setActorFlag(this._physXPhysics._physX.PxActorFlag.eDISABLE_GRAVITY,!t)},n.setIsKinematic=function(t){if(this._isKinematic!==t){var e=this._physXPhysics._physX;t?(this._applyCollisionDetectionFlags(0),this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eKINEMATIC,!0)):(this._pxActor.setRigidBodyFlag(e.PxRigidBodyFlag.eKINEMATIC,!1),this._applyCollisionDetectionFlags(this._collisionDetectionMode)),this._isKinematic=t}},n._applyCollisionDetectionFlags=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.setConstraints=function(t){this._pxActor.setRigidDynamicLockFlags(t)},n.addForce=function(t){this._isKinematic||this._pxActor.addForce(t)},n.addForceAtPosition=function(t,e){this._pxActor.addForceAtPos(t,e)},n.addTorque=function(t){this._isKinematic||this._pxActor.addTorque(t)},n.move=function(t,o){var n=s._tempTranslation,r=s._tempRotation;if(o){r.copyFrom(o).normalize(),this._pxActor.setKinematicTarget(t,r);return}i(t,e.Vector3)?(this.getWorldTransform(n,r),this._pxActor.setKinematicTarget(t,r)):(this.getWorldTransform(n,r),r.copyFrom(t).normalize(),this._pxActor.setKinematicTarget(n,r))},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 f=function(){this._eventMap={}},x=/*#__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._currentOnQuery=null,this._activeTriggers=new e.DisorderedArray,this._contactEvents=[],this._contactEventCount=0,this._contactEventEnabled=!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._pxSweepHit=new o.PxSweepHit,this._pxFilterData=new o.PxQueryFilterData,this._pxFilterData.flags=new o.PxQueryFlags(7),this._pxRaycastSweepFilterData=new o.PxQueryFilterData,this._pxRaycastSweepFilterData.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(),this._pxQueryCallback=o.PxQueryFilterCallback.implement({preFilter:function(t,e,i){return s._currentOnQuery(e)?2:0},postFilter:function(t,e){return e<=0?0:2}})}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.setContactEventEnabled=function(t){this._contactEventEnabled!==t&&(this._contactEventEnabled=t,t||(this._contactEventCount=0))},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,r=this._pxRaycastHit;i=Math.min(i,34e37);var a=this._currentOnQuery;this._currentOnQuery=s;try{n=this._pxScene.raycastSingle(e.origin,e.direction,i,r,this._pxRaycastSweepFilterData,this._pxQueryCallback)}finally{this._currentOnQuery=a}if(n&&void 0!=o){var l=t._tempPosition,h=t._tempNormal,c=r.position,_=r.normal;l.set(c.x,c.y,c.z),h.set(_.x,_.y,_.z),o(r.getShape().getUUID(),r.distance,l,h)}return n},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._pxSweepHit.delete(),this._pxFilterData.flags.delete(),this._pxFilterData.delete(),this._pxRaycastSweepFilterData.flags.delete(),this._pxRaycastSweepFilterData.delete(),this._pxQueryCallback.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){var a,l=this._pxSweepHit;o=Math.min(o,34e37);var h=this._currentOnQuery;this._currentOnQuery=n;try{a=this._pxScene.sweepSingle(e,i,s,o,l,this._pxRaycastSweepFilterData,this._pxQueryCallback)}finally{this._currentOnQuery=h}if(a&&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},i._overlapMultiple=function(e,i,s){var o,n=this._currentOnQuery;this._currentOnQuery=s;try{o=this._pxScene.overlapMultiple(e,i,256,this._pxFilterData,this._pxQueryCallback)}finally{this._currentOnQuery=n}var r=t._tempShapeIDs;if(r.length=0,o)for(var a=0,l=o.size();a<l;a++)r.push(o.get(a).getShape().getUUID());return null==o||o.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){if(this._contactEventEnabled){var i=this._contactEventCount++,s=(l=this._contactEvents)[i]||(l[i]=new C);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},S=/*#__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}(),C=/*#__PURE__*/function(){function t(){this._bufferedContacts=new S}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),M=((a={})[a.Auto=0]="Auto",a[a.WebAssembly=1]="WebAssembly",a[a.WebAssemblySIMD=2]="WebAssemblySIMD",a),A=/*#__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}();A._defaultVec=new e.Vector3,A._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,A._defaultVec,A._defaultQuat,null,A._defaultVec,A._defaultQuat),s}return o(e,t),e}(A),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,A._defaultVec,A._defaultQuat,null,A._defaultVec,A._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}(A);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,A._defaultVec,A._defaultQuat,i._pxActor,A._defaultVec,A._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}(A),b=/*#__PURE__*/function(t){function s(e,i,o,n,r,a,h){(c=t.call(this,e)||this)._pxMesh=null,c._isConvex=r;var c,_=c._cookMesh(o,n,r,h);if(!_)return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(c);var p=e._physX,u=e._pxPhysics,d=c._worldScale,y=d.x,f=d.y,x=d.z,g=l.SCENE_QUERY_SHAPE|l.SIMULATION_SHAPE,m=r?s._tightBoundsFlag:0,v=r?p.createConvexMeshShape:p.createTriMeshShape;return c._pxShape=v(_.mesh,y,f,x,m,g,a._pxMaterial,u),c._id=i,c._pxMaterial=a._pxMaterial,c._pxMesh=_.mesh,c._pxGeometry=_.geometry,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,r=this._cookMesh(t,e,i,s);if(!r)return!1;var a=this._pxMesh,l=this._pxGeometry;try{this._pxShape.setGeometry(r.geometry)}catch(t){throw null==(o=r.mesh)||o.release(),null==(n=r.geometry)||n.delete(),t}return this._pxMesh=r.mesh,this._pxGeometry=r.geometry,this._isConvex=i,null==a||a.release(),null==l||l.delete(),!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,r){var a=this._physXPhysics,l=a._physX,h=a._pxPhysics,c=a._pxCooking,_=a._pxCookingParams,p=0;r&e.MeshColliderShapeCookingFlag.VertexWelding&&(p|=1),r&e.MeshColliderShapeCookingFlag.Cleaning||(p|=2),l.setCookingMeshPreprocessParams(_,p),c.setParams(_);var u=this._allocatePositions(t),d=null;if(n){if(d=c.createConvexMesh(u,t.length,h),l._free(u),!d)return this._logConvexCookingError(l),null}else{if(!o)return l._free(u),console.error("PhysXMeshColliderShape: Triangle mesh requires indices."),null;var y=i(o,Uint32Array),f=this._allocateIndices(o,y);if(d=c.createTriMesh(u,t.length,f,o.length/3,!y,h),l._free(u),l._free(f),!d)return this._logTriMeshCookingError(l),null}var x=this._worldScale,g=x.x,m=x.y,v=x.z,S=n?s._tightBoundsFlag:0,C=n?l.createConvexMeshGeometry(d,g,m,v,S):l.createTriMeshGeometry(d,g,m,v,S);return{mesh:d,geometry:C}},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),l=this._pxGeometry;try{this._pxShape.setGeometry(a)}catch(t){throw null==a||a.delete(),t}this._pxGeometry=a,null==l||l.delete()}},s}(h);b._tightBoundsFlag=1;var G=/*#__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),R=/*#__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),X=/*#__PURE__*/function(){function t(t,e,i){void 0===t&&(t=M.Auto),this._initializeState=0,this._defaultContactOffset=.02,this._defaultSleepThreshold=.005;var s,o,n,r,a,l,h,c=(void 0===t?"undefined":(s=t)&&"undefined"!=typeof Symbol&&s.constructor===Symbol?"symbol":typeof s)=="object",_=c?M.Auto:null!=t?t:M.Auto,p=c?t:i;this._runTimeMode=_,this._wasmSIMDModeUrl=null!=(r=null==e?void 0:e.wasmSIMDModeUrl)?r:"https://mdn.alipayobjects.com/rms/uri/file/as/apwallet/1786450043249/suyi/physx.release.simd.js",this._wasmModeUrl=null!=(a=null==e?void 0:e.wasmModeUrl)?a:"https://mdn.alipayobjects.com/rms/uri/file/as/apwallet/1786450043249/suyi/physx.release.js",this._tolerancesScaleOptions=null==p?void 0:p.tolerancesScale;var u=null!=(l=null==(o=this._tolerancesScaleOptions)?void 0:o.length)?l:1,d=null!=(h=null==(n=this._tolerancesScaleOptions)?void 0:n.speed)?h:10;this._validateTolerancesScale(u,d),this._updateScaledDefaults(u,d)}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==M.Auto&&(i=e.SystemInfo._detectSIMDSupported()?M.WebAssemblySIMD:M.WebAssembly),i==M.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 f},i.createPhysicsScene=function(t){return new g(this,t)},i.getDefaultContactOffset=function(){return this._defaultContactOffset},i.getDefaultSleepThreshold=function(){return this._defaultSleepThreshold},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 x(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 R(this,t,e,i)},i.createPlaneColliderShape=function(t,e){return new G(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;this._applyTolerancesScale(n);var 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===M.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},i._applyTolerancesScale=function(t){var e,i,s,o,n=null!=(s=null==(e=this._tolerancesScaleOptions)?void 0:e.length)?s:t.length,r=null!=(o=null==(i=this._tolerancesScaleOptions)?void 0:i.speed)?o:t.speed;this._validateTolerancesScale(n,r),t.length=n,t.speed=r,this._updateScaledDefaults(n,r)},i._assertPositiveFinite=function(t,e){if(!Number.isFinite(t)||t<=0)throw Error("PhysXPhysics "+e+" must be a positive finite number.")},i._validateTolerancesScale=function(t,e){this._assertPositiveFinite(t,"tolerancesScale.length"),this._assertPositiveFinite(e,"tolerancesScale.speed")},i._updateScaledDefaults=function(t,e){this._defaultContactOffset=.02*t,this._defaultSleepThreshold=5e-5*e*e},t}(),T="0.0.0-experimental-2.0-migrate.7";console.log("Galacean Engine Physics PhysX Version: "+T),t.PhysXPhysics=X,t.PhysXRuntimeMode=M,t.version=T,Object.defineProperty(t,"__esModule",{value:!0})});
2
+ //# sourceMappingURL=browser.min.js.map