vanta-engine 1.0.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 (162) hide show
  1. package/README.md +61 -0
  2. package/dist/engine.d.ts +18 -0
  3. package/dist/engine.d.ts.map +1 -0
  4. package/dist/engine.js +23 -0
  5. package/dist/engine.js.map +1 -0
  6. package/dist/graphics/assets/asset_format/format.d.ts +115 -0
  7. package/dist/graphics/assets/asset_format/format.d.ts.map +1 -0
  8. package/dist/graphics/assets/asset_format/format.js +29 -0
  9. package/dist/graphics/assets/asset_format/format.js.map +1 -0
  10. package/dist/graphics/assets/asset_loaders/obj.d.ts +127 -0
  11. package/dist/graphics/assets/asset_loaders/obj.d.ts.map +1 -0
  12. package/dist/graphics/assets/asset_loaders/obj.js +762 -0
  13. package/dist/graphics/assets/asset_loaders/obj.js.map +1 -0
  14. package/dist/graphics/assets/material.d.ts +33 -0
  15. package/dist/graphics/assets/material.d.ts.map +1 -0
  16. package/dist/graphics/assets/material.js +104 -0
  17. package/dist/graphics/assets/material.js.map +1 -0
  18. package/dist/graphics/assets/mesh.d.ts +17 -0
  19. package/dist/graphics/assets/mesh.d.ts.map +1 -0
  20. package/dist/graphics/assets/mesh.js +47 -0
  21. package/dist/graphics/assets/mesh.js.map +1 -0
  22. package/dist/graphics/assets/model.d.ts +13 -0
  23. package/dist/graphics/assets/model.d.ts.map +1 -0
  24. package/dist/graphics/assets/model.js +18 -0
  25. package/dist/graphics/assets/model.js.map +1 -0
  26. package/dist/graphics/assets/texture.d.ts +93 -0
  27. package/dist/graphics/assets/texture.d.ts.map +1 -0
  28. package/dist/graphics/assets/texture.js +318 -0
  29. package/dist/graphics/assets/texture.js.map +1 -0
  30. package/dist/graphics/assets/uniform_buffer.d.ts +28 -0
  31. package/dist/graphics/assets/uniform_buffer.d.ts.map +1 -0
  32. package/dist/graphics/assets/uniform_buffer.js +132 -0
  33. package/dist/graphics/assets/uniform_buffer.js.map +1 -0
  34. package/dist/graphics/assets/vaos.d.ts +9 -0
  35. package/dist/graphics/assets/vaos.d.ts.map +1 -0
  36. package/dist/graphics/assets/vaos.js +98 -0
  37. package/dist/graphics/assets/vaos.js.map +1 -0
  38. package/dist/graphics/framebuffer.d.ts +77 -0
  39. package/dist/graphics/framebuffer.d.ts.map +1 -0
  40. package/dist/graphics/framebuffer.js +265 -0
  41. package/dist/graphics/framebuffer.js.map +1 -0
  42. package/dist/graphics/graphics_manager.d.ts +70 -0
  43. package/dist/graphics/graphics_manager.d.ts.map +1 -0
  44. package/dist/graphics/graphics_manager.js +503 -0
  45. package/dist/graphics/graphics_manager.js.map +1 -0
  46. package/dist/graphics/shader_program.d.ts +66 -0
  47. package/dist/graphics/shader_program.d.ts.map +1 -0
  48. package/dist/graphics/shader_program.js +92 -0
  49. package/dist/graphics/shader_program.js.map +1 -0
  50. package/dist/graphics/utility.d.ts +4 -0
  51. package/dist/graphics/utility.d.ts.map +1 -0
  52. package/dist/graphics/utility.js +33 -0
  53. package/dist/graphics/utility.js.map +1 -0
  54. package/dist/hook_manager.d.ts +33 -0
  55. package/dist/hook_manager.d.ts.map +1 -0
  56. package/dist/hook_manager.js +102 -0
  57. package/dist/hook_manager.js.map +1 -0
  58. package/dist/index.d.ts +27 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +27 -0
  61. package/dist/index.js.map +1 -0
  62. package/dist/input/input_manager.d.ts +41 -0
  63. package/dist/input/input_manager.d.ts.map +1 -0
  64. package/dist/input/input_manager.js +121 -0
  65. package/dist/input/input_manager.js.map +1 -0
  66. package/dist/node/camera3d.d.ts +10 -0
  67. package/dist/node/camera3d.d.ts.map +1 -0
  68. package/dist/node/camera3d.js +25 -0
  69. package/dist/node/camera3d.js.map +1 -0
  70. package/dist/node/lights/directional_light.d.ts +20 -0
  71. package/dist/node/lights/directional_light.d.ts.map +1 -0
  72. package/dist/node/lights/directional_light.js +111 -0
  73. package/dist/node/lights/directional_light.js.map +1 -0
  74. package/dist/node/lights/light.d.ts +15 -0
  75. package/dist/node/lights/light.d.ts.map +1 -0
  76. package/dist/node/lights/light.js +24 -0
  77. package/dist/node/lights/light.js.map +1 -0
  78. package/dist/node/lights/point_light.d.ts +26 -0
  79. package/dist/node/lights/point_light.d.ts.map +1 -0
  80. package/dist/node/lights/point_light.js +109 -0
  81. package/dist/node/lights/point_light.js.map +1 -0
  82. package/dist/node/lights/spot_light.d.ts +13 -0
  83. package/dist/node/lights/spot_light.d.ts.map +1 -0
  84. package/dist/node/lights/spot_light.js +35 -0
  85. package/dist/node/lights/spot_light.js.map +1 -0
  86. package/dist/node/lights.d.ts +43 -0
  87. package/dist/node/lights.d.ts.map +1 -0
  88. package/dist/node/lights.js +201 -0
  89. package/dist/node/lights.js.map +1 -0
  90. package/dist/node/object3d.d.ts +10 -0
  91. package/dist/node/object3d.d.ts.map +1 -0
  92. package/dist/node/object3d.js +60 -0
  93. package/dist/node/object3d.js.map +1 -0
  94. package/dist/node/skybox.d.ts +15 -0
  95. package/dist/node/skybox.d.ts.map +1 -0
  96. package/dist/node/skybox.js +33 -0
  97. package/dist/node/skybox.js.map +1 -0
  98. package/dist/node/sprite2d.d.ts +14 -0
  99. package/dist/node/sprite2d.d.ts.map +1 -0
  100. package/dist/node/sprite2d.js +33 -0
  101. package/dist/node/sprite2d.js.map +1 -0
  102. package/dist/node.d.ts +76 -0
  103. package/dist/node.d.ts.map +1 -0
  104. package/dist/node.js +308 -0
  105. package/dist/node.js.map +1 -0
  106. package/dist/scene.d.ts +19 -0
  107. package/dist/scene.d.ts.map +1 -0
  108. package/dist/scene.js +50 -0
  109. package/dist/scene.js.map +1 -0
  110. package/dist/shader_language/grammar.d.ts +2 -0
  111. package/dist/shader_language/grammar.d.ts.map +1 -0
  112. package/dist/shader_language/grammar.js +971 -0
  113. package/dist/shader_language/grammar.js.map +1 -0
  114. package/dist/shader_language/tokenizer.d.ts +3 -0
  115. package/dist/shader_language/tokenizer.d.ts.map +1 -0
  116. package/dist/shader_language/tokenizer.js +50 -0
  117. package/dist/shader_language/tokenizer.js.map +1 -0
  118. package/dist/shaders/default_2d.fs.d.ts +3 -0
  119. package/dist/shaders/default_2d.fs.d.ts.map +1 -0
  120. package/dist/shaders/default_2d.fs.js +14 -0
  121. package/dist/shaders/default_2d.fs.js.map +1 -0
  122. package/dist/shaders/default_2d.vs.d.ts +3 -0
  123. package/dist/shaders/default_2d.vs.d.ts.map +1 -0
  124. package/dist/shaders/default_2d.vs.js +16 -0
  125. package/dist/shaders/default_2d.vs.js.map +1 -0
  126. package/dist/shaders/default_3d.fs.d.ts +3 -0
  127. package/dist/shaders/default_3d.fs.d.ts.map +1 -0
  128. package/dist/shaders/default_3d.fs.js +327 -0
  129. package/dist/shaders/default_3d.fs.js.map +1 -0
  130. package/dist/shaders/default_3d.vs.d.ts +3 -0
  131. package/dist/shaders/default_3d.vs.d.ts.map +1 -0
  132. package/dist/shaders/default_3d.vs.js +36 -0
  133. package/dist/shaders/default_3d.vs.js.map +1 -0
  134. package/dist/shaders/default_directional_shadow.fs.d.ts +3 -0
  135. package/dist/shaders/default_directional_shadow.fs.d.ts.map +1 -0
  136. package/dist/shaders/default_directional_shadow.fs.js +6 -0
  137. package/dist/shaders/default_directional_shadow.fs.js.map +1 -0
  138. package/dist/shaders/default_directional_shadow.vs.d.ts +3 -0
  139. package/dist/shaders/default_directional_shadow.vs.d.ts.map +1 -0
  140. package/dist/shaders/default_directional_shadow.vs.js +11 -0
  141. package/dist/shaders/default_directional_shadow.vs.js.map +1 -0
  142. package/dist/shaders/default_point_shadow.fs.d.ts +3 -0
  143. package/dist/shaders/default_point_shadow.fs.d.ts.map +1 -0
  144. package/dist/shaders/default_point_shadow.fs.js +18 -0
  145. package/dist/shaders/default_point_shadow.fs.js.map +1 -0
  146. package/dist/shaders/default_point_shadow.vs.d.ts +3 -0
  147. package/dist/shaders/default_point_shadow.vs.d.ts.map +1 -0
  148. package/dist/shaders/default_point_shadow.vs.js +14 -0
  149. package/dist/shaders/default_point_shadow.vs.js.map +1 -0
  150. package/dist/shaders/default_skybox.fs.d.ts +3 -0
  151. package/dist/shaders/default_skybox.fs.d.ts.map +1 -0
  152. package/dist/shaders/default_skybox.fs.js +14 -0
  153. package/dist/shaders/default_skybox.fs.js.map +1 -0
  154. package/dist/shaders/default_skybox.vs.d.ts +3 -0
  155. package/dist/shaders/default_skybox.vs.d.ts.map +1 -0
  156. package/dist/shaders/default_skybox.vs.js +23 -0
  157. package/dist/shaders/default_skybox.vs.js.map +1 -0
  158. package/dist/utility.d.ts +5 -0
  159. package/dist/utility.d.ts.map +1 -0
  160. package/dist/utility.js +19 -0
  161. package/dist/utility.js.map +1 -0
  162. package/package.json +47 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lights.js","sourceRoot":"","sources":["../../src/node/lights.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAQ,MAAM,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAe,MAAM,4BAA4B,CAAC;AAGzE,MAAM,OAAO,KAAM,SAAQ,MAAM;IAO7B,YACI,MAAa,EACb,IAAW,EACX,KAAU,EACV,OAAc,EACd,OAAc,EACd,QAAe,EACf,MAAa;QAEb,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAID,mBAAmB,CAAC,cAA4B,EAAE,UAAiB,EAAE,KAAY;QAC7E,cAAc,CAAC,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,YAAY,CAAC,UAAU,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.ts";
