f9eb5bbaa17ae80e4b610373070312129561dbaddee06e612322d29de0b6febe.json 6.8 KB

1
  1. {"ast":null,"code":"import { AbstractMesh } from \"../../Meshes/abstractMesh.js\";\nimport { PhysicsJoint } from \"./physicsJoint.js\";\nObject.defineProperty(AbstractMesh.prototype, \"physicsImpostor\", {\n get: function () {\n return this._physicsImpostor;\n },\n set: function (value) {\n if (this._physicsImpostor === value) {\n return;\n }\n if (this._disposePhysicsObserver) {\n this.onDisposeObservable.remove(this._disposePhysicsObserver);\n }\n this._physicsImpostor = value;\n if (value) {\n this._disposePhysicsObserver = this.onDisposeObservable.add(() => {\n // Physics\n if (this.physicsImpostor) {\n this.physicsImpostor.dispose( /*!doNotRecurse*/);\n this.physicsImpostor = null;\n }\n });\n }\n },\n enumerable: true,\n configurable: true\n});\n/**\n * Gets the current physics impostor\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics\n * @returns a physics impostor or null\n */\nAbstractMesh.prototype.getPhysicsImpostor = function () {\n return this.physicsImpostor;\n};\n/**\n * Apply a physic impulse to the mesh\n * @param force defines the force to apply\n * @param contactPoint defines where to apply the force\n * @returns the current mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\n */\nAbstractMesh.prototype.applyImpulse = function (force, contactPoint) {\n if (!this.physicsImpostor) {\n return this;\n }\n this.physicsImpostor.applyImpulse(force, contactPoint);\n return this;\n};\n/**\n * Creates a physic joint between two meshes\n * @param otherMesh defines the other mesh to use\n * @param pivot1 defines the pivot to use on this mesh\n * @param pivot2 defines the pivot to use on the other mesh\n * @param options defines additional options (can be plugin dependent)\n * @returns the current mesh\n * @see https://www.babylonjs-playground.com/#0BS5U0#0\n */\nAbstractMesh.prototype.setPhysicsLinkWith = function (otherMesh, pivot1, pivot2, options) {\n if (!this.physicsImpostor || !otherMesh.physicsImpostor) {\n return this;\n }\n this.physicsImpostor.createJoint(otherMesh.physicsImpostor, PhysicsJoint.HingeJoint, {\n mainPivot: pivot1,\n connectedPivot: pivot2,\n nativeParams: options\n });\n return this;\n};","map":{"version":3,"names":["AbstractMesh","PhysicsJoint","Object","defineProperty","prototype","get","_physicsImpostor","set","value","_disposePhysicsObserver","onDisposeObservable","remove","add","physicsImpostor","dispose","enumerable","configurable","getPhysicsImpostor","applyImpulse","force","contactPoint","setPhysicsLinkWith","otherMesh","pivot1","pivot2","options","createJoint","HingeJoint","mainPivot","connectedPivot","nativeParams"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Physics/v1/physicsEngineComponent.js"],"sourcesContent":["import { AbstractMesh } from \"../../Meshes/abstractMesh.js\";\nimport { PhysicsJoint } from \"./physicsJoint.js\";\nObject.defineProperty(AbstractMesh.prototype, \"physicsImpostor\", {\n get: function () {\n return this._physicsImpostor;\n },\n set: function (value) {\n if (this._physicsImpostor === value) {\n return;\n }\n if (this._disposePhysicsObserver) {\n this.onDisposeObservable.remove(this._disposePhysicsObserver);\n }\n this._physicsImpostor = value;\n if (value) {\n this._disposePhysicsObserver = this.onDisposeObservable.add(() => {\n // Physics\n if (this.physicsImpostor) {\n this.physicsImpostor.dispose( /*!doNotRecurse*/);\n this.physicsImpostor = null;\n }\n });\n }\n },\n enumerable: true,\n configurable: true,\n});\n/**\n * Gets the current physics impostor\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics\n * @returns a physics impostor or null\n */\nAbstractMesh.prototype.getPhysicsImpostor = function () {\n return this.physicsImpostor;\n};\n/**\n * Apply a physic impulse to the mesh\n * @param force defines the force to apply\n * @param contactPoint defines where to apply the force\n * @returns the current mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\n */\nAbstractMesh.prototype.applyImpulse = function (force, contactPoint) {\n if (!this.physicsImpostor) {\n return this;\n }\n this.physicsImpostor.applyImpulse(force, contactPoint);\n return this;\n};\n/**\n * Creates a physic joint between two meshes\n * @param otherMesh defines the other mesh to use\n * @param pivot1 defines the pivot to use on this mesh\n * @param pivot2 defines the pivot to use on the other mesh\n * @param options defines additional options (can be plugin dependent)\n * @returns the current mesh\n * @see https://www.babylonjs-playground.com/#0BS5U0#0\n */\nAbstractMesh.prototype.setPhysicsLinkWith = function (otherMesh, pivot1, pivot2, options) {\n if (!this.physicsImpostor || !otherMesh.physicsImpostor) {\n return this;\n }\n this.physicsImpostor.createJoint(otherMesh.physicsImpostor, PhysicsJoint.HingeJoint, {\n mainPivot: pivot1,\n connectedPivot: pivot2,\n nativeParams: options,\n });\n return this;\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,8BAA8B;AAC3D,SAASC,YAAY,QAAQ,mBAAmB;AAChDC,MAAM,CAACC,cAAc,CAACH,YAAY,CAACI,SAAS,EAAE,iBAAiB,EAAE;EAC7DC,GAAG,EAAE,SAAAA,CAAA,EAAY;IACb,OAAO,IAAI,CAACC,gBAAgB;EAChC,CAAC;EACDC,GAAG,EAAE,SAAAA,CAAUC,KAAK,EAAE;IAClB,IAAI,IAAI,CAACF,gBAAgB,KAAKE,KAAK,EAAE;MACjC;IACJ;IACA,IAAI,IAAI,CAACC,uBAAuB,EAAE;MAC9B,IAAI,CAACC,mBAAmB,CAACC,MAAM,CAAC,IAAI,CAACF,uBAAuB,CAAC;IACjE;IACA,IAAI,CAACH,gBAAgB,GAAGE,KAAK;IAC7B,IAAIA,KAAK,EAAE;MACP,IAAI,CAACC,uBAAuB,GAAG,IAAI,CAACC,mBAAmB,CAACE,GAAG,CAAC,MAAM;QAC9D;QACA,IAAI,IAAI,CAACC,eAAe,EAAE;UACtB,IAAI,CAACA,eAAe,CAACC,OAAO,CAAmB,CAAjB,kBAAkB;UAChD,IAAI,CAACD,eAAe,GAAG,IAAI;QAC/B;MACJ,CAAC,CAAC;IACN;EACJ,CAAC;EACDE,UAAU,EAAE,IAAI;EAChBC,YAAY,EAAE;AAClB,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACAhB,YAAY,CAACI,SAAS,CAACa,kBAAkB,GAAG,YAAY;EACpD,OAAO,IAAI,CAACJ,eAAe;AAC/B,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACAb,YAAY,CAACI,SAAS,CAACc,YAAY,GAAG,UAAUC,KAAK,EAAEC,YAAY,EAAE;EACjE,IAAI,CAAC,IAAI,CAACP,eAAe,EAAE;IACvB,OAAO,IAAI;EACf;EACA,IAAI,CAACA,eAAe,CAACK,YAAY,CAACC,KAAK,EAAEC,YAAY,CAAC;EACtD,OAAO,IAAI;AACf,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACApB,YAAY,CAACI,SAAS,CAACiB,kBAAkB,GAAG,UAAUC,SAAS,EAAEC,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE;EACtF,IAAI,CAAC,IAAI,CAACZ,eAAe,IAAI,CAACS,SAAS,CAACT,eAAe,EAAE;IACrD,OAAO,IAAI;EACf;EACA,IAAI,CAACA,eAAe,CAACa,WAAW,CAACJ,SAAS,CAACT,eAAe,EAAEZ,YAAY,CAAC0B,UAAU,EAAE;IACjFC,SAAS,EAAEL,MAAM;IACjBM,cAAc,EAAEL,MAAM;IACtBM,YAAY,EAAEL;EAClB,CAAC,CAAC;EACF,OAAO,IAAI;AACf,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}