matrix-engine-wgpu 1.4.1 → 1.4.4
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.
- package/examples/load-obj-file.js +6 -1
- package/index.js +17 -10
- package/package.json +1 -1
- package/public/css/style.css +1 -1
- package/public/examples.js +11158 -11111
- package/readme.md +88 -64
- package/src/engine/behavior.js +35 -0
- package/src/engine/lights.js +9 -1
- package/src/engine/mesh-obj.js +18 -9
- package/src/engine/utils.js +1 -9
- package/src/shaders/fragment.wgsl.js +6 -4
- package/src/world.js +4 -13
|
@@ -81,8 +81,13 @@ export var loadObjFile = function() {
|
|
|
81
81
|
|
|
82
82
|
var TEST = loadObjFile.getSceneObjectByName('cube2');
|
|
83
83
|
console.log(`%c Test access scene ${TEST} object.`, LOG_MATRIX);
|
|
84
|
+
|
|
84
85
|
loadObjFile.addLight();
|
|
85
|
-
|
|
86
|
+
loadObjFile.lightContainer[0].behavior.setOsc0(-1,1,0.1)
|
|
87
|
+
loadObjFile.lightContainer[0].behavior.value_ = -1;
|
|
88
|
+
loadObjFile.lightContainer[0].updater.push((light) => {
|
|
89
|
+
light.position[0] = light.behavior.setPath0()
|
|
90
|
+
})
|
|
86
91
|
|
|
87
92
|
}
|
|
88
93
|
})
|
package/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file created by:
|
|
3
|
-
* Nikola Lukic
|
|
4
|
-
*
|
|
3
|
+
* @author Nikola Lukic
|
|
4
|
+
* @email zlatnaspirala@gmail.com mart 2024
|
|
5
|
+
* @description npm import/export
|
|
5
6
|
*/
|
|
6
7
|
// import {degToRad, radToDeg} from "./utils";
|
|
7
8
|
import {downloadMeshes, makeObjSeqArg} from "./src/engine/loader-obj.js";
|
|
@@ -13,16 +14,20 @@ import {
|
|
|
13
14
|
computeWorldVertsAndAABB, rayIntersectsAABB,
|
|
14
15
|
computeAABB
|
|
15
16
|
} from "./src/engine/raycast.js";
|
|
17
|
+
import {OSCILLATOR, SWITCHER} from "./src/engine/utils.js";
|
|
16
18
|
|
|
17
19
|
var about = () => {
|
|
18
|
-
console.
|
|
19
|
-
console.
|
|
20
|
-
console.
|
|
21
|
-
console.
|
|
22
|
-
console.
|
|
23
|
-
console.
|
|
24
|
-
console.
|
|
25
|
-
console.
|
|
20
|
+
console.info("Hi npm. matrix-engine for webgpu is ready...")
|
|
21
|
+
console.info("--------------------------------------------")
|
|
22
|
+
console.info("List of features: ")
|
|
23
|
+
console.info(" - Loading obj files with uvs")
|
|
24
|
+
console.info(" - Scene camera use -z front")
|
|
25
|
+
console.info(" - position, rotation - same like matrix-engine")
|
|
26
|
+
console.info(" - Physics used Ammo.js build")
|
|
27
|
+
console.info(" - Raycaster HIT/CLICK on object scene")
|
|
28
|
+
console.info(" - Light cast shadow multi lights")
|
|
29
|
+
console.info("--------------------------------------------")
|
|
30
|
+
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
export {
|
|
@@ -37,5 +42,7 @@ export {
|
|
|
37
42
|
computeAABB,
|
|
38
43
|
computeWorldVertsAndAABB,
|
|
39
44
|
makeObjSeqArg,
|
|
45
|
+
SWITCHER,
|
|
46
|
+
OSCILLATOR,
|
|
40
47
|
about
|
|
41
48
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matrix-engine-wgpu",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.4",
|
|
4
4
|
"description": "Fixed shadows casting vs camera/video texture, webGPU powered pwa application. Crazy fast rendering with AmmoJS physics support. Simple raycaster hit object added.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|