@galacean/engine-physics-physx 1.2.0-beta.2 → 1.2.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/dist/browser.js +28 -19
- package/dist/browser.js.map +1 -0
- package/dist/browser.min.js +2 -1
- package/dist/browser.min.js.map +1 -0
- package/dist/main.js +27 -19
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +27 -19
- package/dist/module.js +27 -19
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/shape/PhysXBoxColliderShape.d.ts +1 -0
- package/types/shape/PhysXCapsuleColliderShape.d.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.min.js","sources":["../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/esm/_instanceof.js","../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/esm/_set_prototype_of.js","../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/esm/_inherits.js","../src/DisorderedArray.ts","../src/shape/PhysXColliderShape.ts","../src/shape/PhysXCapsuleColliderShape.ts","../src/PhysXDynamicCollider.ts","../src/PhysXPhysicsMaterial.ts","../src/PhysXPhysicsScene.ts","../src/enum/PhysXRuntimeMode.ts","../src/PhysXPhysics.ts","../src/shape/PhysXBoxColliderShape.ts","../src/PhysXCharacterController.ts","../src/PhysXCollider.ts","../src/PhysXPhysicsManager.ts","../src/PhysXStaticCollider.ts","../src/joint/PhysXJoint.ts","../src/joint/PhysXFixedJoint.ts","../src/joint/PhysXHingeJoint.ts","../src/joint/PhysXSpringJoint.ts","../src/shape/PhysXPlaneColliderShape.ts","../src/shape/PhysXSphereColliderShape.ts","../src/index.ts"],"sourcesContent":["export 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","export 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 { _set_prototype_of } from \"./_set_prototype_of.js\";\n\nexport function _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","/**\n * High-performance unordered array, delete uses exchange method to improve performance, internal capacity only increases.\n */\nexport class DisorderedArray<T> {\n _elements: T[];\n\n length: number = 0;\n\n constructor(count: number = 0) {\n this._elements = new Array<T>(count);\n }\n\n add(element: T): void {\n if (this.length === this._elements.length) this._elements.push(element);\n else this._elements[this.length] = element;\n this.length++;\n }\n\n delete(element: T): void {\n //TODO: It can be optimized for custom binary search and other algorithms, currently this._elements>=this.length wastes performance.\n const index = this._elements.indexOf(element);\n this.deleteByIndex(index);\n }\n\n get(index: number): T {\n if (index >= this.length) {\n throw \"Index is out of range.\";\n }\n return this._elements[index];\n }\n\n /**\n *\n * @param index\n * @returns The replaced item is used to reset its index.\n */\n deleteByIndex(index: number): T {\n var elements: T[] = this._elements;\n let end: T = null;\n const lastIndex = this.length - 1;\n if (index !== lastIndex) {\n end = elements[lastIndex];\n elements[index] = end;\n }\n this.length--;\n return end;\n }\n\n garbageCollection(): void {\n this._elements.length = this.length;\n }\n}\n","import { Quaternion, Vector3 } from \"@galacean/engine\";\nimport { IColliderShape } from \"@galacean/engine-design\";\nimport { DisorderedArray } from \"../DisorderedArray\";\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 /** @internal */\n _controllers: DisorderedArray<PhysXCharacterController> = new DisorderedArray<PhysXCharacterController>();\n\n protected _physXPhysics: PhysXPhysics;\n protected _worldScale: Vector3 = new Vector3(1, 1, 1);\n protected _position: Vector3 = new Vector3();\n protected _rotation: Vector3 = null;\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 /** @internal */\n _pxMaterial: any;\n /** @internal */\n _pxShape: any;\n /** @internal */\n _pxGeometry: any;\n /** @internal */\n _id: number;\n\n constructor(physXPhysics: PhysXPhysics) {\n this._physXPhysics = physXPhysics;\n }\n\n /**\n * {@inheritDoc IColliderShape.setRotation }\n */\n setRotation(value: Vector3): void {\n this._rotation = value;\n Quaternion.rotationYawPitchRoll(value.x, value.y, value.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.copyFrom(scale);\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._pxShape.setContactOffset(offset);\n\n const controllers = this._controllers;\n for (let i = 0, n = controllers.length; i < n; i++) {\n controllers.get(i)._pxController.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.destroy }\n */\n destroy(): void {\n this._pxShape.release();\n }\n\n /**\n * @internal\n */\n _setShapeFlags(flags: ShapeFlag) {\n this._shapeFlags = flags;\n this._pxShape.setFlags(new this._physXPhysics._physX.PxShapeFlags(this._shapeFlags));\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 this._pxShape = this._physXPhysics._pxPhysics.createShape(\n this._pxGeometry,\n material._pxMaterial,\n true,\n new this._physXPhysics._physX.PxShapeFlags(this._shapeFlags)\n );\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 { 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/**\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 private _upAxis: ColliderShapeUpAxis = ColliderShapeUpAxis.Y;\n private _sizeScale: Vector3 = new Vector3(1, 1, 1);\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(this._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._sizeScale;\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._sizeScale;\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.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.x, rotation.y, rotation.z, physXRotation);\n Quaternion.multiply(physXRotation, axis, physXRotation);\n } else {\n physXRotation.copyFrom(axis);\n }\n this._setLocalPose();\n }\n\n /**\n * {@inheritDoc IColliderShape.setWorldScale }\n */\n override setWorldScale(scale: Vector3): void {\n super.setWorldScale(scale);\n\n const sizeScale = this._sizeScale.set(Math.abs(scale.x), Math.abs(scale.y), Math.abs(scale.z));\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 pxController.setRadius(radius);\n pxController.setHeight(height);\n }\n }\n}\n\n/**\n * The up axis of the collider shape.\n */\nenum 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 { IDynamicCollider } from \"@galacean/engine-design\";\nimport { Quaternion, Vector3 } from \"@galacean/engine\";\nimport { PhysXCollider } from \"./PhysXCollider\";\nimport { PhysXPhysics } from \"./PhysXPhysics\";\n\n/**\n * The collision detection mode constants used for PhysXDynamicCollider.collisionDetectionMode.\n * */\nexport enum CollisionDetectionMode {\n /** Continuous collision detection is off for this dynamic collider. */\n Discrete,\n /** Continuous collision detection is on for colliding with static mesh geometry. */\n Continuous,\n /** Continuous collision detection is on for colliding with static and dynamic geometry. */\n ContinuousDynamic,\n /** Speculative continuous collision detection is on for static and dynamic geometries */\n ContinuousSpeculative\n}\n\n/**\n * A dynamic collider can act with self-defined movement or physical force\n */\nexport class PhysXDynamicCollider extends PhysXCollider implements IDynamicCollider {\n private static _tempTranslation = new Vector3();\n private static _tempRotation = new Quaternion();\n\n constructor(physXPhysics: PhysXPhysics, position: Vector3, rotation: Quaternion) {\n super(physXPhysics);\n const transform = this._transform(position, rotation);\n this._pxActor = physXPhysics._pxPhysics.createRigidDynamic(transform);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setLinearDamping }\n */\n setLinearDamping(value: number): void {\n this._pxActor.setLinearDamping(value);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setAngularDamping }\n */\n setAngularDamping(value: number): void {\n this._pxActor.setAngularDamping(value);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setLinearVelocity }\n */\n setLinearVelocity(value: Vector3): void {\n this._pxActor.setLinearVelocity(value, true);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setAngularVelocity }\n */\n setAngularVelocity(value: Vector3): void {\n this._pxActor.setAngularVelocity(value, 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.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.setMaxAngularVelocity }\n */\n setMaxAngularVelocity(value: number): void {\n this._pxActor.setMaxAngularVelocity(value);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setMaxDepenetrationVelocity }\n */\n setMaxDepenetrationVelocity(value: number): void {\n this._pxActor.setMaxDepenetrationVelocity(value);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setSleepThreshold }\n * @default 1e-5f * PxTolerancesScale::speed * PxTolerancesScale::speed\n */\n setSleepThreshold(value: number): void {\n this._pxActor.setSleepThreshold(value);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setSolverIterations }\n */\n setSolverIterations(value: number): void {\n this._pxActor.setSolverIterationCounts(value, 1);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setCollisionDetectionMode }\n */\n setCollisionDetectionMode(value: number): void {\n switch (value) {\n case CollisionDetectionMode.Continuous:\n this._pxActor.setRigidBodyFlag(this._physXPhysics._physX.PxRigidBodyFlag.eENABLE_CCD, true);\n break;\n case CollisionDetectionMode.ContinuousDynamic:\n this._pxActor.setRigidBodyFlag(this._physXPhysics._physX.PxRigidBodyFlag.eENABLE_CCD_FRICTION, true);\n break;\n case CollisionDetectionMode.ContinuousSpeculative:\n this._pxActor.setRigidBodyFlag(this._physXPhysics._physX.PxRigidBodyFlag.eENABLE_SPECULATIVE_CCD, true);\n break;\n case CollisionDetectionMode.Discrete:\n const physX = this._physXPhysics._physX;\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.setIsKinematic }\n */\n setIsKinematic(value: boolean): void {\n if (value) {\n this._pxActor.setRigidBodyFlag(this._physXPhysics._physX.PxRigidBodyFlag.eKINEMATIC, true);\n } else {\n this._pxActor.setRigidBodyFlag(this._physXPhysics._physX.PxRigidBodyFlag.eKINEMATIC, false);\n }\n }\n\n /**\n * {@inheritDoc IDynamicCollider.setConstraints }\n */\n setConstraints(flags: number): void {\n this._pxActor.setRigidDynamicLockFlags(flags);\n }\n\n /**\n * {@inheritDoc IDynamicCollider.addForce }\n */\n addForce(force: Vector3) {\n this._pxActor.addForce({ x: force.x, y: force.y, z: force.z });\n }\n\n /**\n * {@inheritDoc IDynamicCollider.addTorque }\n */\n addTorque(torque: Vector3) {\n this._pxActor.addTorque({ x: torque.x, y: torque.y, z: torque.z });\n }\n\n /**\n * {@inheritDoc IDynamicCollider.move }\n */\n move(positionOrRotation: Vector3 | Quaternion, rotation?: Quaternion): void {\n if (rotation) {\n this._pxActor.setKinematicTarget(positionOrRotation, rotation);\n return;\n }\n\n const tempTranslation = PhysXDynamicCollider._tempTranslation;\n const tempRotation = PhysXDynamicCollider._tempRotation;\n this.getWorldTransform(tempTranslation, tempRotation);\n if (positionOrRotation instanceof Vector3) {\n this._pxActor.setKinematicTarget(positionOrRotation, tempRotation);\n } else {\n this._pxActor.setKinematicTarget(tempTranslation, positionOrRotation);\n }\n }\n\n /**\n * {@inheritDoc IDynamicCollider.sleep }\n */\n sleep(): void {\n return this._pxActor.putToSleep();\n }\n\n /**\n * {@inheritDoc IDynamicCollider.wakeUp }\n */\n wakeUp(): void {\n return this._pxActor.wakeUp();\n }\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","import { Ray, Vector3 } from \"@galacean/engine\";\nimport { IPhysicsScene } from \"@galacean/engine-design\";\nimport { DisorderedArray } from \"./DisorderedArray\";\nimport { PhysXCharacterController } from \"./PhysXCharacterController\";\nimport { PhysXCollider } from \"./PhysXCollider\";\nimport { PhysXPhysics } from \"./PhysXPhysics\";\nimport { PhysXPhysicsManager } from \"./PhysXPhysicsManager\";\nimport { PhysXColliderShape } from \"./shape/PhysXColliderShape\";\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 _tempNormal: Vector3 = new Vector3();\n\n private _physXPhysics: PhysXPhysics;\n private _physXManager: PhysXPhysicsManager;\n private _pxRaycastHit: any;\n private _pxFilterData: any;\n\n private _pxScene: any;\n\n private readonly _onContactEnter?: (obj1: number, obj2: number) => void;\n private readonly _onContactExit?: (obj1: number, obj2: number) => void;\n private readonly _onContactStay?: (obj1: number, obj2: number) => void;\n private readonly _onTriggerEnter?: (obj1: number, obj2: number) => void;\n private readonly _onTriggerExit?: (obj1: number, obj2: number) => void;\n private readonly _onTriggerStay?: (obj1: number, obj2: number) => void;\n\n private _currentEvents: DisorderedArray<TriggerEvent> = new DisorderedArray<TriggerEvent>();\n\n private _eventPool: TriggerEvent[] = [];\n\n constructor(\n physXPhysics: PhysXPhysics,\n physicsManager: PhysXPhysicsManager,\n onContactEnter?: (obj1: number, obj2: number) => void,\n onContactExit?: (obj1: number, obj2: number) => void,\n onContactStay?: (obj1: number, obj2: number) => void,\n onTriggerEnter?: (obj1: number, obj2: number) => void,\n onTriggerExit?: (obj1: number, obj2: number) => void,\n onTriggerStay?: (obj1: number, obj2: number) => void\n ) {\n this._physXPhysics = physXPhysics;\n this._physXManager = physicsManager;\n\n const physX = physXPhysics._physX;\n\n this._pxRaycastHit = new physX.PxRaycastHit();\n this._pxFilterData = new physX.PxQueryFilterData();\n this._pxFilterData.flags = new physX.PxQueryFlags(QueryFlag.STATIC | QueryFlag.DYNAMIC | QueryFlag.PRE_FILTER);\n\n this._onContactEnter = onContactEnter;\n this._onContactExit = onContactExit;\n this._onContactStay = onContactStay;\n this._onTriggerEnter = onTriggerEnter;\n this._onTriggerExit = onTriggerExit;\n this._onTriggerStay = onTriggerStay;\n\n const triggerCallback = {\n onContactBegin: (index1, index2) => {\n this._onContactEnter(index1, index2);\n },\n onContactEnd: (index1, index2) => {\n this._onContactExit(index1, index2);\n },\n onContactPersist: (index1, index2) => {\n this._onContactStay(index1, index2);\n },\n onTriggerBegin: (index1, index2) => {\n const event = index1 < index2 ? this._getTrigger(index1, index2) : this._getTrigger(index2, index1);\n event.state = TriggerEventState.Enter;\n this._currentEvents.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 = TriggerEventState.Exit;\n }\n };\n\n const pxPhysics = physXPhysics._pxPhysics;\n const physXSimulationCallbackInstance = physX.PxSimulationEventCallback.implement(triggerCallback);\n const sceneDesc = physX.getDefaultSceneDesc(pxPhysics.getTolerancesScale(), 0, physXSimulationCallbackInstance);\n this._pxScene = pxPhysics.createScene(sceneDesc);\n }\n\n /**\n * {@inheritDoc IPhysicsManager.setGravity }\n */\n setGravity(value: Vector3) {\n this._pxScene.setGravity(value);\n }\n\n /**\n * {@inheritDoc IPhysicsManager.addColliderShape }\n */\n addColliderShape(colliderShape: PhysXColliderShape) {\n this._physXManager._eventMap[colliderShape._id] = {};\n }\n\n /**\n * {@inheritDoc IPhysicsManager.removeColliderShape }\n */\n removeColliderShape(colliderShape: PhysXColliderShape) {\n const { _eventPool: eventPool, _currentEvents: currentEvents } = this;\n const { _id: id } = colliderShape;\n const { _eventMap: eventMap } = this._physXManager;\n for (let i = currentEvents.length - 1; i >= 0; i--) {\n const event = currentEvents.get(i);\n if (event.index1 == id) {\n currentEvents.deleteByIndex(i);\n eventPool.push(event);\n } else if (event.index2 == id) {\n currentEvents.deleteByIndex(i);\n eventPool.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 /**\n * {@inheritDoc IPhysicsManager.addCollider }\n */\n addCollider(collider: PhysXCollider): void {\n this._pxScene.addActor(collider._pxActor, null);\n }\n\n /**\n * {@inheritDoc IPhysicsManager.removeCollider }\n */\n removeCollider(collider: PhysXCollider): void {\n this._pxScene.removeActor(collider._pxActor, true);\n }\n\n /**\n * {@inheritDoc IPhysicsManager.addCharacterController }\n */\n addCharacterController(characterController: PhysXCharacterController): void {\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 }\n }\n characterController._pxManager = this;\n }\n\n /**\n * {@inheritDoc IPhysicsManager.removeCharacterController }\n */\n removeCharacterController(characterController: PhysXCharacterController): void {\n characterController._pxManager = null;\n }\n\n /**\n * {@inheritDoc IPhysicsManager.update }\n */\n update(elapsedTime: number): void {\n this._simulate(elapsedTime);\n this._fetchResults();\n this._fireEvent();\n }\n\n /**\n * {@inheritDoc IPhysicsManager.raycast }\n */\n raycast(\n ray: Ray,\n distance: number,\n onRaycast: (obj: number) => boolean,\n hit?: (shapeUniqueID: number, distance: number, position: Vector3, normal: Vector3) => void\n ): boolean {\n const { _pxRaycastHit: pxHitResult } = this;\n distance = Math.min(distance, 3.4e38); // float32 max value limit in physx raycast.\n\n const raycastCallback = {\n preFilter: (filterData, index, actor) => {\n if (onRaycast(index)) {\n return 2; // eBLOCK\n } else {\n return 0; // eNONE\n }\n },\n postFilter: (filterData, hit) => {}\n };\n\n const result = this._pxScene.raycastSingle(\n ray.origin,\n ray.direction,\n distance,\n pxHitResult,\n this._pxFilterData,\n this._physXPhysics._physX.PxQueryFilterCallback.implement(raycastCallback)\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 * @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 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._eventPool.length) {\n event = this._eventPool.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 _fireEvent(): void {\n const { _eventPool: eventPool, _currentEvents: currentEvents } = this;\n for (let i = currentEvents.length - 1; i >= 0; i--) {\n const event = currentEvents.get(i);\n if (event.state == TriggerEventState.Enter) {\n this._onTriggerEnter(event.index1, event.index2);\n event.state = TriggerEventState.Stay;\n } else if (event.state == TriggerEventState.Stay) {\n this._onTriggerStay(event.index1, event.index2);\n } else if (event.state == TriggerEventState.Exit) {\n this._onTriggerExit(event.index1, event.index2);\n currentEvents.deleteByIndex(i);\n eventPool.push(event);\n }\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 * Physics state\n */\nenum TriggerEventState {\n Enter,\n Stay,\n Exit\n}\n\n/**\n * Trigger event to store interactive object ids and state.\n */\nexport class TriggerEvent {\n state: TriggerEventState;\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 * PhysX runtime mode.\n */\nexport enum PhysXRuntimeMode {\n /** Use webAssembly mode first, if WebAssembly mode is not supported, roll back to JavaScript mode. */\n Auto,\n /** WebAssembly mode. */\n WebAssembly,\n /** JavaScript mode. */\n JavaScript\n}\n","import { Quaternion, Vector3, version } from \"@galacean/engine\";\nimport {\n IBoxColliderShape,\n ICapsuleColliderShape,\n ICharacterController,\n IDynamicCollider,\n IFixedJoint,\n IHingeJoint,\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 { 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\n private _runTimeMode: PhysXRuntimeMode;\n private _initializeState: InitializeState = InitializeState.Uninitialized;\n private _initializePromise: Promise<void>;\n\n constructor(runtimeMode: PhysXRuntimeMode = PhysXRuntimeMode.Auto) {\n this._runTimeMode = runtimeMode;\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 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 const supported = (() => {\n try {\n if (typeof WebAssembly === \"object\" && typeof WebAssembly.instantiate === \"function\") {\n const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));\n if (module instanceof WebAssembly.Module)\n return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;\n }\n } catch (e) {}\n return false;\n })();\n if (supported) {\n runtimeMode = PhysXRuntimeMode.WebAssembly;\n } else {\n runtimeMode = PhysXRuntimeMode.JavaScript;\n }\n }\n\n if (runtimeMode == PhysXRuntimeMode.JavaScript) {\n script.src = `https://mdn.alipayobjects.com/rms/afts/file/A*rnDeR58NNGoAAAAAAAAAAAAAARQnAQ/physx.release.js.js`;\n } else if (runtimeMode == PhysXRuntimeMode.WebAssembly) {\n script.src = `https://mdn.alipayobjects.com/rms/afts/file/A*nA97QLQehRMAAAAAAAAAAAAAARQnAQ/physx.release.js`;\n }\n });\n\n const initializePromise = new Promise<void>((resolve, reject) => {\n scriptPromise\n .then(\n () =>\n (<any>window).PHYSX().then((PHYSX) => {\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 public destroy(): void {\n this._physX.PxCloseExtensions();\n this._pxPhysics.release();\n this._pxFoundation.release();\n this._physX = null;\n this._pxFoundation = null;\n this._pxPhysics = null;\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(\n physicsManager: PhysXPhysicsManager,\n onContactBegin?: (obj1: number, obj2: number) => void,\n onContactEnd?: (obj1: number, obj2: number) => void,\n onContactStay?: (obj1: number, obj2: number) => void,\n onTriggerBegin?: (obj1: number, obj2: number) => void,\n onTriggerEnd?: (obj1: number, obj2: number) => void,\n onTriggerStay?: (obj1: number, obj2: number) => void\n ): IPhysicsScene {\n const manager = new PhysXPhysicsScene(\n this,\n physicsManager,\n onContactBegin,\n onContactEnd,\n onContactStay,\n onTriggerBegin,\n onTriggerEnd,\n onTriggerStay\n );\n return manager;\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.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 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 pxPhysics = physX.PxCreatePhysics(version, pxFoundation, new physX.PxTolerancesScale(), false, null);\n\n physX.PxInitExtensions(pxPhysics, null);\n this._physX = physX;\n this._pxFoundation = pxFoundation;\n this._pxPhysics = pxPhysics;\n }\n}\n\nenum InitializeState {\n Uninitialized,\n Initializing,\n Initialized\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 private _sizeScale: Vector3 = new Vector3(1, 1, 1);\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._sizeScale, tempExtents);\n this._pxGeometry.halfExtents = tempExtents;\n this._pxShape.setGeometry(this._pxGeometry);\n\n this._updateController(tempExtents);\n }\n\n /**\n * {@inheritDoc IColliderShape.setWorldScale }\n */\n override setWorldScale(scale: Vector3): void {\n super.setWorldScale(scale);\n this._sizeScale.set(Math.abs(scale.x), Math.abs(scale.y), Math.abs(scale.z));\n const tempExtents = PhysXBoxColliderShape._tempHalfExtents;\n Vector3.multiply(this._halfSize, this._sizeScale, 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 pxController.setHalfHeight(extents.x);\n pxController.setHalfSideExtent(extents.y);\n pxController.setHalfForwardExtent(extents.z);\n }\n }\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 { 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 _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(slopeLimit);\n }\n\n /**\n * {@inheritDoc ICharacterController.addShape }\n */\n addShape(shape: PhysXColliderShape): void {\n this._pxManager && this._createPXController(this._pxManager, shape);\n this._shape = shape;\n shape._controllers.add(this);\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 }\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.x;\n desc.halfSideExtent = shape._halfSize.y;\n desc.halfForwardExtent = shape._halfSize.z;\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 } else {\n throw \"unsupported shape type\";\n }\n\n desc.setMaterial(shape._pxMaterial);\n\n this._pxController = pxManager._getControllerManager().createController(desc);\n this._pxController.setUUID(shape._id);\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() {\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\";\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 _pxActor: any;\n\n protected _physXPhysics: PhysXPhysics;\n\n constructor(physXPhysics: PhysXPhysics) {\n this._physXPhysics = physXPhysics;\n }\n\n /**\n * {@inheritDoc ICollider.addShape }\n */\n addShape(shape: PhysXColliderShape): void {\n this._pxActor.attachShape(shape._pxShape);\n }\n\n /**\n * {@inheritDoc ICollider.removeShape }\n */\n removeShape(shape: PhysXColliderShape): void {\n this._pxActor.detachShape(shape._pxShape, true);\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.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 { 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 { 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","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 _xAxis = new Vector3(1, 0, 0);\n protected static _defaultVec = new Vector3();\n protected static _defaultQuat = new Quaternion();\n\n protected _pxJoint: any;\n protected _collider: PhysXCollider;\n private _connectedAnchor = new Vector3();\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(value?._pxActor || null, this._collider?._pxActor || null);\n }\n\n /**\n * {@inheritDoc IJoint.setConnectedAnchor }\n */\n setConnectedAnchor(value: Vector3): void {\n this._connectedAnchor.copyFrom(value);\n this._setLocalPose(0, value, PhysXJoint._defaultQuat);\n }\n\n /**\n * {@inheritDoc IJoint.setConnectedMassScale }\n */\n setConnectedMassScale(value: number): void {\n this._pxJoint.setInvMassScale0(1 / value);\n }\n\n /**\n * {@inheritDoc IJoint.setConnectedInertiaScale }\n */\n setConnectedInertiaScale(value: number): void {\n this._pxJoint.setInvInertiaScale0(1 / value);\n }\n\n /**\n * {@inheritDoc IJoint.setMassScale }\n */\n setMassScale(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.setInvInertiaScale1(1 / 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 * 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 null,\n PhysXJoint._defaultVec,\n PhysXJoint._defaultQuat,\n collider._pxActor,\n PhysXJoint._defaultVec,\n PhysXJoint._defaultQuat\n );\n }\n}\n","import { IHingeJoint } from \"@galacean/engine-design\";\nimport { 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 private _axisRotationQuaternion = new Quaternion();\n private _swingOffset = new Vector3();\n\n constructor(physXPhysics: PhysXPhysics, collider: PhysXCollider) {\n super(physXPhysics);\n this._collider = collider;\n this._pxJoint = physXPhysics._pxPhysics.createRevoluteJoint(\n null,\n PhysXJoint._defaultVec,\n PhysXJoint._defaultQuat,\n collider._pxActor,\n PhysXJoint._defaultVec,\n PhysXJoint._defaultQuat\n );\n }\n\n /**\n * {@inheritDoc IHingeJoint.setAxis }\n */\n setAxis(value: Vector3): void {\n const xAxis = PhysXJoint._xAxis;\n const axisRotationQuaternion = this._axisRotationQuaternion;\n xAxis.set(1, 0, 0);\n value.normalize();\n const angle = Math.acos(Vector3.dot(xAxis, value));\n Vector3.cross(xAxis, value, xAxis);\n Quaternion.rotationAxisAngle(xAxis, angle, axisRotationQuaternion);\n\n this._setLocalPose(0, this._swingOffset, axisRotationQuaternion);\n }\n\n /**\n * {@inheritDoc IHingeJoint.setSwingOffset }\n */\n setSwingOffset(value: Vector3): void {\n this._swingOffset.copyFrom(value);\n this._setLocalPose(1, this._swingOffset, this._axisRotationQuaternion);\n }\n\n /**\n * {@inheritDoc IHingeJoint.getAngle }\n */\n getAngle(): number {\n return 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(lowerLimit, 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(lowerLimit, upperLimit, stiffness, damping);\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 private _swingOffset = new Vector3();\n\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.setSwingOffset }\n */\n setSwingOffset(value: Vector3): void {\n this._swingOffset.copyFrom(value);\n this._setLocalPose(1, value, PhysXJoint._defaultQuat);\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","import { IPlaneColliderShape } from \"@galacean/engine-design\";\nimport { Quaternion, Vector3 } 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\n this._pxGeometry = new physXPhysics._physX.PxSphereGeometry(this._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","export { PhysXPhysics } from \"./PhysXPhysics\";\nexport { PhysXRuntimeMode } from \"./enum/PhysXRuntimeMode\";\n\n//@ts-ignore\nexport const version = `__buildVersion`;\n\nconsole.log(`Galacean PhysX version: ${version}`);\n"],"names":["_instanceof","left","right","Symbol","hasInstance","_set_prototype_of","o","p","Object","setPrototypeOf","__proto__","_inherits","subClass","superClass","TypeError","prototype","create","constructor","value","writable","configurable","ShapeFlag","ColliderShapeUpAxis","CollisionDetectionMode","CombineMode","QueryFlag","TriggerEventState","PhysXRuntimeMode","InitializeState","DisorderedArray","count","length","_elements","Array","add","element","push","delete","index","indexOf","deleteByIndex","get","elements","end","lastIndex","garbageCollection","SIMULATION_SHAPE","SCENE_QUERY_SHAPE","TRIGGER_SHAPE","PhysXColliderShape","physXPhysics","_controllers","_worldScale","Vector3","_position","_rotation","_axis","_physXRotation","Quaternion","_shapeFlags","_physXPhysics","setRotation","rotationYawPitchRoll","x","y","z","multiply","normalize","_setLocalPose","setPosition","copyFrom","controllers","i","n","_updateShapePosition","setWorldScale","scale","setContactOffset","offset","_pxShape","_pxController","setMaterial","_pxMaterial","setIsTrigger","_modifyFlag","_setShapeFlags","destroy","release","flags","setFlags","_physX","PxShapeFlags","_proto","transform","translation","rotation","setLocalPose","_initialize","material","id","_id","_pxPhysics","createShape","_pxGeometry","setUUID","flag","halfSqrt","PhysXBoxColliderShape","PhysXColliderShape1","uniqueID","size","_this","_halfSize","_sizeScale","halfSize","set","PxBoxGeometry","setSize","tempExtents","_tempHalfExtents","halfExtents","setGeometry","_updateController","Math","abs","extents","pxController","setHalfHeight","setHalfSideExtent","setHalfForwardExtent","PhysXCapsuleColliderShape","radius","height","_upAxis","Y","_radius","_halfHeight","PxCapsuleGeometry","setRadius","sizeScale","X","max","Z","setHeight","halfHeight","setUpAxis","upAxis","axis","physXRotation","geometry","PhysXCharacterController","_shapeScaledPosition","_worldPosition","move","disp","minDist","elapsedTime","_this__pxController","_this__pxController_move","setWorldPosition","position","_updateNativePosition","getWorldPosition","getPosition","subtract","setStepOffset","setNonWalkableMode","setUpDirection","up","setSlopeLimit","slopeLimit","addShape","shape","_pxManager","_createPXController","_shape","removeShape","_destroyPXController","pxManager","desc","PxBoxControllerDesc","halfSideExtent","halfForwardExtent","PxCapsuleControllerDesc","climbingMode","_getControllerManager","createController","shapePosition","worldScale","worldPosition","_tempVec","PhysXCollider","_pxActor","attachShape","detachShape","setWorldTransform","setGlobalPose","_transform","getWorldTransform","outPosition","outRotation","getGlobalPose","w","pos","rot","_tempTransform","Discrete","Continuous","ContinuousDynamic","ContinuousSpeculative","PhysXDynamicCollider","PhysXCollider1","createRigidDynamic","setLinearDamping","setAngularDamping","setLinearVelocity","setAngularVelocity","setMass","setCenterOfMass","setCMassLocalPose","setInertiaTensor","setMassSpaceInertiaTensor","setMaxAngularVelocity","setMaxDepenetrationVelocity","setSleepThreshold","setSolverIterations","setSolverIterationCounts","setCollisionDetectionMode","setRigidBodyFlag","PxRigidBodyFlag","eENABLE_CCD","eENABLE_CCD_FRICTION","eENABLE_SPECULATIVE_CCD","physX","setIsKinematic","eKINEMATIC","setConstraints","setRigidDynamicLockFlags","addForce","force","addTorque","torque","positionOrRotation","setKinematicTarget","tempTranslation","_tempTranslation","tempRotation","_tempRotation","sleep","putToSleep","wakeUp","PhysXPhysicsManager","_eventMap","PhysXPhysicsMaterial","staticFriction","dynamicFriction","bounciness","frictionCombine","bounceCombine","pxMaterial","createMaterial","setFrictionCombineMode","setRestitutionCombineMode","setBounciness","setRestitution","setDynamicFriction","setStaticFriction","setBounceCombine","setFrictionCombine","Average","Minimum","Multiply","Maximum","PhysXPhysicsScene","physicsManager","onContactEnter","onContactExit","onContactStay","onTriggerEnter","onTriggerExit","onTriggerStay","_pxControllerManager","_currentEvents","_eventPool","_physXManager","_pxRaycastHit","PxRaycastHit","_pxFilterData","PxQueryFilterData","PxQueryFlags","_onContactEnter","_onContactExit","_onContactStay","_onTriggerEnter","_onTriggerExit","_onTriggerStay","pxPhysics","physXSimulationCallbackInstance","PxSimulationEventCallback","implement","onContactBegin","index1","index2","onContactEnd","onContactPersist","onTriggerBegin","event","_getTrigger","state","Enter","onTriggerEnd","subMap","undefined","Exit","sceneDesc","getDefaultSceneDesc","getTolerancesScale","_pxScene","createScene","setGravity","addColliderShape","colliderShape","removeColliderShape","eventPool","eventMap","_this__physXManager","currentEvents","addCollider","collider","addActor","removeCollider","removeActor","addCharacterController","characterController","lastPXManager","removeCharacterController","update","_simulate","_fetchResults","_fireEvent","raycast","ray","distance","onRaycast","hit","pxHitResult","min","result","raycastSingle","origin","direction","PxQueryFilterCallback","preFilter","filterData","actor","postFilter","_tempPosition","_tempNormal","normal","pxNormal","pxPosition","getShape","getUUID","pxControllerManager","createControllerManager","simulate","block","fetchResults","pop","TriggerEvent","Stay","STATIC","DYNAMIC","PRE_FILTER","POST_FILTER","ANY_HIT","NO_BLOCK","PhysXStaticCollider","createRigidStatic","Auto","WebAssembly","JavaScript","PhysXJoint","_connectedAnchor","_breakForce","Number","MAX_VALUE","_breakTorque","setConnectedCollider","_this__collider","_pxJoint","setActors","_collider","setConnectedAnchor","_defaultQuat","setConnectedMassScale","setInvMassScale0","setConnectedInertiaScale","setInvInertiaScale0","setMassScale","setInvMassScale1","setInertiaScale","setInvInertiaScale1","setBreakForce","setBreakTorque","_xAxis","_defaultVec","PhysXFixedJoint","PhysXJoint1","createFixedJoint","PhysXHingeJoint","_axisRotationQuaternion","_swingOffset","createRevoluteJoint","setAxis","xAxis","axisRotationQuaternion","angle","acos","dot","cross","rotationAxisAngle","setSwingOffset","getAngle","getVelocity","setHardLimit","lowerLimit","upperLimit","contactDist","setSoftLimit","stiffness","damping","setDriveVelocity","velocity","autowake","setDriveForceLimit","limit","setDriveGearRatio","ratio","setHingeJointFlag","setRevoluteJointFlag","PhysXSpringJoint","createDistanceJoint","setDistanceJointFlag","setMinDistance","setMaxDistance","setTolerance","tolerance","setStiffness","setDamping","PhysXPlaneColliderShape","PxPlaneGeometry","PhysXSphereColliderShape","_maxScale","PxSphereGeometry","PhysXPhysics","runtimeMode","_initializeState","Uninitialized","_runTimeMode","initialize","Initialized","Promise","resolve","Initializing","_initializePromise","scriptPromise","reject","script","document","createElement","body","appendChild","async","onload","onerror","instantiate","module","Module","Uint8Array","of","Instance","e","src","initializePromise","then","window","PHYSX","_init","console","log","catch","PxCloseExtensions","_pxFoundation","createPhysicsManager","createPhysicsScene","createStaticCollider","createDynamicCollider","createCharacterController","createPhysicsMaterial","createBoxColliderShape","createSphereColliderShape","createPlaneColliderShape","createCapsuleColliderShape","createHingeJoint","createSpringJoint","version","PX_PHYSICS_VERSION","defaultErrorCallback","PxDefaultErrorCallback","allocator","PxDefaultAllocator","pxFoundation","PxCreateFoundation","PxCreatePhysics","PxTolerancesScale","PxInitExtensions"],"mappings":"oVAAO,SAASA,EAAYC,CAAI,CAAEC,CAAK,SACnC,AAAIA,AAAS,MAATA,GAAiB,AAAkB,aAAlB,OAAOC,QAA0BD,CAAK,CAACC,OAAOC,WAAW,CAAC,CACpE,CAAC,CAACF,CAAK,CAACC,OAAOC,WAAW,CAAC,CAACH,GACzBA,aAAgBC,CAClC,CCJO,SAASG,EAAkBC,CAAC,CAAEC,CAAC,EAOlC,MAAOF,AANPA,CAAAA,EAAoBG,OAAOC,cAAc,EAAI,SAAwBH,CAAC,CAAEC,CAAC,EAGrE,OAFAD,EAAEI,SAAS,CAAGH,EAEPD,CACf,CAAA,EAE6BA,EAAGC,EAChC,CCNO,SAASI,EAAUC,CAAQ,CAAEC,CAAU,EAC1C,GAAI,AAAsB,YAAtB,OAAOA,GAA6BA,AAAe,OAAfA,EACpC,MAAM,AAAIC,UAAU,qDAGxBF,CAAAA,EAASG,SAAS,CAAGP,OAAOQ,MAAM,CAACH,GAAcA,EAAWE,SAAS,CAAE,CAAEE,YAAa,CAAEC,MAAON,EAAUO,SAAU,CAAA,EAAMC,aAAc,CAAA,CAAM,CAAA,GAEzIP,GAAYR,EAAkBO,EAAUC,EAChD,CCPO,ICOKQ,EC+IPC,ECjJOC,ECiEPC,EC8MAC,EAYAC,EChSOC,ECoQPC,EN7PEP,EC+IPC,ECjJOC,ECiEPC,EC8MAC,EAYAC,EE5BAE,EPpQaC,EAAN,WAAMA,SAAAA,EAKCC,CAAiB,WAAjBA,GAAAA,CAAAA,EAAgB,CAAA,OAF5BC,MAAiB,CAAA,EAGf,IAAI,CAACC,SAAS,CAAG,AAAIC,MAASH,GANrBD,IAAA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CAAAA,eAFGpb,CAAAA,CAAAA,EAGHib,YAAAA,EAAAA,CAAAA,cYtQW6C,IAAAA,EAAW,eAExBjB,QAAQC,GAAG,CAAE,2BAA0BgB"}
|
package/dist/main.js
CHANGED
|
@@ -196,8 +196,10 @@ var ShapeFlag;
|
|
|
196
196
|
var _this;
|
|
197
197
|
_this = PhysXColliderShape1.call(this, physXPhysics) || this;
|
|
198
198
|
/** @internal */ _this._halfSize = new engine.Vector3();
|
|
199
|
-
_this.
|
|
200
|
-
|
|
199
|
+
_this._sizeScale = new engine.Vector3(1, 1, 1);
|
|
200
|
+
var halfSize = _this._halfSize;
|
|
201
|
+
halfSize.set(size.x * 0.5, size.y * 0.5, size.z * 0.5);
|
|
202
|
+
_this._pxGeometry = new physXPhysics._physX.PxBoxGeometry(halfSize.x, halfSize.y, halfSize.z);
|
|
201
203
|
_this._initialize(material, uniqueID);
|
|
202
204
|
_this._setLocalPose();
|
|
203
205
|
return _this;
|
|
@@ -206,9 +208,10 @@ var ShapeFlag;
|
|
|
206
208
|
/**
|
|
207
209
|
* {@inheritDoc IBoxColliderShape.setSize }
|
|
208
210
|
*/ _proto.setSize = function setSize(value) {
|
|
211
|
+
var halfSize = this._halfSize;
|
|
209
212
|
var tempExtents = PhysXBoxColliderShape._tempHalfExtents;
|
|
210
|
-
|
|
211
|
-
engine.Vector3.multiply(
|
|
213
|
+
halfSize.set(value.x * 0.5, value.y * 0.5, value.z * 0.5);
|
|
214
|
+
engine.Vector3.multiply(halfSize, this._sizeScale, tempExtents);
|
|
212
215
|
this._pxGeometry.halfExtents = tempExtents;
|
|
213
216
|
this._pxShape.setGeometry(this._pxGeometry);
|
|
214
217
|
this._updateController(tempExtents);
|
|
@@ -217,8 +220,9 @@ var ShapeFlag;
|
|
|
217
220
|
* {@inheritDoc IColliderShape.setWorldScale }
|
|
218
221
|
*/ _proto.setWorldScale = function setWorldScale(scale) {
|
|
219
222
|
PhysXColliderShape1.prototype.setWorldScale.call(this, scale);
|
|
223
|
+
this._sizeScale.set(Math.abs(scale.x), Math.abs(scale.y), Math.abs(scale.z));
|
|
220
224
|
var tempExtents = PhysXBoxColliderShape._tempHalfExtents;
|
|
221
|
-
engine.Vector3.multiply(this._halfSize, this.
|
|
225
|
+
engine.Vector3.multiply(this._halfSize, this._sizeScale, tempExtents);
|
|
222
226
|
this._pxGeometry.halfExtents = tempExtents;
|
|
223
227
|
this._pxShape.setGeometry(this._pxGeometry);
|
|
224
228
|
this._updateController(tempExtents);
|
|
@@ -246,6 +250,7 @@ var ShapeFlag;
|
|
|
246
250
|
var _this;
|
|
247
251
|
_this = PhysXColliderShape1.call(this, physXPhysics) || this;
|
|
248
252
|
_this._upAxis = /** Up axis is Y. */ 1;
|
|
253
|
+
_this._sizeScale = new engine.Vector3(1, 1, 1);
|
|
249
254
|
_this._radius = radius;
|
|
250
255
|
_this._halfHeight = height * 0.5;
|
|
251
256
|
_this._axis = new engine.Quaternion(0, 0, PhysXColliderShape.halfSqrt, PhysXColliderShape.halfSqrt);
|
|
@@ -260,15 +265,16 @@ var ShapeFlag;
|
|
|
260
265
|
* {@inheritDoc ICapsuleColliderShape.setRadius }
|
|
261
266
|
*/ _proto.setRadius = function setRadius(value) {
|
|
262
267
|
this._radius = value;
|
|
268
|
+
var sizeScale = this._sizeScale;
|
|
263
269
|
switch(this._upAxis){
|
|
264
270
|
case /** Up axis is X. */ 0:
|
|
265
|
-
this._pxGeometry.radius = this._radius * Math.max(
|
|
271
|
+
this._pxGeometry.radius = this._radius * Math.max(sizeScale.y, sizeScale.z);
|
|
266
272
|
break;
|
|
267
273
|
case 1:
|
|
268
|
-
this._pxGeometry.radius = this._radius * Math.max(
|
|
274
|
+
this._pxGeometry.radius = this._radius * Math.max(sizeScale.x, sizeScale.z);
|
|
269
275
|
break;
|
|
270
276
|
case /** Up axis is Z. */ 2:
|
|
271
|
-
this._pxGeometry.radius = this._radius * Math.max(
|
|
277
|
+
this._pxGeometry.radius = this._radius * Math.max(sizeScale.x, sizeScale.y);
|
|
272
278
|
break;
|
|
273
279
|
}
|
|
274
280
|
this._pxShape.setGeometry(this._pxGeometry);
|
|
@@ -282,15 +288,16 @@ var ShapeFlag;
|
|
|
282
288
|
* {@inheritDoc ICapsuleColliderShape.setHeight }
|
|
283
289
|
*/ _proto.setHeight = function setHeight(value) {
|
|
284
290
|
this._halfHeight = value * 0.5;
|
|
291
|
+
var sizeScale = this._sizeScale;
|
|
285
292
|
switch(this._upAxis){
|
|
286
293
|
case 0:
|
|
287
|
-
this._pxGeometry.halfHeight = this._halfHeight *
|
|
294
|
+
this._pxGeometry.halfHeight = this._halfHeight * sizeScale.x;
|
|
288
295
|
break;
|
|
289
296
|
case 1:
|
|
290
|
-
this._pxGeometry.halfHeight = this._halfHeight *
|
|
297
|
+
this._pxGeometry.halfHeight = this._halfHeight * sizeScale.y;
|
|
291
298
|
break;
|
|
292
299
|
case 2:
|
|
293
|
-
this._pxGeometry.halfHeight = this._halfHeight *
|
|
300
|
+
this._pxGeometry.halfHeight = this._halfHeight * sizeScale.z;
|
|
294
301
|
break;
|
|
295
302
|
}
|
|
296
303
|
this._pxShape.setGeometry(this._pxGeometry);
|
|
@@ -328,19 +335,20 @@ var ShapeFlag;
|
|
|
328
335
|
* {@inheritDoc IColliderShape.setWorldScale }
|
|
329
336
|
*/ _proto.setWorldScale = function setWorldScale(scale) {
|
|
330
337
|
PhysXColliderShape1.prototype.setWorldScale.call(this, scale);
|
|
338
|
+
var sizeScale = this._sizeScale.set(Math.abs(scale.x), Math.abs(scale.y), Math.abs(scale.z));
|
|
331
339
|
var geometry = this._pxGeometry;
|
|
332
340
|
switch(this._upAxis){
|
|
333
341
|
case 0:
|
|
334
|
-
geometry.radius = this._radius * Math.max(
|
|
335
|
-
geometry.halfHeight = this._halfHeight *
|
|
342
|
+
geometry.radius = this._radius * Math.max(sizeScale.y, sizeScale.z);
|
|
343
|
+
geometry.halfHeight = this._halfHeight * sizeScale.x;
|
|
336
344
|
break;
|
|
337
345
|
case 1:
|
|
338
|
-
geometry.radius = this._radius * Math.max(
|
|
339
|
-
geometry.halfHeight = this._halfHeight *
|
|
346
|
+
geometry.radius = this._radius * Math.max(sizeScale.x, sizeScale.z);
|
|
347
|
+
geometry.halfHeight = this._halfHeight * sizeScale.y;
|
|
340
348
|
break;
|
|
341
349
|
case 2:
|
|
342
|
-
geometry.radius = this._radius * Math.max(
|
|
343
|
-
geometry.halfHeight = this._halfHeight *
|
|
350
|
+
geometry.radius = this._radius * Math.max(sizeScale.x, sizeScale.y);
|
|
351
|
+
geometry.halfHeight = this._halfHeight * sizeScale.z;
|
|
344
352
|
break;
|
|
345
353
|
}
|
|
346
354
|
this._pxShape.setGeometry(geometry);
|
|
@@ -1262,7 +1270,7 @@ var /**
|
|
|
1262
1270
|
* {@inheritDoc IColliderShape.setWorldScale }
|
|
1263
1271
|
*/ _proto.setWorldScale = function setWorldScale(scale) {
|
|
1264
1272
|
PhysXColliderShape1.prototype.setWorldScale.call(this, scale);
|
|
1265
|
-
this._maxScale = Math.max(scale.x, scale.y, scale.z);
|
|
1273
|
+
this._maxScale = Math.max(Math.abs(scale.x), Math.abs(scale.y), Math.abs(scale.z));
|
|
1266
1274
|
this._pxGeometry.radius = this._radius * this._maxScale;
|
|
1267
1275
|
this._pxShape.setGeometry(this._pxGeometry);
|
|
1268
1276
|
};
|
|
@@ -1429,7 +1437,7 @@ var InitializeState;
|
|
|
1429
1437
|
})(InitializeState || (InitializeState = {}));
|
|
1430
1438
|
|
|
1431
1439
|
//@ts-ignore
|
|
1432
|
-
var version = "1.2.0-beta.
|
|
1440
|
+
var version = "1.2.0-beta.4";
|
|
1433
1441
|
console.log("Galacean PhysX version: " + version);
|
|
1434
1442
|
|
|
1435
1443
|
exports.PhysXPhysics = PhysXPhysics;
|