@woosh/meep-engine 2.126.30 → 2.126.32
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/README.md
CHANGED
|
@@ -13,7 +13,7 @@ To help get you started, various samples are provided under `/samples` folder. F
|
|
|
13
13
|
|
|
14
14
|
## Quality
|
|
15
15
|
|
|
16
|
-
Meep is covered by 2,
|
|
16
|
+
Meep is covered by 2,712 handwritten unit tests
|
|
17
17
|
|
|
18
18
|
The aim is to [ensure quality](https://about.codecov.io/blog/the-case-against-100-code-coverage/). As a result, the tests are written to cover complex code first and to exhaustively validate critical algorithms.
|
|
19
19
|
Most of the test code is significantly larger than the code that is being tested.
|
|
@@ -22,11 +22,18 @@ Most of the test code is significantly larger than the code that is being tested
|
|
|
22
22
|
|
|
23
23
|
Meep is infinitely tree-shakable, you only package what you use.
|
|
24
24
|
|
|
25
|
-
Meep is distributed as a fine-grained set of ~
|
|
25
|
+
Meep is distributed as a fine-grained set of ~3,000 modules, with an average module being ~70 lines of code.
|
|
26
26
|
If you use meep in your project, you add as much or as little to your overall bundle size as you want.
|
|
27
27
|
|
|
28
28
|
For example, if you include `core/math/lerp` function, you only add 4 lines of code to your project.
|
|
29
29
|
|
|
30
|
+
## Performance
|
|
31
|
+
|
|
32
|
+
Some say that JavaScript is not a viable choice when performance is a factor. I disagree. Meep aims to strike a balance between performance and comfort.
|
|
33
|
+
That said, meep is performance-first engine. Various API wrappers are offered for convenience, but you're always welcome to drop down to low-level API.
|
|
34
|
+
Meep is written to generate close to 0 garbage and where that would be otherwise impossible - Meep implements custom memory management to make it possible.
|
|
35
|
+
The engine is built to handle millions of objects at the same time on even low-spec mobile hardware.
|
|
36
|
+
|
|
30
37
|
## Features
|
|
31
38
|
|
|
32
39
|
---
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"description": "Pure JavaScript game engine. Fully featured and production ready.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": "Alexander Goldring",
|
|
8
|
-
"version": "2.126.
|
|
8
|
+
"version": "2.126.32",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeSpec.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/AttributeSpec.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH;
|
|
1
|
+
{"version":3,"file":"AttributeSpec.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/AttributeSpec.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH;IA8BI;;;;;;;OAOG;IACH,kBANW,cAAc,YACd,MAAM,eACN,OAAO,SACP,MAAM,GACJ,aAAa,CAazB;IAED,uCAMC;IA6ED;;;;;OAKG;IACH,iBAJW,aAAa,KACb,aAAa,GACZ,MAAM,CAIjB;IA5ID;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,MAFU,cAAc,CAEM;IAE9B;;;;;OAKG;IACH,UAFU,MAAM,CAEH;IAEb;;;;;OAKG;IACH,YAFU,OAAO,CAEE;IA+BnB;;;;;aAoBC;IAED;;;;;MAOC;IAED,eAEC;IAED;;;;OAIG;IACH,cAHW,aAAa,GACX,OAAO,CAQnB;IAED;;;OAGG;IACH,YAFW,aAAa,QAOvB;IAED,uBAMC;IAED;;;OAGG;IACH,eAFa,MAAM,CAIlB;IAaL;;;OAGG;IACH,0BAFU,OAAO,CAEsB;CANtC;+BAvJ8B,6CAA6C"}
|
|
@@ -13,7 +13,7 @@ export class AttributeSpec {
|
|
|
13
13
|
* Typically unique within a given set, used to identify the attribute
|
|
14
14
|
* @type {string}
|
|
15
15
|
*/
|
|
16
|
-
name = "";
|
|
16
|
+
name = ""; // TODO move out into attribute
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* How the attribute is stored in memory and interpreted
|
|
@@ -37,6 +37,26 @@ export class AttributeSpec {
|
|
|
37
37
|
*/
|
|
38
38
|
normalized = false;
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Utility constructor
|
|
42
|
+
* @param {BinaryDataType} type
|
|
43
|
+
* @param {number} itemSize
|
|
44
|
+
* @param {boolean} [normalized]
|
|
45
|
+
* @param {string} [name]
|
|
46
|
+
* @returns {AttributeSpec}
|
|
47
|
+
*/
|
|
48
|
+
static from(type, itemSize, normalized = false, name = "") {
|
|
49
|
+
const spec = new AttributeSpec();
|
|
50
|
+
|
|
51
|
+
spec.fromJSON({
|
|
52
|
+
name,
|
|
53
|
+
type,
|
|
54
|
+
itemSize,
|
|
55
|
+
normalized
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return spec;
|
|
59
|
+
}
|
|
40
60
|
|
|
41
61
|
static fromJSON(j) {
|
|
42
62
|
const r = new AttributeSpec();
|
|
@@ -47,7 +67,7 @@ export class AttributeSpec {
|
|
|
47
67
|
}
|
|
48
68
|
|
|
49
69
|
fromJSON({
|
|
50
|
-
name,
|
|
70
|
+
name = "",
|
|
51
71
|
type,
|
|
52
72
|
itemSize,
|
|
53
73
|
normalized = false
|