matrix-engine-wgpu 1.0.4 → 1.0.5

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 CHANGED
@@ -51,3 +51,6 @@ Most examples that have one render pass set loadOp: 'clear' but in the example a
51
51
  YEs this is happening " would erase the results from render pass 1 "
52
52
 
53
53
 
54
+
55
+ # https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm
56
+
package/main.js CHANGED
@@ -2,13 +2,23 @@ import MatrixEngineWGPU from "./src/world.js";
2
2
  import {downloadMeshes} from './src/engine/loader-obj.js';
3
3
 
4
4
  export let application = new MatrixEngineWGPU({
5
- useSingleRenderPass: false,
6
- canvasSize: 'fullscreen'
5
+ canvasSize: 'fullscreen',
6
+ mainCameraParams: {
7
+ type: 'WASD',
8
+ responseCoef: 1000
9
+ }
7
10
  }, () => {
8
- function onLoadObj(m) {
9
11
 
10
- console.log('Loaded objs:', m);
12
+ addEventListener('AmmoReady', () => {
13
+ downloadMeshes({
14
+ welcomeText: "./res/meshes/blender/piramyd.obj",
15
+ armor: "./res/meshes/obj/armor.obj",
16
+ lopta: "./res/meshes/blender/lopta.obj",
17
+ }, onLoadObj)
18
+ })
11
19
 
20
+ function onLoadObj(m) {
21
+ // console.log('Loaded objs:', m);
12
22
  application.addMeshObj({
13
23
  position: {x: -3, y: 0, z: -5},
14
24
  rotation: {x: 0, y: 0, z: 0},
@@ -19,19 +29,24 @@ export let application = new MatrixEngineWGPU({
19
29
  })
20
30
 
21
31
  application.addMeshObj({
22
- position: {x: 3, y: 0, z: -5},
32
+ position: {x: 1, y: 0, z: -5},
23
33
  rotation: {x: -90, y: 0, z: 0},
24
34
  rotationSpeed: {x: 0, y: 0, z: 0},
25
35
  texturesPaths: ['./res/meshes/obj/armor.png'],
26
36
  name: 'MyText',
27
37
  mesh: m.welcomeText
28
38
  })
29
- }
30
39
 
31
- downloadMeshes({
32
- welcomeText: "./res/meshes/blender/piramyd.obj",
33
- armor: "./res/meshes/obj/armor.obj"
34
- }, onLoadObj)
40
+ application.addMeshObj({
41
+ position: {x: 1, y: 0, z: -15},
42
+ rotation: {x: -90, y: 0, z: 0},
43
+ rotationSpeed: {x: 0, y: 10, z: 0},
44
+ texturesPaths: ['./res/meshes/obj/armor.png'],
45
+ name: 'Lopta-Fizika',
46
+ mesh: m.lopta,
47
+ physics: {enabled: true}
48
+ })
49
+ }
35
50
 
36
51
  })
37
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matrix-engine-wgpu",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "webGPU powered pwa application.Crazy fast rendering.",
5
5
  "main": "index.js",
6
6
  "scripts": {