c8674b7161268b88e09c0ce399c8c0f39898ad3300141e4bcde5fba019f0a8c6.json 8.3 KB

1
  1. {"ast":null,"code":"/**\n * ActionEvent is the event being sent when an action is triggered.\n */\nexport class ActionEvent {\n /**\n * Creates a new ActionEvent\n * @param source The mesh or sprite that triggered the action\n * @param pointerX The X mouse cursor position at the time of the event\n * @param pointerY The Y mouse cursor position at the time of the event\n * @param meshUnderPointer The mesh that is currently pointed at (can be null)\n * @param sourceEvent the original (browser) event that triggered the ActionEvent\n * @param additionalData additional data for the event\n */\n constructor( /** The mesh or sprite that triggered the action */\n source, /** The X mouse cursor position at the time of the event */\n pointerX, /** The Y mouse cursor position at the time of the event */\n pointerY, /** The mesh that is currently pointed at (can be null) */\n meshUnderPointer, /** the original (browser) event that triggered the ActionEvent */\n sourceEvent, /** additional data for the event */\n additionalData) {\n this.source = source;\n this.pointerX = pointerX;\n this.pointerY = pointerY;\n this.meshUnderPointer = meshUnderPointer;\n this.sourceEvent = sourceEvent;\n this.additionalData = additionalData;\n }\n /**\n * Helper function to auto-create an ActionEvent from a source mesh.\n * @param source The source mesh that triggered the event\n * @param evt The original (browser) event\n * @param additionalData additional data for the event\n * @returns the new ActionEvent\n */\n static CreateNew(source, evt, additionalData) {\n const scene = source.getScene();\n return new ActionEvent(source, scene.pointerX, scene.pointerY, scene.meshUnderPointer || source, evt, additionalData);\n }\n /**\n * Helper function to auto-create an ActionEvent from a source sprite\n * @param source The source sprite that triggered the event\n * @param scene Scene associated with the sprite\n * @param evt The original (browser) event\n * @param additionalData additional data for the event\n * @returns the new ActionEvent\n */\n static CreateNewFromSprite(source, scene, evt, additionalData) {\n return new ActionEvent(source, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt, additionalData);\n }\n /**\n * Helper function to auto-create an ActionEvent from a scene. If triggered by a mesh use ActionEvent.CreateNew\n * @param scene the scene where the event occurred\n * @param evt The original (browser) event\n * @returns the new ActionEvent\n */\n static CreateNewFromScene(scene, evt) {\n return new ActionEvent(null, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt);\n }\n /**\n * Helper function to auto-create an ActionEvent from a primitive\n * @param prim defines the target primitive\n * @param pointerPos defines the pointer position\n * @param evt The original (browser) event\n * @param additionalData additional data for the event\n * @returns the new ActionEvent\n */\n static CreateNewFromPrimitive(prim, pointerPos, evt, additionalData) {\n return new ActionEvent(prim, pointerPos.x, pointerPos.y, null, evt, additionalData);\n }\n}","map":{"version":3,"names":["ActionEvent","constructor","source","pointerX","pointerY","meshUnderPointer","sourceEvent","additionalData","CreateNew","evt","scene","getScene","CreateNewFromSprite","CreateNewFromScene","CreateNewFromPrimitive","prim","pointerPos","x","y"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Actions/actionEvent.js"],"sourcesContent":["/**\n * ActionEvent is the event being sent when an action is triggered.\n */\nexport class ActionEvent {\n /**\n * Creates a new ActionEvent\n * @param source The mesh or sprite that triggered the action\n * @param pointerX The X mouse cursor position at the time of the event\n * @param pointerY The Y mouse cursor position at the time of the event\n * @param meshUnderPointer The mesh that is currently pointed at (can be null)\n * @param sourceEvent the original (browser) event that triggered the ActionEvent\n * @param additionalData additional data for the event\n */\n constructor(\n /** The mesh or sprite that triggered the action */\n source, \n /** The X mouse cursor position at the time of the event */\n pointerX, \n /** The Y mouse cursor position at the time of the event */\n pointerY, \n /** The mesh that is currently pointed at (can be null) */\n meshUnderPointer, \n /** the original (browser) event that triggered the ActionEvent */\n sourceEvent, \n /** additional data for the event */\n additionalData) {\n this.source = source;\n this.pointerX = pointerX;\n this.pointerY = pointerY;\n this.meshUnderPointer = meshUnderPointer;\n this.sourceEvent = sourceEvent;\n this.additionalData = additionalData;\n }\n /**\n * Helper function to auto-create an ActionEvent from a source mesh.\n * @param source The source mesh that triggered the event\n * @param evt The original (browser) event\n * @param additionalData additional data for the event\n * @returns the new ActionEvent\n */\n static CreateNew(source, evt, additionalData) {\n const scene = source.getScene();\n return new ActionEvent(source, scene.pointerX, scene.pointerY, scene.meshUnderPointer || source, evt, additionalData);\n }\n /**\n * Helper function to auto-create an ActionEvent from a source sprite\n * @param source The source sprite that triggered the event\n * @param scene Scene associated with the sprite\n * @param evt The original (browser) event\n * @param additionalData additional data for the event\n * @returns the new ActionEvent\n */\n static CreateNewFromSprite(source, scene, evt, additionalData) {\n return new ActionEvent(source, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt, additionalData);\n }\n /**\n * Helper function to auto-create an ActionEvent from a scene. If triggered by a mesh use ActionEvent.CreateNew\n * @param scene the scene where the event occurred\n * @param evt The original (browser) event\n * @returns the new ActionEvent\n */\n static CreateNewFromScene(scene, evt) {\n return new ActionEvent(null, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt);\n }\n /**\n * Helper function to auto-create an ActionEvent from a primitive\n * @param prim defines the target primitive\n * @param pointerPos defines the pointer position\n * @param evt The original (browser) event\n * @param additionalData additional data for the event\n * @returns the new ActionEvent\n */\n static CreateNewFromPrimitive(prim, pointerPos, evt, additionalData) {\n return new ActionEvent(prim, pointerPos.x, pointerPos.y, null, evt, additionalData);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAMA,WAAW,CAAC;EACrB;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACIC,WAAWA,CAAA,CACX;EACAC,MAAM,EACN;EACAC,QAAQ,EACR;EACAC,QAAQ,EACR;EACAC,gBAAgB,EAChB;EACAC,WAAW,EACX;EACAC,cAAc,EAAE;IACZ,IAAI,CAACL,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,gBAAgB,GAAGA,gBAAgB;IACxC,IAAI,CAACC,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,cAAc,GAAGA,cAAc;EACxC;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;EACI,OAAOC,SAASA,CAACN,MAAM,EAAEO,GAAG,EAAEF,cA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