BreathPoint.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. export default class BreathPoint {
  2. constructor(panoInfo) {
  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: xStaticMesh, id: id, position: position, rotation: rotation, mat: material, type: type="default", maxVisibleRegion: maxVisibleRegion=-1, scene: scene, skinInfo: skinInfo="default"} = panoInfo;
  12. this._id = id;
  13. xStaticMesh.mesh.position = ue4Position2Xverse(position);
  14. xStaticMesh.mesh.rotation = ue4Rotation2Xverse(rotation);
  15. this._staticmesh = xStaticMesh;
  16. this._mat = material;
  17. this._type = type;
  18. this._maxVisibleRegion = maxVisibleRegion;
  19. this._scene = scene;
  20. this._skinInfo = skinInfo;
  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. if(this._isInScene){
  46. this._staticmesh.mesh != null && this._scene.removeMesh(this._staticmesh.mesh)
  47. this._isInScene = !1
  48. }
  49. }
  50. addToScene() {
  51. if(this._isInScene == !1){
  52. this._staticmesh.mesh != null && this._scene.addMesh(this._staticmesh.mesh);
  53. this._isInScene = !0
  54. }
  55. }
  56. dispose() {
  57. let mesh = this._staticmesh.mesh
  58. if(mesh != null){
  59. mesh.dispose(!1, !1)
  60. }
  61. }
  62. set position(e) {
  63. this._staticmesh.mesh.position = ue4Position2Xverse(e)
  64. }
  65. get position() {
  66. return xversePosition2Ue4(this._staticmesh.mesh.position)
  67. }
  68. set rotation(e) {
  69. this._staticmesh.mesh.rotation = ue4Rotation2Xverse(e)
  70. }
  71. get rotation() {
  72. return xverseRotation2Ue4(this._staticmesh.mesh.rotation)
  73. }
  74. }