af565467c5da3a5e3aa966b8094257dd7be407f7be57c9261fde2dc68553685c.json 5.4 KB

1
  1. {"ast":null,"code":"import { Vector3 } from \"../Maths/math.vector.js\";\nimport { CastingResult } from \"./castingResult.js\";\n/**\n * Holds the data for the raycast result\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\n */\nexport class PhysicsRaycastResult extends CastingResult {\n constructor() {\n super(...arguments);\n this._hitDistance = 0;\n this._rayFromWorld = Vector3.Zero();\n this._rayToWorld = Vector3.Zero();\n }\n /**\n * Gets the distance from the hit\n */\n get hitDistance() {\n return this._hitDistance;\n }\n /**\n * Gets the hit normal/direction in the world\n */\n get hitNormalWorld() {\n return this._hitNormal;\n }\n /**\n * Gets the hit point in the world\n */\n get hitPointWorld() {\n return this._hitPoint;\n }\n /**\n * Gets the ray \"start point\" of the ray in the world\n */\n get rayFromWorld() {\n return this._rayFromWorld;\n }\n /**\n * Gets the ray \"end point\" of the ray in the world\n */\n get rayToWorld() {\n return this._rayToWorld;\n }\n /**\n * Sets the distance from the start point to the hit point\n * @param distance defines the distance to set\n */\n setHitDistance(distance) {\n this._hitDistance = distance;\n }\n /**\n * Calculates the distance manually\n */\n calculateHitDistance() {\n this._hitDistance = Vector3.Distance(this._rayFromWorld, this._hitPoint);\n }\n /**\n * Resets all the values to default\n * @param from The from point on world space\n * @param to The to point on world space\n */\n reset(from = Vector3.Zero(), to = Vector3.Zero()) {\n super.reset();\n this._rayFromWorld.copyFrom(from);\n this._rayToWorld.copyFrom(to);\n this._hitDistance = 0;\n }\n}","map":{"version":3,"names":["Vector3","CastingResult","PhysicsRaycastResult","constructor","arguments","_hitDistance","_rayFromWorld","Zero","_rayToWorld","hitDistance","hitNormalWorld","_hitNormal","hitPointWorld","_hitPoint","rayFromWorld","rayToWorld","setHitDistance","distance","calculateHitDistance","Distance","reset","from","to","copyFrom"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Physics/physicsRaycastResult.js"],"sourcesContent":["import { Vector3 } from \"../Maths/math.vector.js\";\nimport { CastingResult } from \"./castingResult.js\";\n/**\n * Holds the data for the raycast result\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\n */\nexport class PhysicsRaycastResult extends CastingResult {\n constructor() {\n super(...arguments);\n this._hitDistance = 0;\n this._rayFromWorld = Vector3.Zero();\n this._rayToWorld = Vector3.Zero();\n }\n /**\n * Gets the distance from the hit\n */\n get hitDistance() {\n return this._hitDistance;\n }\n /**\n * Gets the hit normal/direction in the world\n */\n get hitNormalWorld() {\n return this._hitNormal;\n }\n /**\n * Gets the hit point in the world\n */\n get hitPointWorld() {\n return this._hitPoint;\n }\n /**\n * Gets the ray \"start point\" of the ray in the world\n */\n get rayFromWorld() {\n return this._rayFromWorld;\n }\n /**\n * Gets the ray \"end point\" of the ray in the world\n */\n get rayToWorld() {\n return this._rayToWorld;\n }\n /**\n * Sets the distance from the start point to the hit point\n * @param distance defines the distance to set\n */\n setHitDistance(distance) {\n this._hitDistance = distance;\n }\n /**\n * Calculates the distance manually\n */\n calculateHitDistance() {\n this._hitDistance = Vector3.Distance(this._rayFromWorld, this._hitPoint);\n }\n /**\n * Resets all the values to default\n * @param from The from point on world space\n * @param to The to point on world space\n */\n reset(from = Vector3.Zero(), to = Vector3.Zero()) {\n super.reset();\n this._rayFromWorld.copyFrom(from);\n this._rayToWorld.copyFrom(to);\n this._hitDistance = 0;\n }\n}\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,yBAAyB;AACjD,SAASC,aAAa,QAAQ,oBAAoB;AAClD;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,SAASD,aAAa,CAAC;EACpDE,WAAWA,CAAA,EAAG;IACV,KAAK,CAAC,GAAGC,SAAS,CAAC;IACnB,IAAI,CAACC,YAAY,GAAG,CAAC;IACrB,IAAI,CAACC,aAAa,GAAGN,OAAO,CAACO,IAAI,CAAC,CAAC;IACnC,IAAI,CAACC,WAAW,GAAGR,OAAO,CAACO,IAAI,CAAC,CAAC;EACrC;EACA;AACJ;AACA;EACI,IAAIE,WAAWA,CAAA,EAAG;IACd,OAAO,IAAI,CAACJ,YAAY;EAC5B;EACA;AACJ;AACA;EACI,IAAIK,cAAcA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACC,UAAU;EAC1B;EACA;AACJ;AACA;EACI,IAAIC,aAAaA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACC,SAAS;EACzB;EACA;AACJ;AACA;EACI,IAAIC,YAAYA,CAAA,EAAG;IACf,OAAO,IAAI,CAACR,aAAa;EAC7B;EACA;AACJ;AACA;EACI,IAAIS,UAAUA,CAAA,EAAG;IACb,OAAO,IAAI,CAACP,WAAW;EAC3B;EACA;AACJ;AACA;AACA;EACIQ,cAAcA,CAACC,QAAQ,EAAE;IACrB,IAAI,CAACZ,YAAY,GAAGY,QAAQ;EAChC;EACA;AACJ;AACA;EACIC,oBAAoBA,CAAA,EAAG;IACnB,IAAI,CAACb,YAAY,GAAGL,OAAO,CAACmB,QAAQ,CAAC,IAAI,CAACb,aAAa,EAAE,IAAI,CAACO,SAAS,CAAC;EAC5E;EACA;AACJ;AACA;AACA;AACA;EACIO,KAAKA,CAACC,IAAI,GAAGrB,OAAO,CAACO,IAAI,CAAC,CAAC,EAAEe,EAAE,GAAGtB,OAAO,CAACO,IAAI,CAAC,CAAC,EAAE;IAC9C,KAAK,CAACa,KAAK,CAAC,CAAC;IACb,IAAI,CAACd,aAAa,CAACiB,QAAQ,CAACF,IAAI,CAAC;IACjC,IAAI,CAACb,WAAW,CAACe,QAAQ,CAACD,EAAE,CAAC;IAC7B,IAAI,CAACjB,YAAY,GAAG,CAAC;EACzB;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}