BreathPoint.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. class BreathPoint {
  2. constructor(e) {
  3. E(this, "_staticmesh");
  4. E(this, "_id");
  5. E(this, "_mat");
  6. E(this, "_type");
  7. E(this, "_maxVisibleRegion");
  8. E(this, "_skinInfo");
  9. E(this, "_scene");
  10. E(this, "_isInScene");
  11. const {mesh: t, id: r, position: n, rotation: o, mat: a, type: s="default", maxVisibleRegion: l=-1, scene: u, skinInfo: c="default"} = e;
  12. this._id = r,
  13. t.mesh.position = ue4Position2Xverse(n),
  14. t.mesh.rotation = ue4Rotation2Xverse(o),
  15. this._staticmesh = t,
  16. this._mat = a,
  17. this._type = s,
  18. this._maxVisibleRegion = l,
  19. this._scene = u,
  20. this._skinInfo = c,
  21. this._isInScene = !0
  22. }
  23. get isInScene() {
  24. return this._isInScene
  25. }
  26. get skinInfo() {
  27. return this._skinInfo
  28. }
  29. get maxvisibleregion() {
  30. return this._maxVisibleRegion
  31. }
  32. getMesh() {
  33. return this._staticmesh
  34. }
  35. get mesh() {
  36. return this._staticmesh.mesh
  37. }
  38. toggleVisibility(e) {
  39. e == !0 ? this._staticmesh.show() : this._staticmesh.hide()
  40. }
  41. changePickable(e) {
  42. this._staticmesh.mesh.isPickable = e
  43. }
  44. removeFromScene() {
  45. this._isInScene && (this._staticmesh.mesh != null && this._scene.removeMesh(this._staticmesh.mesh),
  46. this._isInScene = !1)
  47. }
  48. addToScene() {
  49. this._isInScene == !1 && (this._staticmesh.mesh != null && this._scene.addMesh(this._staticmesh.mesh),
  50. this._isInScene = !0)
  51. }
  52. dispose() {
  53. var e;
  54. (e = this._staticmesh.mesh) == null || e.dispose(!1, !1)
  55. }
  56. set position(e) {
  57. this._staticmesh.mesh.position = ue4Position2Xverse(e)
  58. }
  59. get position() {
  60. return xversePosition2Ue4(this._staticmesh.mesh.position)
  61. }
  62. set rotation(e) {
  63. this._staticmesh.mesh.rotation = ue4Rotation2Xverse(e)
  64. }
  65. get rotation() {
  66. return xverseRotation2Ue4(this._staticmesh.mesh.rotation)
  67. }
  68. }