{"ast":null,"code":"import { TransformNode } from \"../../Meshes/transformNode.js\";\nimport \"../joinedPhysicsEngineComponent.js\";\nObject.defineProperty(TransformNode.prototype, \"physicsBody\", {\n get: function () {\n return this._physicsBody;\n },\n set: function (value) {\n if (this._physicsBody === value) {\n return;\n }\n if (this._disposePhysicsObserver) {\n this.onDisposeObservable.remove(this._disposePhysicsObserver);\n }\n this._physicsBody = value;\n if (value) {\n this._disposePhysicsObserver = this.onDisposeObservable.add(() => {\n // Physics\n if (this.physicsBody) {\n this.physicsBody.dispose( /*!doNotRecurse*/);\n this.physicsBody = null;\n }\n });\n }\n },\n enumerable: true,\n configurable: true\n});\n/**\n * Gets the current physics body\n * @returns a physics body or null\n */\nTransformNode.prototype.getPhysicsBody = function () {\n return this.physicsBody;\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 */\nTransformNode.prototype.applyImpulse = function (force, contactPoint) {\n if (!this.physicsBody) {\n throw new Error(\"No Physics Body for TransformNode\");\n }\n this.physicsBody.applyImpulse(force, contactPoint);\n return this;\n};\n/**\n * Apply a physic angular impulse to the mesh\n * @param angularImpulse defines the torque to apply\n * @returns the current mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\n */\nTransformNode.prototype.applyAngularImpulse = function (angularImpulse) {\n if (!this.physicsBody) {\n throw new Error(\"No Physics Body for TransformNode\");\n }\n this.physicsBody.applyAngularImpulse(angularImpulse);\n return this;\n};","map":{"version":3,"names":["TransformNode","Object","defineProperty","prototype","get","_physicsBody","set","value","_disposePhysicsObserver","onDisposeObservable","remove","add","physicsBody","dispose","enumerable","configurable","getPhysicsBody","applyImpulse","force","contactPoint","Error","applyAngularImpulse","angularImpulse"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Physics/v2/physicsEngineComponent.js"],"sourcesContent":["import { TransformNode } from \"../../Meshes/transformNode.js\";\nimport \"../joinedPhysicsEngineComponent.js\";\nObject.defineProperty(TransformNode.prototype, \"physicsBody\", {\n get: function () {\n return this._physicsBody;\n },\n set: function (value) {\n if (this._physicsBody === value) {\n return;\n }\n if (this._disposePhysicsObserver) {\n this.onDisposeObservable.remove(this._disposePhysicsObserver);\n }\n this._physicsBody = value;\n if (value) {\n this._disposePhysicsObserver = this.onDisposeObservable.add(() => {\n // Physics\n if (this.physicsBody) {\n this.physicsBody.dispose( /*!doNotRecurse*/);\n this.physicsBody = null;\n }\n });\n }\n },\n enumerable: true,\n configurable: true,\n});\n/**\n * Gets the current physics body\n * @returns a physics body or null\n */\nTransformNode.prototype.getPhysicsBody = function () {\n return this.physicsBody;\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 */\nTransformNode.prototype.applyImpulse = function (force, contactPoint) {\n if (!this.physicsBody) {\n throw new Error(\"No Physics Body for TransformNode\");\n }\n this.physicsBody.applyImpulse(force, contactPoint);\n return this;\n};\n/**\n * Apply a physic angular impulse to the mesh\n * @param angularImpulse defines the torque to apply\n * @returns the current mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\n */\nTransformNode.prototype.applyAngularImpulse = function (angularImpulse) {\n if (!this.physicsBody) {\n throw new Error(\"No Physics Body for TransformNode\");\n }\n this.physicsBody.applyAngularImpulse(angularImpulse);\n return this;\n};\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,+BAA+B;AAC7D,OAAO,oCAAoC;AAC3CC,MAAM,CAACC,cAAc,CAACF,aAAa,CAACG,SAAS,EAAE,aAAa,EAAE;EAC1DC,GAAG,EAAE,SAAAA,CAAA,EAAY;IACb,OAAO,IAAI,CAACC,YAAY;EAC5B,CAAC;EACDC,GAAG,EAAE,SAAAA,CAAUC,KAAK,EA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AI;AACf,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}