{"ast":null,"code":"import { Vector3 } from \"../Maths/math.vector.js\";\n/**\n * Base class for results of casts.\n */\nexport class CastingResult {\n constructor() {\n this._hasHit = false;\n this._hitNormal = Vector3.Zero();\n this._hitPoint = Vector3.Zero();\n this._triangleIndex = -1;\n }\n /**\n * Gets the hit point.\n */\n get hitPoint() {\n return this._hitPoint;\n }\n /**\n * Gets the hit normal.\n */\n get hitNormal() {\n return this._hitNormal;\n }\n /**\n * Gets if there was a hit\n */\n get hasHit() {\n return this._hasHit;\n }\n /*\n * The index of the original triangle which was hit. Will be -1 if contact point is not on a mesh shape\n */\n get triangleIndex() {\n return this._triangleIndex;\n }\n /**\n * Sets the hit data\n * @param hitNormal defines the normal in world space\n * @param hitPoint defines the point in world space\n * @param triangleIndex defines the index of the triangle in case of mesh shape\n */\n setHitData(hitNormal, hitPoint, triangleIndex) {\n this._hasHit = true;\n this._hitNormal.set(hitNormal.x, hitNormal.y, hitNormal.z);\n this._hitPoint.set(hitPoint.x, hitPoint.y, hitPoint.z);\n this._triangleIndex = triangleIndex !== null && triangleIndex !== void 0 ? triangleIndex : -1;\n }\n /**\n * Resets all the values to default\n */\n reset() {\n this._hasHit = false;\n this._hitNormal.setAll(0);\n this._hitPoint.setAll(0);\n this._triangleIndex = -1;\n this.body = undefined;\n this.bodyIndex = undefined;\n this.shape = undefined;\n }\n}","map":{"version":3,"names":["Vector3","CastingResult","constructor","_hasHit","_hitNormal","Zero","_hitPoint","_triangleIndex","hitPoint","hitNormal","hasHit","triangleIndex","setHitData","set","x","y","z","reset","setAll","body","undefined","bodyIndex","shape"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Physics/castingResult.js"],"sourcesContent":["import { Vector3 } from \"../Maths/math.vector.js\";\n/**\n * Base class for results of casts.\n */\nexport class CastingResult {\n constructor() {\n this._hasHit = false;\n this._hitNormal = Vector3.Zero();\n this._hitPoint = Vector3.Zero();\n this._triangleIndex = -1;\n }\n /**\n * Gets the hit point.\n */\n get hitPoint() {\n return this._hitPoint;\n }\n /**\n * Gets the hit normal.\n */\n get hitNormal() {\n return this._hitNormal;\n }\n /**\n * Gets if there was a hit\n */\n get hasHit() {\n return this._hasHit;\n }\n /*\n * The index of the original triangle which was hit. Will be -1 if contact point is not on a mesh shape\n */\n get triangleIndex() {\n return this._triangleIndex;\n }\n /**\n * Sets the hit data\n * @param hitNormal defines the normal in world space\n * @param hitPoint defines the point in world space\n * @param triangleIndex defines the index of the triangle in case of mesh shape\n */\n setHitData(hitNormal, hitPoint, triangleIndex) {\n this._hasHit = true;\n this._hitNormal.set(hitNormal.x, hitNormal.y, hitNormal.z);\n this._hitPoint.set(hitPoint.x, hitPoint.y, hitPoint.z);\n this._triangleIndex = triangleIndex ?? -1;\n }\n /**\n * Resets all the values to default\n */\n reset() {\n this._hasHit = false;\n this._hitNormal.setAll(0);\n this._hitPoint.setAll(0);\n this._triangleIndex = -1;\n this.body = undefined;\n this.bodyIndex = undefined;\n this.shape = undefined;\n }\n}\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,yBAAyB;AACjD;AACA;AACA;AACA,OAAO,MAAMC,aAAa,CAAC;EACvBC,WAAWA,CAAA,EAAG;IACV,IAAI,CAACC,OAAO,GAAG,KAAK;IACpB,IAAI,CAACC,UAAU,GAAGJ,OAAO,CAACK,IAAI,CAAC,CAAC;IAChC,IAAI,CAACC,SAAS,GAAGN,OAAO,CAACK,IAAI,CAAC,CAAC;IAC/B,IAAI,CAACE,cAAc,GAAG,CAAC,CAAC;EAC5B;EACA;AACJ;AACA;EACI,IAAIC,QAAQA,CAAA,EAAG;IACX,OAAO,IAAI,CAACF,SAAS;EACzB;EACA;AACJ;AACA;EACI,IAAIG,SAASA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACL,UAAU;EAC1B;EACA;AACJ;AACA;EACI,IAAIM,MAAMA,CAAA,EAAG;IACT,OAAO,IAAI,CAACP,OAAO;EACvB;EACA;AACJ;AACA;EACI,IAAIQ,aAAaA,CAAA,EA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