matrix-engine-wgpu 1.0.5 → 1.1.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.
- package/.codesandbox/tasks.json +46 -0
- package/.devcontainer/devcontainer.json +22 -0
- package/.github/dependabot.yml +12 -0
- package/REFERENCE.md +5 -2
- package/dev.md +460 -0
- package/empty.js +7 -6
- package/examples/games/jamb/jamb.js +1127 -0
- package/examples/load-obj-file.js +67 -37
- package/examples/unlit-textures.js +26 -23
- package/examples.js +35 -3
- package/main.js +441 -43
- 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 +50 -41
- package/public/app.js +11409 -8893
- package/public/css/style.css +376 -112
- package/public/empty.html +1 -1
- package/public/empty.js +9890 -8885
- package/public/examples.html +10 -8
- package/public/examples.js +945 -203
- package/public/index.html +5 -7
- 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/fonts/Accuratist.ttf +0 -0
- package/public/res/fonts/Closeness.ttf +0 -0
- package/public/res/fonts/WARGAMES.TTF +0 -0
- package/public/res/fonts/readme.txt +5 -0
- package/public/res/fonts/stormfaze.ttf +0 -0
- package/public/res/meshes/blender/cube.blend +0 -0
- package/public/res/meshes/blender/cube.blend1 +0 -0
- package/public/res/meshes/blender/cube.mtl +12 -0
- package/public/res/meshes/blender/cube.obj +46 -0
- package/public/res/meshes/blender/cube.png +0 -0
- package/public/res/meshes/blender/cubeSmartUV.blend +0 -0
- package/public/res/meshes/blender/cubeSmartUV.mtl +12 -0
- package/public/res/meshes/blender/cubeSmartUV.obj +46 -0
- package/public/res/meshes/blender/sphepe.blend +0 -0
- package/public/res/meshes/blender/sphepe.blend1 +0 -0
- package/public/res/meshes/blender/sphere.mtl +10 -0
- package/public/res/meshes/blender/sphere.obj +3402 -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 +232 -116
- package/src/engine/cube.js +10 -5
- package/src/engine/engine.js +3 -9
- package/src/engine/loader-obj.js +9 -6
- package/src/engine/matrix-class.js +240 -202
- package/src/engine/mesh-obj.js +605 -525
- package/src/engine/mesh.js +476 -0
- package/src/engine/raycast-test.js +93 -0
- package/src/engine/utils.js +129 -15
- package/src/multilang/lang.js +35 -0
- package/src/physics/matrix-ammo.js +204 -30
- 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 +312 -236
- package/src/engine/matrix-mesh.js +0 -49
package/public/index.html
CHANGED
|
@@ -2,24 +2,22 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<link rel="manifest" href="manifest.web" />
|
|
5
|
-
<title>Matrix Engine webGPU variant. Created by Nikola Lukic zlatnaspirala@gmail.com </title>
|
|
6
|
-
<meta name="description" content="
|
|
5
|
+
<title>Matrix Engine webGPU variant. Created by Nikola Lukic zlatnaspirala@gmail.com 2024</title>
|
|
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
|
-
<!-- <script src="../../builds/ammo.js"></script> -->
|
|
14
13
|
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimal-ui" />
|
|
15
14
|
<!-- <link rel="icon" type="image/png" sizes="96x96" href="res/icons/favicon-96x96.png" /> -->
|
|
16
15
|
<link rel="icon" type="image/png" sizes="512x512" href="res/icons/512.png" />
|
|
17
16
|
<!-- <link rel="icon" href="res/icons/favicon.ico" type="image/x-icon" /> -->
|
|
18
17
|
<!-- <meta name="msapplication-TileImage" content="res/icons/ms-icon.png" /> -->
|
|
19
|
-
<!-- <script src="https://webglfundamentals.org/webgl/resources/m4.js"></script> -->
|
|
20
18
|
</head>
|
|
21
|
-
<body allow="autoplay">
|
|
22
|
-
<div id="shaders"></div>
|
|
19
|
+
<body allow="autoplay" class="meBody">
|
|
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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Blender MTL File: 'cube.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
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Blender v2.79 (sub 0) OBJ File: 'cube.blend'
|
|
2
|
+
# www.blender.org
|
|
3
|
+
mtllib cube.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 -0.999999
|
|
10
|
+
v 0.999999 1.000000 1.000001
|
|
11
|
+
v -1.000000 1.000000 1.000000
|
|
12
|
+
v -1.000000 1.000000 -1.000000
|
|
13
|
+
vt 0.000000 0.000000
|
|
14
|
+
vt 1.000000 0.000000
|
|
15
|
+
vt 1.000000 1.000000
|
|
16
|
+
vt 0.000000 1.000000
|
|
17
|
+
vt 0.000000 0.000000
|
|
18
|
+
vt 1.000000 0.000000
|
|
19
|
+
vt 1.000000 1.000000
|
|
20
|
+
vt 0.000000 1.000000
|
|
21
|
+
vt 1.000000 0.000000
|
|
22
|
+
vt 1.000000 1.000000
|
|
23
|
+
vt 0.000000 1.000000
|
|
24
|
+
vt 0.000000 0.000000
|
|
25
|
+
vt 1.000000 0.000000
|
|
26
|
+
vt 0.000000 1.000000
|
|
27
|
+
vt 0.000000 0.000000
|
|
28
|
+
vt 1.000000 0.000000
|
|
29
|
+
vt 1.000000 1.000000
|
|
30
|
+
vt 1.000000 0.000000
|
|
31
|
+
vt 1.000000 1.000000
|
|
32
|
+
vt 0.000000 1.000000
|
|
33
|
+
vn 0.0000 -1.0000 0.0000
|
|
34
|
+
vn 0.0000 1.0000 0.0000
|
|
35
|
+
vn 1.0000 0.0000 0.0000
|
|
36
|
+
vn -0.0000 -0.0000 1.0000
|
|
37
|
+
vn -1.0000 -0.0000 -0.0000
|
|
38
|
+
vn 0.0000 0.0000 -1.0000
|
|
39
|
+
usemtl Material
|
|
40
|
+
s off
|
|
41
|
+
f 1/1/1 2/2/1 3/3/1 4/4/1
|
|
42
|
+
f 5/5/2 8/6/2 7/7/2 6/8/2
|
|
43
|
+
f 1/1/3 5/9/3 6/10/3 2/11/3
|
|
44
|
+
f 2/12/4 6/13/4 7/7/4 3/14/4
|
|
45
|
+
f 3/15/5 7/16/5 8/17/5 4/4/5
|
|
46
|
+
f 5/5/6 1/18/6 4/19/6 8/20/6
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Blender MTL File: 'cubeSmartUV.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
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Blender v2.79 (sub 0) OBJ File: 'cubeSmartUV.blend'
|
|
2
|
+
# www.blender.org
|
|
3
|
+
mtllib cubeSmartUV.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 -0.999999
|
|
10
|
+
v 0.999999 1.000000 1.000001
|
|
11
|
+
v -1.000000 1.000000 1.000000
|
|
12
|
+
v -1.000000 1.000000 -1.000000
|
|
13
|
+
vt 0.000000 0.666667
|
|
14
|
+
vt 0.333333 0.666667
|
|
15
|
+
vt 0.333333 1.000000
|
|
16
|
+
vt 0.000000 1.000000
|
|
17
|
+
vt 0.333333 0.333333
|
|
18
|
+
vt 0.333333 0.666667
|
|
19
|
+
vt 0.000000 0.666667
|
|
20
|
+
vt 0.000000 0.333333
|
|
21
|
+
vt 0.666667 0.333333
|
|
22
|
+
vt 0.333333 0.000000
|
|
23
|
+
vt 0.666667 0.000000
|
|
24
|
+
vt 0.000000 0.333333
|
|
25
|
+
vt 0.000000 0.000000
|
|
26
|
+
vt 0.333333 0.000000
|
|
27
|
+
vt 0.333333 0.333333
|
|
28
|
+
vt 1.000000 0.333333
|
|
29
|
+
vt 0.666667 0.333333
|
|
30
|
+
vt 0.666667 0.000000
|
|
31
|
+
vt 1.000000 0.000000
|
|
32
|
+
vt 0.666667 0.666667
|
|
33
|
+
vn 0.0000 -1.0000 0.0000
|
|
34
|
+
vn 0.0000 1.0000 0.0000
|
|
35
|
+
vn 1.0000 0.0000 0.0000
|
|
36
|
+
vn -0.0000 -0.0000 1.0000
|
|
37
|
+
vn -1.0000 -0.0000 -0.0000
|
|
38
|
+
vn 0.0000 0.0000 -1.0000
|
|
39
|
+
usemtl Material
|
|
40
|
+
s off
|
|
41
|
+
f 1/1/1 2/2/1 3/3/1 4/4/1
|
|
42
|
+
f 5/5/2 8/6/2 7/7/2 6/8/2
|
|
43
|
+
f 1/9/3 5/5/3 6/10/3 2/11/3
|
|
44
|
+
f 2/12/4 6/13/4 7/14/4 3/15/4
|
|
45
|
+
f 3/16/5 7/17/5 8/18/5 4/19/5
|
|
46
|
+
f 5/5/6 1/9/6 4/20/6 8/6/6
|
|
Binary file
|
|
Binary file
|