bg2e-js 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/bg2e-js.js.map +1 -1
  2. package/package.json +2 -2
  3. package/src/app/AppController.ts +18 -0
  4. package/src/app/Bg2KeyboardEvent.ts +18 -0
  5. package/src/app/Bg2MouseEvent.ts +18 -0
  6. package/src/app/Bg2TouchEvent.ts +18 -0
  7. package/src/app/Canvas.ts +18 -0
  8. package/src/app/EventBase.ts +18 -0
  9. package/src/app/MainLoop.ts +18 -0
  10. package/src/app/index.ts +18 -0
  11. package/src/base/Color.ts +18 -0
  12. package/src/base/Environment.ts +18 -0
  13. package/src/base/Light.ts +18 -0
  14. package/src/base/Material.ts +18 -0
  15. package/src/base/PolyList.ts +18 -0
  16. package/src/base/Texture.ts +18 -0
  17. package/src/base/index.ts +18 -0
  18. package/src/bg2e-vite.d.ts +26 -0
  19. package/src/{bg2e-vite.ts → bg2e-vite.js} +3 -4
  20. package/src/db/Bg2LoaderPlugin.ts +18 -0
  21. package/src/db/DBPluginApi.ts +18 -0
  22. package/src/db/Loader.ts +18 -0
  23. package/src/db/LoaderPlugin.ts +18 -0
  24. package/src/db/MtlParser.ts +18 -0
  25. package/src/db/ObjLoaderPlugin.ts +18 -0
  26. package/src/db/ObjParser.ts +18 -0
  27. package/src/db/ObjWriterPlugin.ts +18 -0
  28. package/src/db/VitscnjLoaderPlugin.ts +18 -0
  29. package/src/db/Writer.ts +18 -0
  30. package/src/db/WriterPlugin.ts +18 -0
  31. package/src/db/index.ts +18 -0
  32. package/src/debug/DebugRenderer.ts +18 -0
  33. package/src/debug/WebGLTextureViewer.ts +18 -0
  34. package/src/debug/index.ts +18 -0
  35. package/src/index.ts +18 -0
  36. package/src/manipulation/SelectionBuffer.ts +18 -0
  37. package/src/manipulation/SelectionHighlight.ts +18 -0
  38. package/src/manipulation/SelectionIdAssignVisitor.ts +18 -0
  39. package/src/manipulation/SelectionManager.ts +18 -0
  40. package/src/manipulation/SelectionMode.ts +18 -0
  41. package/src/math/Mat3.ts +18 -0
  42. package/src/math/Mat4.ts +18 -0
  43. package/src/math/MatrixStrategy.ts +18 -0
  44. package/src/math/Quat.ts +18 -0
  45. package/src/math/Vec.ts +18 -0
  46. package/src/math/constants.ts +18 -0
  47. package/src/math/functions.ts +18 -0
  48. package/src/math/index.ts +18 -0
  49. package/src/phsics/joint.ts +18 -0
  50. package/src/primitives/arrow.ts +18 -0
  51. package/src/primitives/cone.ts +18 -0
  52. package/src/primitives/cube.ts +18 -0
  53. package/src/primitives/cylinder.ts +18 -0
  54. package/src/primitives/index.ts +18 -0
  55. package/src/primitives/plane.ts +18 -0
  56. package/src/primitives/sphere.ts +18 -0
  57. package/src/react/useBg2e.ts +18 -0
  58. package/src/render/BRDFIntegrationMap.ts +18 -0
  59. package/src/render/Environment.ts +18 -0
  60. package/src/render/FrameBuffer.ts +18 -0
  61. package/src/render/MaterialRenderer.ts +18 -0
  62. package/src/render/Pipeline.ts +18 -0
  63. package/src/render/PolyListRenderer.ts +18 -0
  64. package/src/render/RenderBuffer.ts +18 -0
  65. package/src/render/RenderQueue.ts +18 -0
  66. package/src/render/RenderState.ts +18 -0
  67. package/src/render/Renderer.ts +18 -0
  68. package/src/render/SceneAppController.ts +18 -0
  69. package/src/render/SceneRenderer.ts +18 -0
  70. package/src/render/Shader.ts +18 -0
  71. package/src/render/ShadowRenderer.ts +18 -0
  72. package/src/render/SkyCube.ts +18 -0
  73. package/src/render/SkySphere.ts +18 -0
  74. package/src/render/TextureMergerRenderer.ts +18 -0
  75. package/src/render/TextureRenderer.ts +18 -0
  76. package/src/render/index.ts +18 -0
  77. package/src/render/webgl/FrameBuffer.ts +18 -0
  78. package/src/render/webgl/MaterialRenderer.ts +18 -0
  79. package/src/render/webgl/Pipeline.ts +18 -0
  80. package/src/render/webgl/PolyListRenderer.ts +18 -0
  81. package/src/render/webgl/RenderBuffer.ts +18 -0
  82. package/src/render/webgl/Renderer.ts +18 -0
  83. package/src/render/webgl/SceneRenderer.ts +18 -0
  84. package/src/render/webgl/ShaderProgram.ts +18 -0
  85. package/src/render/webgl/ShadowRenderer.ts +18 -0
  86. package/src/render/webgl/SkyCube.ts +18 -0
  87. package/src/render/webgl/SkySphere.ts +18 -0
  88. package/src/render/webgl/State.ts +18 -0
  89. package/src/render/webgl/TextureRenderer.ts +18 -0
  90. package/src/render/webgl/VertexBuffer.ts +18 -0
  91. package/src/render/webgl/index.ts +18 -0
  92. package/src/scene/Camera.ts +18 -0
  93. package/src/scene/Chain.ts +18 -0
  94. package/src/scene/ChainJoint.ts +18 -0
  95. package/src/scene/Component.ts +18 -0
  96. package/src/scene/ComponentMap.ts +18 -0
  97. package/src/scene/Drawable.ts +18 -0
  98. package/src/scene/EnvironmentComponent.ts +18 -0
  99. package/src/scene/FindNodeVisitor.ts +18 -0
  100. package/src/scene/LightComponent.ts +18 -0
  101. package/src/scene/MatrixState.ts +18 -0
  102. package/src/scene/Node.ts +18 -0
  103. package/src/scene/NodeVisitor.ts +18 -0
  104. package/src/scene/OrbitCameraController.ts +18 -0
  105. package/src/scene/SmoothOrbitCameraController.ts +18 -0
  106. package/src/scene/Transform.ts +18 -0
  107. package/src/scene/index.ts +18 -0
  108. package/src/shaders/BasicDiffuseColorShader.ts +18 -0
  109. package/src/shaders/BasicPBRLightShader.ts +18 -0
  110. package/src/shaders/DebugRenderShader.ts +18 -0
  111. package/src/shaders/DepthRenderShader.ts +18 -0
  112. package/src/shaders/IrradianceMapCubeShader.ts +18 -0
  113. package/src/shaders/PBRLightIBLShader.ts +18 -0
  114. package/src/shaders/PickSelectionShader.ts +18 -0
  115. package/src/shaders/PresentDebugFramebufferShader.ts +18 -0
  116. package/src/shaders/PresentTextureShader.ts +18 -0
  117. package/src/shaders/SelectionHighlightShader.ts +18 -0
  118. package/src/shaders/ShaderFunction.ts +18 -0
  119. package/src/shaders/SkyCubeShader.ts +18 -0
  120. package/src/shaders/SkySphereShader.ts +18 -0
  121. package/src/shaders/SpecularMapCubeShader.ts +18 -0
  122. package/src/shaders/TextureMergerShader.ts +18 -0
  123. package/src/shaders/index.ts +18 -0
  124. package/src/shaders/webgl/index.ts +18 -0
  125. package/src/shaders/webgl_shader_lib.ts +18 -0
  126. package/src/tools/BinaryResourceProvider.ts +18 -0
  127. package/src/tools/ImageResourceProvider.ts +18 -0
  128. package/src/tools/MaterialModifier.ts +18 -0
  129. package/src/tools/Resource.ts +18 -0
  130. package/src/tools/ResourceProvider.ts +18 -0
  131. package/src/tools/TextResourceProvider.ts +18 -0
  132. package/src/tools/TextureCache.ts +18 -0
  133. package/src/tools/TextureResourceDatabase.ts +18 -0
  134. package/src/tools/UserAgent.ts +18 -0
  135. package/src/tools/VideoResourceProvider.ts +18 -0
  136. package/src/tools/WriteStrategy.ts +18 -0
  137. package/src/tools/base64.ts +18 -0
  138. package/src/tools/crypto.ts +18 -0
  139. package/src/tools/endiantess.ts +18 -0
  140. package/src/tools/image.ts +18 -0
  141. package/src/tools/index.ts +18 -0
  142. package/src/tools/processType.ts +18 -0
  143. package/src/vite-env.d.ts +18 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bg2e-js",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "a graphics engine for productivity applications",
