matrix-engine-wgpu 1.0.6 → 1.1.1
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/.codesandbox/tasks.json +46 -0
- package/.devcontainer/devcontainer.json +22 -0
- package/.github/dependabot.yml +12 -0
- package/REFERENCE.md +3 -5
- package/dev.md +460 -0
- package/empty.js +7 -6
- package/examples/games/jamb/jamb.js +1133 -0
- package/examples/load-obj-file.js +65 -28
- package/examples/unlit-textures.js +26 -23
- package/examples.js +35 -3
- package/index.js +8 -2
- package/main.js +454 -48
- package/non-project-files/dev.txt +21 -0
- package/non-project-files/image1.png +0 -0
- package/non-project-files/image6.png +0 -0
- package/package.json +31 -13
- package/public/app.js +2234 -114
- package/public/css/style.css +371 -110
- package/public/empty.html +1 -1
- package/public/empty.js +9887 -9264
- package/public/examples.html +10 -8
- package/public/examples.js +2035 -247
- package/public/index.html +3 -5
- package/public/manifest copy.web +35 -0
- package/public/res/audios/block.mp3 +0 -0
- package/public/res/audios/dice1.mp3 +0 -0
- package/public/res/audios/dice2.mp3 +0 -0
- package/public/res/audios/start.mp3 +0 -0
- package/public/res/meshes/jamb/bg.blend +0 -0
- package/public/res/meshes/jamb/bg.blend1 +0 -0
- package/public/res/meshes/jamb/bg.mtl +12 -0
- package/public/res/meshes/jamb/bg.obj +17 -0
- package/public/res/meshes/jamb/bg.png +0 -0
- package/public/res/meshes/jamb/dice-default.png +0 -0
- package/public/res/meshes/jamb/dice-mark.png +0 -0
- package/public/res/meshes/jamb/dice.mtl +12 -0
- package/public/res/meshes/jamb/dice.obj +40 -0
- package/public/res/meshes/jamb/dice.png +0 -0
- package/public/res/meshes/jamb/jamb-title.mtl +12 -0
- package/public/res/meshes/jamb/jamb-title.obj +26008 -0
- package/public/res/meshes/jamb/jamb.blend +0 -0
- package/public/res/meshes/jamb/jamb.blend1 +0 -0
- package/public/res/meshes/jamb/logo.png +0 -0
- package/public/res/meshes/jamb/nidzaDice.blend +0 -0
- package/public/res/meshes/jamb/nidzaDice.blend1 +0 -0
- package/public/res/meshes/jamb/pile.blend +0 -0
- package/public/res/meshes/jamb/simpleCube.blend +0 -0
- package/public/res/meshes/jamb/simpleCube.blend1 +0 -0
- package/public/res/meshes/jamb/sounds/roll1.wav +0 -0
- package/public/res/meshes/jamb/text.png +0 -0
- package/public/res/multilang/en.json +27 -0
- package/public/res/multilang/sr.json +27 -0
- package/public/test.html +636 -0
- package/public/three-test.js +165 -0
- package/public/worker.html +1 -1
- package/readme.md +193 -115
- package/src/engine/ball.js +477 -468
- package/src/engine/cube.js +486 -468
- package/src/engine/engine.js +4 -6
- package/src/engine/loader-obj.js +9 -6
- package/src/engine/matrix-class.js +237 -204
- package/src/engine/mesh-obj.js +603 -515
- package/src/engine/raycast.js +101 -0
- package/src/engine/utils.js +69 -3
- package/src/multilang/lang.js +35 -0
- package/src/physics/matrix-ammo.js +168 -15
- package/src/shaders/fragment.wgsl.js +4 -2
- package/src/shaders/shaders.js +1 -1
- package/src/shaders/vertexShadow.wgsl.js +1 -1
- package/src/sounds/sounds.js +47 -0
- package/src/world.js +311 -248
package/public/index.html
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<link rel="manifest" href="manifest.web" />
|
|
5
5
|
<title>Matrix Engine webGPU variant. Created by Nikola Lukic zlatnaspirala@gmail.com 2024</title>
|
|
6
|
-
<meta name="description" content="
|
|
6
|
+
<meta name="description" content="WebGPU open source Project" />
|
|
7
7
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
8
8
|
<link defer rel="stylesheet" href="css/style.css" />
|
|
9
9
|
<link rel="apple-touch-icon" href="res/icons/512.png" />
|
|
10
|
-
<meta name="
|
|
10
|
+
<meta name="mobile-web-app-capable" content="yes" />
|
|
11
11
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
12
12
|
<meta name="theme-color" content="#000000" />
|
|
13
13
|
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimal-ui" />
|
|
@@ -15,11 +15,9 @@
|
|
|
15
15
|
<link rel="icon" type="image/png" sizes="512x512" href="res/icons/512.png" />
|
|
16
16
|
<!-- <link rel="icon" href="res/icons/favicon.ico" type="image/x-icon" /> -->
|
|
17
17
|
<!-- <meta name="msapplication-TileImage" content="res/icons/ms-icon.png" /> -->
|
|
18
|
-
<!-- <script src="https://webglfundamentals.org/webgl/resources/m4.js"></script> -->
|
|
19
18
|
</head>
|
|
20
19
|
<body allow="autoplay" class="meBody">
|
|
21
|
-
<!-- <div id="rot" style="position: absolute; width: 100px;height: 100px; left : 20%; top: 20%; background-color: black;color:white;"> TEST AXIS ROT </div> -->
|
|
22
|
-
<!-- <div id="shaders"></div> -->
|
|
23
20
|
<script src="app.js"></script>
|
|
21
|
+
<div id="msgBox" class="msg-box animate1" onclick="mb.copy()"></div>
|
|
24
22
|
</body>
|
|
25
23
|
</html>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Matrix Engine webGPU",
|
|
3
|
+
"short_name": "matrix-engine-wgpu",
|
|
4
|
+
"start_url": "build.html",
|
|
5
|
+
"orientation": "any",
|
|
6
|
+
"theme_color": "lime",
|
|
7
|
+
"background_color": "black",
|
|
8
|
+
"description": "PWA fully solution with static, dynamic cache, add to home page. The benefits of this project is offering an overview of the entire application logic, easy native implementations (hybrid app), object structural.",
|
|
9
|
+
"display": "standalone",
|
|
10
|
+
"lang": "en-US",
|
|
11
|
+
"icons": [
|
|
12
|
+
{
|
|
13
|
+
"src": "res/icons/512.png",
|
|
14
|
+
"sizes": "512x512",
|
|
15
|
+
"type": "image/png",
|
|
16
|
+
"purpose": "any maskable"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"src": "res/icons/favicon-96x96.png",
|
|
20
|
+
"sizes": "96x96",
|
|
21
|
+
"type": "image/png"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"src": "res/icons/apple-icon.png",
|
|
25
|
+
"sizes": "192x192",
|
|
26
|
+
"type": "image/png"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"author": {
|
|
30
|
+
"name": "Nikola Lukic",
|
|
31
|
+
"website": "https://maximumroulette.com",
|
|
32
|
+
"github": "https://github.com/zlatnaspirala",
|
|
33
|
+
"source-repo": "https://github.com/zlatnaspirala/matrix-engine-wgpu"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Blender 4.1.1 MTL File: 'bg.blend'
|
|
2
|
+
# www.blender.org
|
|
3
|
+
|
|
4
|
+
newmtl title-bg
|
|
5
|
+
Ns 250.000000
|
|
6
|
+
Ka 1.000000 1.000000 1.000000
|
|
7
|
+
Kd 0.800000 0.800000 0.800000
|
|
8
|
+
Ks 0.500000 0.500000 0.500000
|
|
9
|
+
Ke 0.000000 0.000000 0.000000
|
|
10
|
+
Ni 1.000000
|
|
11
|
+
d 1.000000
|
|
12
|
+
illum 2
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Blender 4.1.1
|
|
2
|
+
# www.blender.org
|
|
3
|
+
mtllib bg.mtl
|
|
4
|
+
o Cube
|
|
5
|
+
v 12.801886 0.568624 -13.173548
|
|
6
|
+
v 12.801886 0.568624 13.173548
|
|
7
|
+
v -12.801886 0.568624 -13.173548
|
|
8
|
+
v -12.801886 0.568624 13.173548
|
|
9
|
+
vn -0.0000 1.0000 -0.0000
|
|
10
|
+
vt 0.992815 0.003937
|
|
11
|
+
vt -0.001279 1.004232
|
|
12
|
+
vt -0.001279 0.003937
|
|
13
|
+
vt 0.992815 1.004232
|
|
14
|
+
s 0
|
|
15
|
+
usemtl title-bg
|
|
16
|
+
f 3/1/1 2/2/1 1/3/1
|
|
17
|
+
f 3/1/1 4/4/1 2/2/1
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Blender 4.1.1 MTL File: 'simpleCube.blend'
|
|
2
|
+
# www.blender.org
|
|
3
|
+
|
|
4
|
+
newmtl Material
|
|
5
|
+
Ns 250.000000
|
|
6
|
+
Ka 1.000000 1.000000 1.000000
|
|
7
|
+
Kd 0.800000 0.800000 0.800000
|
|
8
|
+
Ks 0.500000 0.500000 0.500000
|
|
9
|
+
Ke 0.000000 0.000000 0.000000
|
|
10
|
+
Ni 1.450000
|
|
11
|
+
d 1.000000
|
|
12
|
+
illum 2
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Blender 4.1.1
|
|
2
|
+
# www.blender.org
|
|
3
|
+
mtllib dice.mtl
|
|
4
|
+
o Cube
|
|
5
|
+
v 1.000000 1.000000 -1.000000
|
|
6
|
+
v 1.000000 -1.000000 -1.000000
|
|
7
|
+
v 1.000000 1.000000 1.000000
|
|
8
|
+
v 1.000000 -1.000000 1.000000
|
|
9
|
+
v -1.000000 1.000000 -1.000000
|
|
10
|
+
v -1.000000 -1.000000 -1.000000
|
|
11
|
+
v -1.000000 1.000000 1.000000
|
|
12
|
+
v -1.000000 -1.000000 1.000000
|
|
13
|
+
vn -0.0000 1.0000 -0.0000
|
|
14
|
+
vn -0.0000 -0.0000 1.0000
|
|
15
|
+
vn -1.0000 -0.0000 -0.0000
|
|
16
|
+
vn -0.0000 -1.0000 -0.0000
|
|
17
|
+
vn 1.0000 -0.0000 -0.0000
|
|
18
|
+
vn -0.0000 -0.0000 -1.0000
|
|
19
|
+
vt 0.625000 0.500000
|
|
20
|
+
vt 0.875000 0.500000
|
|
21
|
+
vt 0.875000 0.750000
|
|
22
|
+
vt 0.625000 0.750000
|
|
23
|
+
vt 0.375000 0.750000
|
|
24
|
+
vt 0.625000 1.000000
|
|
25
|
+
vt 0.375000 1.000000
|
|
26
|
+
vt 0.375000 0.000000
|
|
27
|
+
vt 0.625000 0.000000
|
|
28
|
+
vt 0.625000 0.250000
|
|
29
|
+
vt 0.375000 0.250000
|
|
30
|
+
vt 0.125000 0.500000
|
|
31
|
+
vt 0.375000 0.500000
|
|
32
|
+
vt 0.125000 0.750000
|
|
33
|
+
s 0
|
|
34
|
+
usemtl Material
|
|
35
|
+
f 1/1/1 5/2/1 7/3/1 3/4/1
|
|
36
|
+
f 4/5/2 3/4/2 7/6/2 8/7/2
|
|
37
|
+
f 8/8/3 7/9/3 5/10/3 6/11/3
|
|
38
|
+
f 6/12/4 2/13/4 4/5/4 8/14/4
|
|
39
|
+
f 2/13/5 1/1/5 3/4/5 4/5/5
|
|
40
|
+
f 6/11/6 5/10/6 1/1/6 2/13/6
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Blender MTL File: 'jamb.blend'
|
|
2
|
+
# Material Count: 1
|
|
3
|
+
|
|
4
|
+
newmtl Material
|
|
5
|
+
Ns 96.078431
|
|
6
|
+
Ka 1.000000 1.000000 1.000000
|
|
7
|
+
Kd 0.640000 0.640000 0.640000
|
|
8
|
+
Ks 0.500000 0.500000 0.500000
|
|
9
|
+
Ke 0.000000 0.000000 0.000000
|
|
10
|
+
Ni 1.000000
|
|
11
|
+
d 1.000000
|
|
12
|
+
illum 2
|