matrix-engine-wgpu 1.0.4 → 1.0.6
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/REFERENCE.md +8 -0
- package/examples/load-obj-file.js +1 -8
- package/main.js +39 -20
- package/package.json +35 -41
- package/public/ammojs/ammo.js +957 -0
- package/public/ammojs/ammo.wasm.js +921 -0
- package/public/ammojs/ammo.wasm.wasm +0 -0
- package/public/app.js +607 -154
- package/public/css/style.css +6 -3
- package/public/empty.js +466 -84
- package/public/examples.js +466 -84
- package/public/index.html +4 -4
- 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/lopta.mtl +10 -0
- package/public/res/meshes/blender/lopta.obj +3402 -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/readme.md +161 -45
- package/src/engine/ball.js +3 -3
- package/src/engine/cube.js +3 -3
- package/src/engine/engine.js +2 -4
- package/src/engine/matrix-class.js +11 -6
- package/src/engine/mesh-obj.js +33 -35
- package/src/engine/mesh.js +4 -5
- package/src/engine/utils.js +347 -46
- package/src/physics/matrix-ammo.js +140 -0
- package/src/world.js +80 -84
- package/src/engine/matrix-mesh.js +0 -49
package/public/index.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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>
|
|
5
|
+
<title>Matrix Engine webGPU variant. Created by Nikola Lukic zlatnaspirala@gmail.com 2024</title>
|
|
6
6
|
<meta name="description" content="The benefits of this project is offering an overview of the entire application logic, easy native implementations (hybrid app), object structural. " />
|
|
7
7
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
8
8
|
<link defer rel="stylesheet" href="css/style.css" />
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
<meta name="apple-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 defer src="./lib/gl-matrix-min.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" />
|
|
@@ -18,8 +17,9 @@
|
|
|
18
17
|
<!-- <meta name="msapplication-TileImage" content="res/icons/ms-icon.png" /> -->
|
|
19
18
|
<!-- <script src="https://webglfundamentals.org/webgl/resources/m4.js"></script> -->
|
|
20
19
|
</head>
|
|
21
|
-
<body allow="autoplay">
|
|
22
|
-
<div id="
|
|
20
|
+
<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
23
|
<script src="app.js"></script>
|
|
24
24
|
</body>
|
|
25
25
|
</html>
|
|
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
|