5
5
  "main": "./dist/bg2e-js.js",
6
6
  "types": "./src/index.ts",
@@ -41,7 +41,7 @@
41
41
  "engine"
42
42
  ],
43
43
  "author": "Fernando Serrano Carpena",
44
- "license": "MIT",
44
+ "license": "GPL-3.0-only",
45
45
  "bugs": {
46
46
  "url": "https://github.com/ferserc1/bg2e-js/issues"
47
47
  },
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import Bg2MouseEvent from "./Bg2MouseEvent";
2
20
  import Bg2KeyboardEvent from "./Bg2KeyboardEvent";
3
21
  import Bg2TouchEvent from "./Bg2TouchEvent";
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import EventBase from "./EventBase";
2
20
 
3
21
  export enum SpecialKey {
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import { getMouseEventOffset } from "./Canvas";
2
20
  import EventBase from "./EventBase";
3
21
 
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import { getEventTouches } from "./Canvas";
2
20
  import EventBase from "./EventBase";
3
21
 
package/src/app/Canvas.ts CHANGED
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import { generateUUID } from "../tools/crypto";
2
20
 
3
21
  export const getMouseEventOffset = (evt: any, canvas: Canvas): { x: number; y: number } => {
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
 
2
20
  export default class EventBase {
3
21
  private _stopPropagation: boolean = false;
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import Canvas from "./Canvas";
2
20
  import AppController from "./AppController";
3
21
 
package/src/app/index.ts CHANGED
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import AppController from "./AppController";
2
20
  import Canvas, {
3
21
  getMouseEventOffset,
package/src/base/Color.ts CHANGED
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import Vec from '../math/Vec';
2
20
 
3
21
  const checkLength = (v1: ArrayLike<number>, v2: ArrayLike<number> | null = null): void => {
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import Texture from './Texture';
2
20
  import type Renderer from '../render/Renderer';
3
21
 
package/src/base/Light.ts CHANGED
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
 
2
20
  import Vec from '../math/Vec';
3
21
  import Mat4 from '../math/Mat4';
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
 
2
20
  import Vec from '../math/Vec';
3
21
  import Color from './Color';
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import Vec from "../math/Vec";
2
20
  import Mat4 from "../math/Mat4";
3
21
  import Color from "./Color";
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
 
2
20
  import Vec from '../math/Vec';
3
21
  import Resource from '../tools/Resource';
package/src/base/index.ts CHANGED
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import Color from './Color';
2
20
  import Environment from './Environment';
3
21
  import Light, {
@@ -0,0 +1,26 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
19
+ import type { PluginOption } from "vite";
20
+
21
+ export interface CopyBg2eAssetsOptions {
22
+ nodeModulesPath?: string;
23
+ dstSubdir?: string;
24
+ }
25
+
26
+ export declare function copyBg2eAssets(options?: CopyBg2eAssetsOptions): PluginOption;
@@ -1,17 +1,16 @@
1
- import type { ViteDevServer } from "vite";
2
1
  import path from "node:path";
3
2
  import fs from "node:fs/promises";
4
3
 
5
4
  export function copyBg2eAssets({
6
5
  nodeModulesPath = "./node_modules",
7
6
  dstSubdir = "bg2io"
8
- } : { nodeModulesPath?: string, dstSubdir?: string } = {}) {
7
+ } = {}) {
9
8
  const bg2ioPath = path.join(nodeModulesPath, "bg2io");
10
9
 
11
10
  return {
12
11
  name: 'copy-bg2e-assets',
13
12
 
14
- async writeBundle(options: { dir?: string }) {
13
+ async writeBundle(options) {
15
14
  const baseSrcDir = path.resolve(bg2ioPath);
16
15
  const destDir = path.resolve(options.dir || "", dstSubdir);
17
16
 
@@ -27,7 +26,7 @@ export function copyBg2eAssets({
27
26
  )
28
27
  },
29
28
 
30
- async configureServer(server: ViteDevServer) {
29
+ async configureServer(server) {
31
30
  const dstDir = dstSubdir !== "" ? `/${dstSubdir}` : "";
32
31
  server.middlewares.use(`${dstDir}/bg2io.wasm`, async (req, res) => {
33
32
  const wasmPath = path.resolve(bg2ioPath, 'bg2io.wasm');
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import LoaderPlugin from "./LoaderPlugin";
2
20
  import { ResourceType, getFileName, removeExtension, removeFileName } from "./../tools/Resource";
3
21
  import Resource from "../tools/Resource";
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import { getExtension, ResourceType } from '../tools/Resource';
2
20
  import LoaderPlugin from './LoaderPlugin';
3
21
 
package/src/db/Loader.ts CHANGED
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
 
2
20
  import { isAbsolute, jointUrl, ResourceType } from '../tools/Resource';
3
21
  import {
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import { ResourceType } from "../tools/Resource.js";
2
20
 
3
21
  export default class LoaderPlugin {
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
 
2
20
 
3
21
  export default class MtlParser {
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import LoaderPlugin from './LoaderPlugin';
2
20
  import Resource, { getFileName, removeExtension, removeFileName, ResourceType } from './../tools/Resource';
3
21
  import ObjParser from './ObjParser';
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
 
2
20
  import PolyList from "../base/PolyList";
3
21
 
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import { ResourceType } from "../tools/Resource";
2
20
  import WriterPlugin from "./WriterPlugin";
3
21
  import Writer from "./Writer";
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import Resource, { removeFileName, ResourceType } from "../tools/Resource";
2
20
  import LoaderPlugin from "./LoaderPlugin";
3
21
  import Node from "../scene/Node";
package/src/db/Writer.ts CHANGED
@@ -1,3 +1,21 @@
1
+ /*
2
+ * business grade graphic engine (bg2 engine)
3
+ * Copyright (C) 2024 Fernando Serrano Carpena
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+
1
19
  import { ResourceType } from '../tools/Resource';
2
20
  import {
3
21
  PluginOperationType,