3
+ import { Node3D } from "../node.ts";
4
+ import { Model } from "../graphics/assets/model.ts";
5
+ export declare class Object3D extends Node3D {
6
+ model: Model;
7
+ constructor(engine: Engine, name: string, model: Model);
8
+ render_class(view_matrix: Mat4, projection_matrix_3d: Mat4, projection_matrix_2d: Mat4, time: number, delta_time: number): void;
9
+ }
10
+ //# sourceMappingURL=object3d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object3d.d.ts","sourceRoot":"","sources":["../../src/node/object3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,cAAc,CAAC;AAChD,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAGpD,qBAAa,QAAS,SAAQ,MAAM;IAChC,KAAK,EAAC,KAAK,CAAC;gBAEA,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,EAAE,KAAK,EAAC,KAAK;IAKnD,YAAY,CAAC,WAAW,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,GAAG,IAAI;CAsEhI"}
@@ -0,0 +1,60 @@
1
+ import { Vec2, Vec4 } from "@vicimpa/glm";
2
+ import { Node3D } from "../node.js";
3
+ import { Skybox } from "./skybox.js";
4
+ export class Object3D extends Node3D {
5
+ constructor(engine, name, model) {
6
+ super(engine, name);
7
+ this.model = model;
8
+ }
9
+ render_class(view_matrix, projection_matrix_3d, projection_matrix_2d, time, delta_time) {
10
+ this.model.draw_start();
11
+ this.on_render(this, this.engine, time, delta_time);
12
+ const gm = this.engine.graphics_manager;
13
+ const skybox = this.get_parent_of_type(Skybox);
14
+ if (skybox)
15
+ gm.set_uniform("environment.ambient_light", skybox.ambient_light);
16
+ const main_camera_3d = this.engine.main_scene.main_camera_3d;
17
+ // CAMERA POS
18
+ if (main_camera_3d) {
19
+ gm.set_uniform("camera_position", main_camera_3d.position);
20
+ }
21
+ else {
22
+ throw Error(`Main scene "${this.engine.main_scene.name}" does not have a main_camera_3d set which is required to render Object3Ds such as the node named "${this.name}".`);
23
+ }
24
+ // PASS IN LIGHTS
25
+ const point_lights = gm.point_lights;
26
+ const spot_lights = gm.spot_lights;
27
+ const directional_lights = gm.directional_lights;
28
+ const point_lights_count = point_lights.length;
29
+ const spot_lights_count = spot_lights.length;
30
+ const directional_lights_count = directional_lights.length;
31
+ const n = Math.max(point_lights_count, spot_lights_count, directional_lights_count);
32
+ var mesh_size = this.model.mesh.dimensions.clone().mul(this.scale).length();
33
+ var local_mesh_center = this.model.mesh.center;
34
+ var mesh_center = new Vec4(local_mesh_center.x, local_mesh_center.y, local_mesh_center.z, 1.0).applyMat4(this.get_world_matrix());
35
+ for (var i = 0; i < n; ++i) {
36
+ if (i < point_lights_count) {
37
+ const light = point_lights[i];
38
+ if (mesh_center.xyz.distance(light.position) - mesh_size / 2.0 < light.range)
39
+ light.set_uniforms("point_lights", i);
40
+ }
41
+ if (i < spot_lights_count)
42
+ spot_lights[i].set_uniforms("spot_lights", i);
43
+ if (i < directional_lights_count)
44
+ directional_lights[i].set_uniforms("directional_lights", i);
45
+ }
46
+ gm.set_uniform("point_lights_count", point_lights_count);
47
+ gm.set_uniform("spot_lights_count", spot_lights_count);
48
+ gm.set_uniform("directional_lights_count", directional_lights_count);
49
+ //PASS SHADOW MAPS
50
+ gm.set_uniform("directional_light_shadow_maps", gm.directional_light_shadow_map_texture);
51
+ gm.set_uniform("point_light_shadow_maps", gm.point_light_shadow_map_texture);
52
+ gm.set_uniform("shadow_map_size", new Vec2(gm.shadow_resolution));
53
+ // pass the MVP matrix
54
+ gm.set_uniform("u_model", this.get_world_matrix());
55
+ gm.set_uniform("u_view", view_matrix);
56
+ gm.set_uniform("u_projection", projection_matrix_3d);
57
+ this.model.draw_end();
58
+ }
59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,CAAC;YAC9C,CAAC;YACD,IAAI,CAAC,GAAG,iBAAiB;gBACrB,WAAW,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;YAClD,IAAI,CAAC,GAAG,wBAAwB;gBAC5B,kBAAkB,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC;QACpE,CAAC;QAED,EAAE,CAAC,WAAW,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CAAC;QACzD,EAAE,CAAC,WAAW,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC;QACvD,EAAE,CAAC,WAAW,CAAC,0BAA0B,EAAE,wBAAwB,CAAC,CAAC;QAErE,kBAAkB;QAClB,EAAE,CAAC,WAAW,CAAC,+BAA+B,EAAE,EAAE,CAAC,oCAAoC,CAAC,CAAA;QACxF,EAAE,CAAC,WAAW,CAAC,yBAAyB,EAAE,EAAE,CAAC,8BAA8B,CAAC,CAAA;QAC5E,EAAE,CAAC,WAAW,CAAC,iBAAiB,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAA;QAEjE,sBAAsB;QACtB,EAAE,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;QAEnD,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAEtC,EAAE,CAAC,WAAW,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC;QAErD,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;CACJ"}
@@ -0,0 +1,15 @@
1
+ import { Mat4, Vec3 } from "@vicimpa/glm";
2
+ import Engine from "../engine.ts";
3
+ import { Node } from "../node.ts";
4
+ import { ShaderProgram } from "../graphics/shader_program.ts";
5
+ import { CubeMapTexture } from "../graphics/assets/texture.ts";
6
+ import { VAOInfo } from "../graphics/assets/vaos.ts";
7
+ export declare class Skybox extends Node {
8
+ vao: VAOInfo;
9
+ shader_program: ShaderProgram;
10
+ cubemap_texture: CubeMapTexture;
11
+ ambient_light: Vec3;
12
+ constructor(engine: Engine, name: string, cubemap_texture: CubeMapTexture, ambient_light: Vec3, shader_program?: ShaderProgram | null);
13
+ render_class(view_matrix: Mat4, projection_matrix_3d: Mat4, projection_matrix_2d: Mat4, time: number, delta_time: number): void;
14
+ }
15
+ //# sourceMappingURL=skybox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skybox.d.ts","sourceRoot":"","sources":["../../src/node/skybox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAkB,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErE,qBAAa,MAAO,SAAQ,IAAI;IAC5B,GAAG,EAAC,OAAO,CAAC;IACZ,cAAc,EAAC,aAAa,CAAC;IAC7B,eAAe,EAAC,cAAc,CAAC;IAC/B,aAAa,EAAC,IAAI,CAAC;gBAEP,MAAM,EAAC,MAAM,EACrB,IAAI,EAAC,MAAM,EACX,eAAe,EAAC,cAAc,EAC9B,aAAa,EAAC,IAAI,EAClB,cAAc,GAAC,aAAa,GAAC,IAAW;IAQ5C,YAAY,CAAC,WAAW,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,GAAG,IAAI;CA+BhI"}
@@ -0,0 +1,33 @@
1
+ import { Node } from "../node.js";
2
+ import { get_skybox_vao } from "../graphics/assets/vaos.js";
3
+ export class Skybox extends Node {
4
+ constructor(engine, name, cubemap_texture, ambient_light, shader_program = null) {
5
+ super(engine, name);
6
+ this.vao = get_skybox_vao(this.engine.graphics_manager);
7
+ this.shader_program = shader_program ? shader_program : this.engine.graphics_manager.default_skybox_shader_program;
8
+ this.cubemap_texture = cubemap_texture;
9
+ this.ambient_light = ambient_light;
10
+ }
11
+ render_class(view_matrix, projection_matrix_3d, projection_matrix_2d, time, delta_time) {
12
+ if (this.engine.main_scene.rendering_depth_map)
13
+ return;
14
+ if (!this.shader_program)
15
+ throw Error(`Shader program not set for skybox.`);
16
+ const gm = this.engine.graphics_manager;
17
+ this.shader_program.use();
18
+ gm.gl.depthFunc(gm.gl.LEQUAL);
19
+ this.on_render(this, this.engine, time, delta_time);
20
+ // bind the texture
21
+ gm.set_uniform("skybox_texture", this.cubemap_texture);
22
+ // add the VP matrix
23
+ gm.set_uniform("u_view", view_matrix);
24
+ gm.set_uniform("u_projection", projection_matrix_3d);
25
+ // render vao
26
+ gm.gl.bindVertexArray(this.vao.vao);
27
+ gm.gl.drawElements(gm.gl.TRIANGLES, this.vao.index_count, gm.gl.UNSIGNED_SHORT, 0);
28
+ gm.gl.bindVertexArray(null);
29
+ gm.gl.depthFunc(gm.gl.LESS);
30
+ gm.clear_shader();
31
+ }
32
+ }
33
+ //# sourceMappingURL=skybox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skybox.js","sourceRoot":"","sources":["../../src/node/skybox.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGlC,OAAO,EAAE,cAAc,EAAW,MAAM,4BAA4B,CAAC;AAErE,MAAM,OAAO,MAAO,SAAQ,IAAI;IAM5B,YAAY,MAAa,EACrB,IAAW,EACX,eAA8B,EAC9B,aAAkB,EAClB,iBAAoC,IAAI;QAExC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,GAAG,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM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AE,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QACnF,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAE5B,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QAE5B,EAAE,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;CACJ"}
@@ -0,0 +1,14 @@
1
+ import { Mat4 } from "@vicimpa/glm";
2
+ import Engine from "../engine.ts";
3
+ import { Node2D } from "../node.ts";
4
+ import { ShaderProgram } from "../graphics/shader_program.ts";
5
+ import { VAOInfo } from "../graphics/assets/vaos.ts";
6
+ import { Texture } from "../graphics/assets/texture.ts";
7
+ export declare class Sprite2D extends Node2D {
8
+ shader_program: ShaderProgram;
9
+ vao: VAOInfo;
10
+ sprite_texture: Texture;
11
+ constructor(engine: Engine, name: string, sprite_texture: Texture, shader_program?: ShaderProgram | null);
12
+ render_class(view_matrix: Mat4, projection_matrix_3d: Mat4, projection_matrix_2d: Mat4, time: number, delta_time: number): void;
13
+ }
14
+ //# sourceMappingURL=sprite2d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sprite2d.d.ts","sourceRoot":"","sources":["../../src/node/sprite2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAkB,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,qBAAa,QAAS,SAAQ,MAAM;IAChC,cAAc,EAAC,aAAa,CAAC;IAC7B,GAAG,EAAC,OAAO,CAAC;IACZ,cAAc,EAAC,OAAO,CAAC;gBAGnB,MAAM,EAAC,MAAM,EACb,IAAI,EAAC,MAAM,EACX,cAAc,EAAC,OAAO,EACtB,cAAc,GAAC,aAAa,GAAC,IAAW;IAQ5C,YAAY,CAAC,WAAW,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,GAAG,IAAI;CAgChI"}
@@ -0,0 +1,33 @@
1
+ import { Node2D } from "../node.js";
2
+ import { get_sprite_vao } from "../graphics/assets/vaos.js";
3
+ export class Sprite2D extends Node2D {
4
+ constructor(engine, name, sprite_texture, shader_program = null) {
5
+ super(engine, name);
6
+ this.vao = get_sprite_vao(this.engine.graphics_manager);
7
+ this.shader_program = shader_program ? shader_program : this.engine.graphics_manager.default_2d_shader_program;
8
+ this.sprite_texture = sprite_texture;
9
+ }
10
+ render_class(view_matrix, projection_matrix_3d, projection_matrix_2d, time, delta_time) {
11
+ if (this.engine.main_scene.rendering_depth_map)
12
+ return;
13
+ if (!this.shader_program)
14
+ throw Error(`Shader program not set for skybox.`);
15
+ const gm = this.engine.graphics_manager;
16
+ gm.gl.enable(gm.gl.BLEND);
17
+ gm.gl.blendFunc(gm.gl.SRC_ALPHA, gm.gl.ONE_MINUS_SRC_ALPHA);
18
+ this.shader_program.use();
19
+ this.on_render(this, this.engine, time, delta_time);
20
+ // bind the texture
21
+ gm.set_uniform("sprite_texture", this.sprite_texture);
22
+ // add the MVP matrix
23
+ gm.set_uniform("u_model", this.get_world_matrix());
24
+ gm.set_uniform("u_projection", projection_matrix_2d);
25
+ // render vao
26
+ gm.gl.bindVertexArray(this.vao.vao);
27
+ gm.gl.drawElements(gm.gl.TRIANGLES, this.vao.index_count, gm.gl.UNSIGNED_SHORT, 0);
28
+ gm.gl.bindVertexArray(null);
29
+ gm.clear_shader();
30
+ gm.gl.disable(gm.gl.BLEND);
31
+ }
32
+ }
33
+ //# sourceMappingURL=sprite2d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"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pD,mBAAmB;QACnB,EAAE,CAAC,WAAW,CAAC,gBAAgB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAEtD,qBAAqB;QACrB,EAAE,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;QAGnD,EAAE,CAAC,WAAW,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC;QAErD,aAAa;QACb,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpC,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QACnF,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAE5B,EAAE,CAAC,YAAY,EAAE,CAAA;QACjB,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACJ"}
package/dist/node.d.ts ADDED
@@ -0,0 +1,76 @@
1
+ import { Vec3, Vec2, Mat4, Quat } from '@vicimpa/glm';
2
+ import Engine from './engine.ts';
3
+ type Constructor<T> = new (...args: any[]) => T;
4
+ export declare class Node {
5
+ engine: Engine;
6
+ name: string;
7
+ parent: Node | null;
8
+ children: Array<Node>;
9
+ on_ready_callback: (node: Node, engine: Engine) => void;
10
+ on_removed_callback: (node: Node, engine: Engine, parent: Node) => void;
11
+ on_update_callback: (node: Node, engine: Engine, time: number, delta_time: number) => void;
12
+ on_render_callback: (node: Node, engine: Engine, time: number, delta_time: number) => void;
13
+ private lua_url;
14
+ constructor(engine: Engine, name: string);
15
+ set_lua_file(url: string): Promise<void>;
16
+ protected on_ready(node: this, engine: Engine): void;
17
+ protected on_removed(node: this, engine: Engine, parent: Node): void;
18
+ protected on_update(node: this, engine: Engine, time: number, delta_time: number): void;
19
+ protected on_render(node: this, engine: Engine, time: number, delta_time: number): void;
20
+ protected on_parented(): void;
21
+ has_child(node: Node | string): boolean;
22
+ has_parent(node: Node | string): boolean;
23
+ get_parent(node_name: string): Node | null;
24
+ get_parent_of_type<T>(node_type: Constructor<T>): T | null;
25
+ get_child(name: string): Node | null;
26
+ get_children_of_type<T>(node_type: Constructor<T>): T[];
27
+ push_child(node: Node): void;
28
+ remove_child(node: Node | string): void;
29
+ update(time: number, delta_time: number): void;
30
+ render(view_matrix: Mat4, projection_matrix_3d: Mat4, projection_matrix_2d: Mat4, time: number, delta_time: number): void;
31
+ protected render_children(view_matrix: Mat4, projection_matrix_3d: Mat4, projection_matrix_2d: Mat4, time: number, delta_time: number): void;
32
+ protected render_class(view_matrix: Mat4, projection_matrix_3d: Mat4, projection_matrix_2d: Mat4, time: number, delta_time: number): void;
33
+ }
34
+ export declare class Node2D extends Node {
35
+ private stored_position;
36
+ private stored_rotation;
37
+ private stored_scale;
38
+ constructor(engine: Engine, name: string);
39
+ get position(): Vec2;
40
+ set position(value: Vec2);
41
+ get rotation(): number;
42
+ set rotation(value: number);
43
+ get scale(): Vec2;
44
+ set scale(value: Vec2);
45
+ private proxy_on_change_position;
46
+ private proxy_on_change_scale;
47
+ protected on_change_position(new_value: Vec2): void;
48
+ protected on_change_rotation(new_value: number): void;
49
+ protected on_change_scale(new_value: Vec2): void;
50
+ get_model_matrix(): Mat4;
51
+ get_world_matrix(): Mat4;
52
+ }
53
+ export declare class Node3D extends Node {
54
+ private stored_position;
55
+ private stored_rotation;
56
+ private stored_scale;
57
+ constructor(engine: Engine, name: string);
58
+ get position(): Vec3;
59
+ set position(value: Vec3);
60
+ get rotation(): Quat;
61
+ set rotation(value: Quat);
62
+ get scale(): Vec3;
63
+ set scale(value: Vec3);
64
+ private proxy_on_change_position;
65
+ private proxy_on_change_rotation;
66
+ private proxy_on_change_scale;
67
+ protected on_change_position(new_value: Vec3): void;
68
+ protected on_change_rotation(new_value: Quat): void;
69
+ protected on_change_scale(new_value: Vec3): void;
70
+ get_world_position(): Vec3;
71
+ get_parent_world_matrix(): Mat4;
72
+ get_model_matrix(): Mat4;
73
+ get_world_matrix(): Mat4;
74
+ }
75
+ export {};
76
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAQ,MAAM,cAAc,CAAC;AAE5D,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,KAAK,WAAW,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEhD,qBAAa,IAAI;IACb,MAAM,EAAC,MAAM,CAAC;IACd,IAAI,EAAC,MAAM,CAAC;IACZ,MAAM,EAAC,IAAI,GAAC,IAAI,CAAQ;IACxB,QAAQ,EAAC,KAAK,CAAC,IAAI,CAAC,CAAM;IAG1B,iBAAiB,EAAC,CAAC,IAAI,EAAC,IAAI,EAAE,MAAM,EAAC,MAAM,KAAK,IAAI,CAAuB;IAC3E,mBAAmB,EAAC,CAAC,IAAI,EAAC,IAAI,EAAE,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,IAAI,KAAK,IAAI,CAA+B;IAClG,kBAAkB,EAAC,CAAC,IAAI,EAAC,IAAI,EAAE,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,KAAK,IAAI,CAA8D;IACnJ,kBAAkB,EAAC,CAAC,IAAI,EAAC,IAAI,EAAE,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,KAAK,IAAI,CAA8D;IACnJ,OAAO,CAAC,OAAO,CAAoB;gBAEvB,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM;IAKhC,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AGtB;IAED,IAAI,QAAQ,IAAG,IAAI,CAElB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAC,IAAI,EAGtB;IAED,IAAI,KAAK,IAAG,IAAI,CAEf;IAED,IAAI,KAAK,CAAC,KAAK,EAAC,IAAI,EAGnB;IAGD,OAAO,CAAC,wBAAwB;IAMhC,OAAO,CAAC,wBAAwB;IAMhC,OAAO,CAAC,qBAAqB;IAM7B,SAAS,CAAC,kBAAkB,CAAC,SAAS,EAAC,IAAI;IAC3C,SAAS,CAAC,kBAAkB,CAAC,SAAS,EAAC,IAAI;IAC3C,SAAS,CAAC,eAAe,CAAC,SAAS,EAAC,IAAI;IAExC,kBAAkB,IAAG,IAAI;IAKzB,uBAAuB,IAAG,IAAI;IAe9B,gBAAgB,IAAG,IAAI;IAavB,gBAAgB,IAAG,IAAI;CAG1B"}
package/dist/node.js ADDED
@@ -0,0 +1,308 @@
1
+ import { Vec3, Vec2, Mat4, Quat } from '@vicimpa/glm';
2
+ export class Node {
3
+ constructor(engine, name) {
4
+ this.parent = null;
5
+ this.children = [];
6
+ // CALLBACKS
7
+ this.on_ready_callback = (node, engine) => { };
8
+ this.on_removed_callback = (node, engine, parent) => { };
9
+ this.on_update_callback = (node, engine, time, delta_time) => { };
10
+ this.on_render_callback = (node, engine, time, delta_time) => { };
11
+ this.lua_url = null;
12
+ this.engine = engine;
13
+ this.name = name;
14
+ }
15
+ async set_lua_file(url) {
16
+ this.lua_url = url;
17
+ await this.engine.hook_manager.add_on_ready_callback(url);
18
+ await this.engine.hook_manager.add_on_removed_callback(url);
19
+ await this.engine.hook_manager.add_on_update_callback(url);
20
+ await this.engine.hook_manager.add_on_render_callback(url);
21
+ }
22
+ on_ready(node, engine) {
23
+ this.on_ready_callback(node, engine);
24
+ if (this.lua_url !== null)
25
+ this.engine.hook_manager.call_on_ready_callback(this.lua_url, node, engine);
26
+ }
27
+ on_removed(node, engine, parent) {
28
+ this.on_removed_callback(node, engine, parent);
29
+ if (this.lua_url !== null)
30
+ this.engine.hook_manager.call_on_removed_callback(this.lua_url, node, engine, parent);
31
+ }
32
+ on_update(node, engine, time, delta_time) {
33
+ if (this.engine.main_scene.rendering_depth_map)
34
+ return;
35
+ this.on_update_callback(node, engine, time, delta_time);
36
+ if (this.lua_url !== null)
37
+ this.engine.hook_manager.call_on_update_callback(this.lua_url, node, engine, time, delta_time);
38
+ }
39
+ on_render(node, engine, time, delta_time) {
40
+ if (this.engine.main_scene.rendering_depth_map)
41
+ return;
42
+ this.on_render_callback(node, engine, time, delta_time);
43
+ if (this.lua_url !== null)
44
+ this.engine.hook_manager.call_on_render_callback(this.lua_url, node, engine, time, delta_time);
45
+ }
46
+ on_parented() {
47
+ }
48
+ has_child(node) {
49
+ if (node instanceof Node)
50
+ return this.children.includes(node);
51
+ // node is string
52
+ for (const child of this.children) {
53
+ if (child.name === node)
54
+ return true;
55
+ }
56
+ return false;
57
+ }
58
+ has_parent(node) {
59
+ if (this.parent && (this.parent === node || this.parent.name === node))
60
+ return true;
61
+ if (this.parent)
62
+ return this.parent.has_parent(node);
63
+ return false;
64
+ }
65
+ get_parent(node_name) {
66
+ if (this.parent && this.parent.name === node_name)
67
+ return this.parent;
68
+ if (this.parent)
69
+ return this.parent.get_parent(node_name);
70
+ return null;
71
+ }
72
+ get_parent_of_type(node_type) {
73
+ if (this.parent instanceof node_type)
74
+ return this.parent;
75
+ if (this.parent)
76
+ return this.parent.get_parent_of_type(node_type);
77
+ return null;
78
+ }
79
+ get_child(name) {
80
+ // node is string
81
+ for (const child of this.children) {
82
+ if (child.name === name)
83
+ return child;
84
+ else {
85
+ const result = child.get_child(name);
86
+ if (result)
87
+ return result;
88
+ }
89
+ }
90
+ return null;
91
+ }
92
+ get_children_of_type(node_type) {
93
+ var target_list = [];
94
+ var parents = [this];
95
+ for (const child of parents[parents.length - 1].children) {
96
+ const child_target_list = child.get_children_of_type(node_type);
97
+ target_list.concat(child_target_list);
98
+ if (child instanceof node_type) {
99
+ target_list.push(child);
100
+ }
101
+ }
102
+ return target_list;
103
+ }
104
+ push_child(node) {
105
+ if (node.parent) {
106
+ let parent = node.parent;
107
+ node.parent.remove_child(node);
108
+ }
109
+ this.children.push(node);
110
+ node.parent = this;
111
+ node.on_ready(node, this.engine);
112
+ node.on_parented();
113
+ }
114
+ remove_child(node) {
115
+ var index;
116
+ if (node instanceof Node) {
117
+ index = this.children.indexOf(node);
118
+ if (index > -1) {
119
+ this.children.splice(index, 1);
120
+ }
121
+ node.parent = null;
122
+ }
123
+ else {
124
+ // node is string
125
+ // remove parent
126
+ const node_instance = this.engine.main_scene.get_node(node);
127
+ if (node_instance)
128
+ node_instance.parent = null;
129
+ // remove from children of parent.
130
+ index = -1;
131
+ for (const child of this.children) {
132
+ if (child.name === node) {
133
+ node = child;
134
+ break;
135
+ }
136
+ index++;
137
+ }
138
+ if (index > -1) {
139
+ this.children.splice(index, 1);
140
+ }
141
+ }
142
+ if (node instanceof Node) {
143
+ node.on_removed(node, this.engine, this);
144
+ }
145
+ }
146
+ update(time, delta_time) {
147
+ this.on_update(this, this.engine, time, delta_time);
148
+ for (const child of this.children) {
149
+ child.update(time, delta_time);
150
+ }
151
+ }
152
+ render(view_matrix, projection_matrix_3d, projection_matrix_2d, time, delta_time) {
153
+ this.render_class(view_matrix, projection_matrix_3d, projection_matrix_2d, time, delta_time);
154
+ this.render_children(view_matrix, projection_matrix_3d, projection_matrix_2d, time, delta_time);
155
+ }
156
+ render_children(view_matrix, projection_matrix_3d, projection_matrix_2d, time, delta_time) {
157
+ for (const child of this.children) {
158
+ child.render(view_matrix, projection_matrix_3d, projection_matrix_2d, time, delta_time);
159
+ }
160
+ }
161
+ // This is the function where the webgl2 state is set to render.
162
+ render_class(view_matrix, projection_matrix_3d, projection_matrix_2d, time, delta_time) {
163
+ this.on_render(this, this.engine, time, delta_time);
164
+ }
165
+ }
166
+ export class Node2D extends Node {
167
+ constructor(engine, name) {
168
+ super(engine, name);
169
+ // Bind the methods to the current instance
170
+ this.proxy_on_change_position = this.proxy_on_change_position.bind(this);
171
+ this.proxy_on_change_scale = this.proxy_on_change_scale.bind(this);
172
+ // Re-initialize proxies now that methods are bound
173
+ this.stored_position = new Proxy(new Vec2(0.0), { set: this.proxy_on_change_position });
174
+ this.stored_rotation = 0.0;
175
+ this.stored_scale = new Proxy(new Vec2(1.0), { set: this.proxy_on_change_scale });
176
+ }
177
+ get position() {
178
+ return this.stored_position;
179
+ }
180
+ set position(value) {
181
+ this.stored_position = new Proxy(value, { set: this.proxy_on_change_position });
182
+ this.on_change_position(value);
183
+ }
184
+ get rotation() {
185
+ return this.stored_rotation;
186
+ }
187
+ set rotation(value) {
188
+ this.stored_rotation = value;
189
+ this.on_change_rotation(value);
190
+ }
191
+ get scale() {
192
+ return this.stored_scale;
193
+ }
194
+ set scale(value) {
195
+ this.stored_scale = new Proxy(value, { set: this.proxy_on_change_scale });
196
+ this.on_change_scale(value);
197
+ }
198
+ proxy_on_change_position(target, property, value) {
199
+ target[property] = value;
200
+ this.on_change_position(target);
201
+ return true;
202
+ }
203
+ proxy_on_change_scale(target, property, value) {
204
+ target[property] = value;
205
+ this.on_change_scale(target);
206
+ return true;
207
+ }
208
+ on_change_position(new_value) { } // ABSTRACT METHOD
209
+ on_change_rotation(new_value) { } // ABSTRACT METHOD
210
+ on_change_scale(new_value) { } // ABSTRACT METHOD
211
+ get_model_matrix() {
212
+ let model = (new Mat4()).identity();
213
+ model.translate(new Vec3(this.position.x, this.position.y, 0.0));
214
+ model.rotate(this.rotation, new Vec3(0.0, 0.0, 1.0));
215
+ model.scale(new Vec3(this.scale.x, this.scale.y, 1.0));
216
+ return model;
217
+ }
218
+ get_world_matrix() {
219
+ let model = this.get_model_matrix();
220
+ if (this.parent instanceof Node2D) {
221
+ model = this.parent.get_model_matrix().mul(model);
222
+ }
223
+ return model;
224
+ }
225
+ }
226
+ export class Node3D extends Node {
227
+ constructor(engine, name) {
228
+ super(engine, name);
229
+ // Bind the methods to the current instance
230
+ this.proxy_on_change_position = this.proxy_on_change_position.bind(this);
231
+ this.proxy_on_change_rotation = this.proxy_on_change_rotation.bind(this);
232
+ this.proxy_on_change_scale = this.proxy_on_change_scale.bind(this);
233
+ // Re-initialize proxies now that methods are bound
234
+ this.stored_position = new Proxy(new Vec3(0.0), { set: this.proxy_on_change_position });
235
+ this.stored_rotation = new Proxy(new Quat(), { set: this.proxy_on_change_rotation });
236
+ this.stored_scale = new Proxy(new Vec3(1.0), { set: this.proxy_on_change_scale });
237
+ }
238
+ get position() {
239
+ return this.stored_position;
240
+ }
241
+ set position(value) {
242
+ this.stored_position = new Proxy(value, { set: this.proxy_on_change_position });
243
+ this.on_change_position(value);
244
+ }
245
+ get rotation() {
246
+ return this.stored_rotation;
247
+ }
248
+ set rotation(value) {
249
+ this.stored_rotation = new Proxy(value, { set: this.proxy_on_change_rotation });
250
+ this.on_change_rotation(value);
251
+ }
252
+ get scale() {
253
+ return this.stored_scale;
254
+ }
255
+ set scale(value) {
256
+ this.stored_scale = new Proxy(value, { set: this.proxy_on_change_scale });
257
+ this.on_change_scale(value);
258
+ }
259
+ proxy_on_change_position(target, property, value) {
260
+ target[property] = value;
261
+ this.on_change_position(target);
262
+ return true;
263
+ }
264
+ proxy_on_change_rotation(target, property, value) {
265
+ target[property] = value;
266
+ this.on_change_rotation(target);
267
+ return true;
268
+ }
269
+ proxy_on_change_scale(target, property, value) {
270
+ target[property] = value;
271
+ this.on_change_scale(target);
272
+ return true;
273
+ }
274
+ on_change_position(new_value) { } // ABSTRACT METHOD
275
+ on_change_rotation(new_value) { } // ABSTRACT METHOD
276
+ on_change_scale(new_value) { } // ABSTRACT METHOD
277
+ get_world_position() {
278
+ const world_matrix = this.get_world_matrix();
279
+ return new Vec3(world_matrix[12], world_matrix[13], world_matrix[14]);
280
+ }
281
+ get_parent_world_matrix() {
282
+ if (this.parent instanceof Node3D) {
283
+ return this.parent.get_world_matrix();
284
+ }
285
+ else if (this.parent) {
286
+ let parent = this.parent.parent;
287
+ while (parent) {
288
+ if (parent instanceof Node3D) {
289
+ return parent.get_world_matrix();
290
+ }
291
+ parent = parent.parent;
292
+ }
293
+ }
294
+ return new Mat4().identity();
295
+ }
296
+ get_model_matrix() {
297
+ const model = new Mat4().identity();
298
+ model.translate(this.position);
299
+ const rotation_mat = new Mat4().fromQuat(this.rotation);
300
+ model.mul(rotation_mat);
301
+ model.scale(this.scale);
302
+ return model;
303
+ }
304
+ get_world_matrix() {
305
+ return this.get_parent_world_matrix().mul(this.get_model_matrix());
306
+ }
307
+ }
308
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAQ,MAAM,cAAc,CAAC;AAM5D,MAAM,OAAO,IAAI;IAab,YAAY,MAAa,EAAE,IAAW;QAVtC,WAAM,GAAa,IAAI,CAAC;QACxB,aAAQ,GAAe,EAAE,CAAC;QAE1B,YAAY;QACZ,sBAAiB,GAAsC,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAC,CAAC,CAAC;QAC3E,wBAAmB,GAAmD,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,GAAC,CAAC,CAAC;QAClG,uBAAkB,GAAsE,CAAC,IAAI,EAAE,MAAa,EAAE,IAAW,EAAE,UAAiB,EAAE,EAAE,GAAC,CAAC,CAAC;QACnJ,uBAAkB,GAAsE,CAAC,IAAI,EAAE,MAAa,EAAE,IAAW,EAAE,UAAiB,EAAE,EAAE,GAAC,CAAC,CAAC;QAC3I,YAAO,GAAe,IAAI,CAAC;QAG/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,GAAU;QACzB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACnB,MAAM,IAAI,CAA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