@woosh/meep-engine 2.131.19 → 2.131.21
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 +85 -101
- package/package.json +1 -1
- package/src/core/binary/type/DataType2TypedArrayConstructorMapping.d.ts +1 -1
- package/src/core/binary/type/DataType2TypedArrayConstructorMapping.js +1 -1
- package/src/core/collection/array/computeStridedArrayHash.d.ts.map +1 -1
- package/src/core/collection/array/computeStridedArrayHash.js +1 -0
- package/src/core/collection/array/computeStridedIntegerArrayHash.d.ts.map +1 -1
- package/src/core/collection/array/computeStridedIntegerArrayHash.js +1 -0
- package/src/core/color/illuminant/planckian_radiance.js +4 -4
- package/src/core/geom/2d/aabb/AABB2.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/AABB2.js +4 -1
- package/src/core/geom/3d/mat4/eulerAnglesFromMatrix.d.ts +10 -5
- package/src/core/geom/3d/mat4/eulerAnglesFromMatrix.d.ts.map +1 -1
- package/src/core/geom/3d/mat4/eulerAnglesFromMatrix.js +11 -5
- package/src/core/math/inverseLerp.d.ts +1 -1
- package/src/core/math/inverseLerp.js +2 -2
- package/src/core/math/sign.d.ts.map +1 -1
- package/src/core/math/sign.js +4 -1
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.js +3 -0
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts +20 -25
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/PNGReader.js +20 -25
- package/src/engine/ecs/gui/GUIElementSystem.d.ts.map +1 -1
- package/src/engine/ecs/gui/GUIElementSystem.js +1 -0
- package/src/engine/ecs/gui/position/ViewportPositionSystem.d.ts.map +1 -1
- package/src/engine/ecs/gui/position/ViewportPositionSystem.js +1 -0
package/README.md
CHANGED
|
@@ -1,126 +1,110 @@
|
|
|
1
1
|
# Meep Engine
|
|
2
|
+
**The unopinionated, high-performance ECS engine for code-first developers.**
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
Meep is a battle-tested JavaScript game engine designed for scale. Built over 10+ years and used in commercial Steam releases, it strips away the bloat of traditional engines to offer a molecular, zero-allocation architecture.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
It is designed for engineers who want full control, offering performance that rivals native code on the web.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
[🚀 Quick Start Template](http://gitlab.company-named.com/travnik/dream-engine-template) | [📚 Documentation](http://meep-engine.company-named.com:8080/docs/getting_started/Installation)
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Why Meep?
|
|
13
|
+
Most web engines are heavy, opinionated, and struggle with garbage collection. Meep is different.
|
|
14
|
+
|
|
15
|
+
* **Pure ECS Architecture:** A true data-oriented foundation that supports complex hierarchies and millions of entities. Unlike hybrid engines, our component queries are instantaneous.
|
|
16
|
+
* **Molecular Modularity:** Distributed as ~3,000 fine-grained modules. Need a lerp function? Import it for a 4-line footprint. You never pay for code you don't use.
|
|
17
|
+
* **Zero-Garbage Architecture:** Custom memory management ensures stable frame rates. Meep handles millions of objects on low-spec mobile hardware without GC spikes.
|
|
18
|
+
* **Code-First:** No GUI. No black boxes. Meep is a programmatic tool designed for software engineers who value architecture and long-term integration.
|
|
19
|
+
* **Battle-Hardened:** Covered by 3,000+ unit tests and extensive assertions. This is not a prototype; it is industrial-grade software.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 💎 Architecture: Pure ECS
|
|
24
|
+
Meep is not yet another Object-Oriented engine with an ECS tacked on; it is a **Pure Entity Component System** engine.
|
|
25
|
+
|
|
26
|
+
While other engines (like Unity) struggle with slow query times and documentation that advises you to use component lookups "sparingly" — Meep thrives on them.
|
|
27
|
+
|
|
28
|
+
* **Strict Data-Oriented Design:** One component instance per type per entity. This guarantees memory layout optimization and cache locality.
|
|
29
|
+
* **The Hierarchy Problem: Solved.** Pure ECS architectures historically struggle with scene graphs and parent-child transforms. Meep solves this natively. You get the composability of a scene graph with the raw speed of a flat array. (Similar to the Rust-based Bevy engine).
|
|
30
|
+
* **Tiered API Access:**
|
|
31
|
+
* **High-Level:** Use convenient abstraction layers for gameplay logic.
|
|
32
|
+
* **Low-Level:** Drop down to raw typed arrays for performance-critical paths.
|
|
33
|
+
* **Uncompromised Speed:** Because the architecture is solid, you can query, filter, and iterate over millions of entities without performance cliffs.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## ⚡ High-Performance Rendering
|
|
38
|
+
Meep implements a Clustered Forward+ rendering pipeline, allowing for scenes that traditional web engines choke on.
|
|
39
|
+
|
|
40
|
+
* **Unlimited Lighting:** Render thousands of point lights (muzzle flashes, explosions, torches) with clustered lighting.
|
|
41
|
+
|
|
42
|
+
* **GPU-Driven Decals:** Handle 1,000,000+ decals for persistent battle damage and environmental details.
|
|
43
|
+
|
|
44
|
+
* **Massive Terrain:** Chunk-based, auto-culled terrain system supporting up to 256 layers (vs Unity's 4).
|
|
10
45
|
|
|
11
|
-
|
|
12
|
-
To help get you started, various samples are provided under `/samples` folder. Feel free to use them as a point of reference.
|
|
46
|
+
* **"Particular" Particle Engine:** A zero-allocation particle system with full lighting, soft particles, and automatic atlassing. Compiled into just 4 shaders to eliminate state-switching overhead.
|
|
13
47
|
|
|
14
|
-
|
|
48
|
+
* **Path Tracing:** Includes a pure JS path tracer utilizing the engine's internal BVH.
|
|
15
49
|
|
|
16
|
-
|
|
17
|
-
Meep
|
|
50
|
+
## 🧠 AI & Simulation Tools
|
|
51
|
+
Meep provides a suite of tools rarely found in JS engines, optimized for complex decision making.
|
|
18
52
|
|
|
19
|
-
|
|
20
|
-
Most of the test code is significantly larger than the code that is being tested.
|
|
53
|
+
* **Behavior Trees & Blackboards:** Industry-standard tools for state management.
|
|
21
54
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
55
|
+
* **Monte-Carlo Tree Search:** The same algorithm used in AlphaGo, available for your decision logic.
|
|
56
|
+
|
|
57
|
+
* **Resource Allocation Solver:** Plan optimal actions based on limited resources (ammo, health, currency).
|
|
58
|
+
|
|
59
|
+
* **Spatial Query System:** Highly optimized BVH for Ray, Box, Frustum, and Point queries.
|
|
60
|
+
|
|
61
|
+
* **Inverse Kinematics:** Includes FABRIK solvers and specialized bip/quadruped solvers for uneven terrain adaptation.
|
|
62
|
+
|
|
63
|
+
## 🛠️ Developer Experience
|
|
64
|
+
|
|
65
|
+
### Installation & Stripping
|
|
66
|
+
|
|
67
|
+
Meep is designed to be invisible in production.
|
|
68
|
+
```shell
|
|
69
|
+
npm install @woosh/meep-engine
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Development Mode:** The engine includes ~4,000 assertions to help you catch errors instantly.
|
|
73
|
+
|
|
74
|
+
**Production Mode:** Using @rollup/plugin-strip, Meep compiles to tiny size and runs at the speed of light.
|
|
26
75
|
|
|
27
76
|
```js
|
|
77
|
+
// vite.config.js
|
|
28
78
|
import strip from '@rollup/plugin-strip';
|
|
29
|
-
import { defineConfig } from 'vite';
|
|
30
|
-
|
|
31
79
|
export default defineConfig({
|
|
32
|
-
plugins: [{
|
|
33
|
-
// this will remove all assert statements from the production build
|
|
34
|
-
...strip(),
|
|
35
|
-
apply: 'build'
|
|
36
|
-
}],
|
|
37
|
-
// ... the rest of the config ...
|
|
80
|
+
plugins: [{ ...strip(), apply: 'build' }]
|
|
38
81
|
});
|
|
39
82
|
```
|
|
40
83
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
## Package Size
|
|
84
|
+
### Reliability
|
|
85
|
+
* **Tests:** 2,944 handwritten tests covering critical algorithms and complex edge cases.
|
|
44
86
|
|
|
45
|
-
|
|
87
|
+
* **Coverage:** 90%+ core coverage.
|
|
46
88
|
|
|
47
|
-
|
|
48
|
-
If you use meep in your project, you add as much or as little to your overall bundle size as you want.
|
|
89
|
+
* **Stability:** Exhaustively tested corner cases over a decade of development.
|
|
49
90
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
## Performance
|
|
91
|
+
---
|
|
53
92
|
|
|
54
|
-
|
|
55
|
-
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.
|
|
56
|
-
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.
|
|
57
|
-
The engine is built to handle millions of objects at the same time on even low-spec mobile hardware.
|
|
93
|
+
## Additional Features
|
|
58
94
|
|
|
59
|
-
|
|
95
|
+
| Category | Features |
|
|
96
|
+
|------------------|-----------------------------------------------------------------------------------------------------------------------|
|
|
97
|
+
| Audio | Custom culling and attenuation; supports 1,000s of positional sources with zero overhead |
|
|
98
|
+
| Input | Unified abstraction for Touch, Mouse, and Keyboard. Event-driven and Query-based APIs |
|
|
99
|
+
| Assets | Web-first asset streaming. The engine runs before assets even load |
|
|
100
|
+
| Serialization | Binary serialization system with version upgrading |
|
|
101
|
+
| UI | High-speed, zero-garbage UI system. Optional—can be replaced with React/Vue if desired |
|
|
102
|
+
| Color Management | Scientific-grade color management toolkit, including spectral-integration tools and modern color spaces such as OKLab |
|
|
103
|
+
| NodeGraph | A building block for node-graph systems, such as shader editors and workflow engines |
|
|
104
|
+
| Achievements | State-of-the-art achievement system, using expressions and blackboards |
|
|
105
|
+
| Inverse Kinematics (IK) | Highly optimized FABRIK inverse kinematics solver even the most complex IK use cases |
|
|
60
106
|
|
|
61
107
|
---
|
|
62
|
-
## Input
|
|
63
|
-
* Touch / Mouse / Keyboard device support
|
|
64
|
-
* Unified abstraction of input, offering both query and event-driven APIs
|
|
65
|
-
* Input binding implementation via `InputController` component
|
|
66
|
-
|
|
67
|
-
## Rendering & Lighting
|
|
68
|
-
### Automatic instancing
|
|
69
|
-
This will minimize the number of draw calls and improve performance.
|
|
70
|
-
### Clustered lighting, aka Forward+
|
|
71
|
-
Meep implements clustered lighting technique which allows you to have a pretty much an unlimited number of point lights in your scene. All the other light types are supported as well, but only point lights are clustered for now. Point lights are useful for various effects, like muzzle flashes, grenade explosions, torches, etc.
|
|
72
|
-
### Terrain
|
|
73
|
-
The terrain engine is chunk-based, which means that terrain is split into rectangular pieces internally, and they are built on-the-fly inside a web-worker based on camera position. Terrain is automatically culled based on camera position, so you're only drawing the chunks that are in view. Terrain supports layers just like Unity, but unlike Unity - Meep supports up to 256 layers of terrain instead of 4.
|
|
74
|
-
### Path tracer
|
|
75
|
-
Pure JS implementation of a path tracer, using engine's BVH (See Physics section)
|
|
76
|
-
|
|
77
|
-
## Visual Effects
|
|
78
|
-
### Decals
|
|
79
|
-
Decals in meep are done on the GPU, and as a result you can have a lot of them in your scene. The most I tested in a single scene is 1,000,000 which works quite well. Decals are useful for bullet holes, blood splatter and various scene decorations such as signs and scuff marks.
|
|
80
|
-
### Particles
|
|
81
|
-
Meep's particle engine ("Particular") is optimized for game development needs, this means supporting complex effects and being able to spawn/destroy many particle systems every frame. There are a lot of particle engines out there, but they tend to have costly spawning routines, take up a lot of draw calls and not manage memory well, which leads to pretty poor performance in games. My particle engine supports full particle lighting as well, and soft particles. On top of that - all particles are automatically atlassed in the background and are compiled with just 4 shaders. This means that no matter how many particle effects you have - there will be no shader switching and no texture switching, and there will be no delays associated with shader compilation. Particles are culled, so particle systems that are off-screen are not rendered and simulation for them can be paused to save CPU resources (this is automatic behavior)
|
|
82
|
-
### Trails
|
|
83
|
-
Meep implements a fairly complex trail system, where a trail can be attached to an entity, and it will create a trail behind.
|
|
84
|
-
|
|
85
|
-
## Audio
|
|
86
|
-
### Sound engine
|
|
87
|
-
Meep has a custom sound engine which is culled and has custom attenuation, this allows scenes to have 1000s of positional audio sources without any extra cost in terms of performance
|
|
88
|
-
|
|
89
|
-
## Physics
|
|
90
|
-
### High performance spatial index
|
|
91
|
-
Meep features a BVH (bounding volume hierarchy) implementation optimized for speed and memory usage that provides a wide variety of spatial queries, such as:
|
|
92
|
-
* Ray
|
|
93
|
-
* Box
|
|
94
|
-
* Sphere
|
|
95
|
-
* Planar
|
|
96
|
-
* Frustum
|
|
97
|
-
* Point intersection
|
|
98
|
-
* Point distance
|
|
99
|
-
### Inverse kinematics
|
|
100
|
-
* Meep has 2 very useful IK solvers to fix foot position for characters on uneven terrain or stairs, aligning both the position and orientation of character feet. This works for hands as well if you want and is not limited to bipeds, the system works just as well for, say, spiders.
|
|
101
|
-
* Highly optimized FABRIK inverse kinematics solver for more complex IK use cases
|
|
102
|
-
|
|
103
|
-
## Other
|
|
104
|
-
### Asset streaming
|
|
105
|
-
Meep in general is a web-first engine, all assets are streamed, meaning that the engine is up and running even before any models/texture are loaded, and you're free to decide when to let the player see your level, wait until everything is loaded or drop them in as soon as you can. There is a pre-loader module in case you want to load some assets in bulk before starting the game.
|
|
106
|
-
### AI tools
|
|
107
|
-
including, but not limited to:
|
|
108
|
-
* full-fledged Behavior trees
|
|
109
|
-
* Blackboard (took for recording information useful for AI to read/write relevant world state, very commonly used with Behavior Trees)
|
|
110
|
-
* monte-carlo tree search (same as Google's AlphaGo, useful for decision-making)
|
|
111
|
-
* state optimization (useful for decision-making)
|
|
112
|
-
* grid-based path finding (optimized for 10,000s of queries per second)
|
|
113
|
-
* resource allocation solver (useful for planning, given certain resources such as bullets/grenades/money/health - plan what actions to take to optimize your chances of winning)
|
|
114
|
-
* and a number of other useful tools to complement development of game AI and other intelligent behavior use cases.
|
|
115
|
-
### High-performance serialization
|
|
116
|
-
Extremely compact binary serialization system. You can save/load your scenes from files. This serialization system supports format changes, so as you develop your game - old saves will be supported and the system will automatically upgrade them to the most recent version, so the player doesn't have to lose any data.
|
|
117
|
-
### Achievements
|
|
118
|
-
Achievements work with Blackboard components and are very easy to define. There is an abstraction system that helps connect your achievements to various platforms such as Steam or XBox (you'd have to implement that binding yourself though), by default it comes with a browser backend, storing data in IndexedDB. I also have bindings for Steam and NewGrounds that I can share.
|
|
119
|
-
### UI system
|
|
120
|
-
You're free to use it or not, the engine works just fine without it. The system is written for speed, and it offers a few commonly used tools, such as popup windows, notifications and pages. The UI system is optimized for speed, so it generates no garbage, but again - if you want to use, say React - you can ignore this system or integrate it with the system.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
For more information, please refer to the documentation
|
|
124
108
|
|
|
125
|
-
|
|
126
|
-
Copyright © 2025 Company Named Limited, All Rights Reserved
|
|
109
|
+
## License & Copyright
|
|
110
|
+
Copyright © 2025 Company Named Limited, All Rights Reserved.
|
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.131.
|
|
8
|
+
"version": "2.131.21",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export function compute_typed_array_constructor_from_data_type(dt: BinaryDataType): constructor | Function;
|
|
7
7
|
/**
|
|
8
|
-
* Mapping from {@DataType} to TypedArray constructors
|
|
8
|
+
* Mapping from {@link DataType } to TypedArray constructors
|
|
9
9
|
*/
|
|
10
10
|
export type DataType2TypedArrayConstructorMapping = Function;
|
|
11
11
|
export namespace DataType2TypedArrayConstructorMapping {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeStridedArrayHash.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/computeStridedArrayHash.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,wGAPW,MAAM,UACN,MAAM,UACN,MAAM,4BACM,MAAM,6BAEjB,MAAM,
|
|
1
|
+
{"version":3,"file":"computeStridedArrayHash.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/computeStridedArrayHash.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,wGAPW,MAAM,UACN,MAAM,UACN,MAAM,4BACM,MAAM,6BAEjB,MAAM,CAyBjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeStridedIntegerArrayHash.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/computeStridedIntegerArrayHash.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,sDANW,MAAM,EAAE,GAAC,WAAW,GAAC,WAAW,GAAC,UAAU,UAC3C,MAAM,UACN,MAAM,UACN,MAAM,GACL,MAAM,
|
|
1
|
+
{"version":3,"file":"computeStridedIntegerArrayHash.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/computeStridedIntegerArrayHash.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,sDANW,MAAM,EAAE,GAAC,WAAW,GAAC,WAAW,GAAC,UAAU,UAC3C,MAAM,UACN,MAAM,UACN,MAAM,GACL,MAAM,CAqBjB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { assert } from "../../assert.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Second radiation constant
|
|
4
|
+
* Second radiation constant.
|
|
5
|
+
* Value is meters Kelvin (m*K).
|
|
5
6
|
*
|
|
6
7
|
* `c2 = (h*c) / (kb)`
|
|
7
|
-
*
|
|
8
|
-
* Value is meters Kelvin (m*K).
|
|
8
|
+
* @type {number}
|
|
9
9
|
*/
|
|
10
10
|
const PLANCK_C2 = 1.438776877e-2;
|
|
11
11
|
|
|
@@ -18,7 +18,7 @@ const PLANCK_C2 = 1.438776877e-2;
|
|
|
18
18
|
export function planckian_radiance(lambda_m, T) {
|
|
19
19
|
assert.isNumber(lambda_m, 'lambda_m');
|
|
20
20
|
assert.notNaN(lambda_m, 'lambda_m');
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
assert.isNumber(T, 'T');
|
|
23
23
|
assert.notNaN(T, 'T');
|
|
24
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AABB2.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/aabb/A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,sBAFY,MAAM,CAYjB;IAED;;;;;OAKG;IACH,iBAJW,MAAM,KACN,MAAM,GACJ,OAAO,CAInB;IAED;;;OAGG;IACH,mBAFW,KAAK,QAIf;IAED;;;OAGG;IACH,mBAFW,OAAO,WAOjB;IAED;;;;OAIG;IACH,QAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,QAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,sBAEC;IAED;;;OAGG;IACH,sBAEC;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,oBAEC;IAED;;;;OAIG;IACH,aAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,qBAEC;IAED;;;;;;;;;OASG;IACH,qDAJa,IAAI,CAqBhB;IAED;;;;OAIG;IACH,eAHW,MAAM,KACN,MAAM,QAOhB;IAED;;;;;OAKG;IACH,aAJW,MAAM,UACN,MAAM,GACJ,IAAI,CAOhB;IAED;;;OAGG;IACH,SAFa,KAAK,CAIjB;IAED;;;;OAIG;IACH,YAHW,KAAK,GACH,KAAK,CAIjB;IAED;;;;OAIG;IACH,cAHW,KAAK,GACH,OAAO,CAOnB;IAED;;;OAGG;IACH,QAFY,MAAM,CA4BjB;IAED;;;;;;OAMG;IACH,UALW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAQhB;IAED;;;;;;OAMG;IACH,uBALW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAsBhB;IAED;;OAEG;IACH,oCAEC;IAED,mBAEC;IAED;;;;;MAOC;IAED,0BAEC;IAED;;;;OAIG;IACH,iBAJW,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,GACJ,MAAM,EAAE,GAAC,YAAY,CAUjC;IAkCL;;;OAGG;IACH,kBAFU,OAAO,CAEM;IA9qBnB,sDAQC;CAioBJ;;;
|
|
1
|
+
{"version":3,"file":"AABB2.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/aabb/AABB2.js"],"names":[],"mappings":";AAaA;;;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
|
|
@@ -555,7 +555,7 @@ class AABB2 {
|
|
|
555
555
|
}
|
|
556
556
|
|
|
557
557
|
/**
|
|
558
|
-
* Relative displacement of the AABB by given vector described by {@
|
|
558
|
+
* Relative displacement of the AABB by given vector described by {@link deltaX} and {@link deltaY}
|
|
559
559
|
* @param {number} deltaX displacement in X
|
|
560
560
|
* @param {number} deltaY displacement in Y
|
|
561
561
|
* @returns {this}
|
|
@@ -749,6 +749,9 @@ function computeLineBetweenTwoBoxes(b0, b1, p0, p1) {
|
|
|
749
749
|
*/
|
|
750
750
|
AABB2.prototype.isAABB2 = true;
|
|
751
751
|
|
|
752
|
+
/**
|
|
753
|
+
* Alias
|
|
754
|
+
*/
|
|
752
755
|
AABB2.computeLineBetweenTwoBoxes = computeLineBetweenTwoBoxes;
|
|
753
756
|
|
|
754
757
|
/**
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
|
-
*
|
|
3
|
+
* returns the Euler-angles of the rotation matrix \c *this using the convention defined by the triplet (`a0`,`a1`,`a2`)
|
|
4
4
|
*
|
|
5
|
-
* Each of the three parameters
|
|
5
|
+
* Each of the three parameters `a0`, `a1`, `a2` represents the respective rotation axis as an integer in {0,1,2}.
|
|
6
6
|
* For instance, in:
|
|
7
|
-
*
|
|
7
|
+
* ```
|
|
8
|
+
* Vector3f ea = mat.eulerAngles(2, 0, 2);
|
|
9
|
+
* ```
|
|
8
10
|
* "2" represents the z axis and "0" the x axis, etc. The returned angles are such that
|
|
9
11
|
* we have the following equality:
|
|
10
|
-
*
|
|
12
|
+
* ```
|
|
11
13
|
* mat == AngleAxisf(ea[0], Vector3f::UnitZ())
|
|
12
14
|
* * AngleAxisf(ea[1], Vector3f::UnitX())
|
|
13
|
-
* * AngleAxisf(ea[2], Vector3f::UnitZ());
|
|
15
|
+
* * AngleAxisf(ea[2], Vector3f::UnitZ());
|
|
16
|
+
* ```
|
|
14
17
|
* This corresponds to the right-multiply conventions (with right hand side frames).
|
|
15
18
|
*
|
|
16
19
|
* The returned angles are in the ranges [0:pi]x[-pi:pi]x[-pi:pi].
|
|
17
20
|
|
|
18
21
|
* NOTE: ported from Eigen C++ library
|
|
22
|
+
*
|
|
19
23
|
* @see https://gitlab.com/libeigen/eigen/-/blob/master/Eigen/src/Geometry/EulerAngles.h
|
|
20
24
|
* @see https://stackoverflow.com/questions/11514063/extract-yaw-pitch-and-roll-from-a-rotationmatrix
|
|
25
|
+
*
|
|
21
26
|
* @param {number[]} output
|
|
22
27
|
* @param {number[]|Float32Array|mat4} m4 source matrix to extract rotation from
|
|
23
28
|
* @param {number} a0 axis index (0 = X, 1 = Y, 2 = Z)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eulerAnglesFromMatrix.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/mat4/eulerAnglesFromMatrix.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eulerAnglesFromMatrix.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/mat4/eulerAnglesFromMatrix.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,8CANW,MAAM,EAAE,MACR,MAAM,EAAE,GAAC,YAAY,OAAK,MAC1B,MAAM,MACN,MAAM,MACN,MAAM,QA2EhB"}
|
|
@@ -7,6 +7,7 @@ import { v2_length } from "../../vec2/v2_length.js";
|
|
|
7
7
|
* @param {number} row_index
|
|
8
8
|
* @param {number} column_index
|
|
9
9
|
* @return {number}
|
|
10
|
+
* @ignore
|
|
10
11
|
*/
|
|
11
12
|
function coeff(mat4, row_index, column_index) {
|
|
12
13
|
return mat4[row_index + column_index * 4];
|
|
@@ -18,24 +19,29 @@ const atan2 = Math.atan2;
|
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
*
|
|
21
|
-
*
|
|
22
|
+
* returns the Euler-angles of the rotation matrix \c *this using the convention defined by the triplet (`a0`,`a1`,`a2`)
|
|
22
23
|
*
|
|
23
|
-
* Each of the three parameters
|
|
24
|
+
* Each of the three parameters `a0`, `a1`, `a2` represents the respective rotation axis as an integer in {0,1,2}.
|
|
24
25
|
* For instance, in:
|
|
25
|
-
*
|
|
26
|
+
* ```
|
|
27
|
+
* Vector3f ea = mat.eulerAngles(2, 0, 2);
|
|
28
|
+
* ```
|
|
26
29
|
* "2" represents the z axis and "0" the x axis, etc. The returned angles are such that
|
|
27
30
|
* we have the following equality:
|
|
28
|
-
*
|
|
31
|
+
* ```
|
|
29
32
|
* mat == AngleAxisf(ea[0], Vector3f::UnitZ())
|
|
30
33
|
* * AngleAxisf(ea[1], Vector3f::UnitX())
|
|
31
|
-
* * AngleAxisf(ea[2], Vector3f::UnitZ());
|
|
34
|
+
* * AngleAxisf(ea[2], Vector3f::UnitZ());
|
|
35
|
+
* ```
|
|
32
36
|
* This corresponds to the right-multiply conventions (with right hand side frames).
|
|
33
37
|
*
|
|
34
38
|
* The returned angles are in the ranges [0:pi]x[-pi:pi]x[-pi:pi].
|
|
35
39
|
|
|
36
40
|
* NOTE: ported from Eigen C++ library
|
|
41
|
+
*
|
|
37
42
|
* @see https://gitlab.com/libeigen/eigen/-/blob/master/Eigen/src/Geometry/EulerAngles.h
|
|
38
43
|
* @see https://stackoverflow.com/questions/11514063/extract-yaw-pitch-and-roll-from-a-rotationmatrix
|
|
44
|
+
*
|
|
39
45
|
* @param {number[]} output
|
|
40
46
|
* @param {number[]|Float32Array|mat4} m4 source matrix to extract rotation from
|
|
41
47
|
* @param {number} a0 axis index (0 = X, 1 = Y, 2 = Z)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @param {number} a
|
|
9
9
|
* @param {number} b
|
|
10
10
|
* @param {number} value
|
|
11
|
-
* @returns {number} fraction of where the {@link value
|
|
11
|
+
* @returns {number} fraction of where the {@link value} lies between {@link a} and {@link b}
|
|
12
12
|
*/
|
|
13
13
|
export function inverseLerp(a: number, b: number, value: number): number;
|
|
14
14
|
//# sourceMappingURL=inverseLerp.d.ts.map
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @param {number} a
|
|
9
9
|
* @param {number} b
|
|
10
10
|
* @param {number} value
|
|
11
|
-
* @returns {number} fraction of where the {@link value
|
|
11
|
+
* @returns {number} fraction of where the {@link value} lies between {@link a} and {@link b}
|
|
12
12
|
*/
|
|
13
13
|
export function inverseLerp(a, b, value) {
|
|
14
14
|
const range = b - a;
|
|
@@ -18,7 +18,7 @@ export function inverseLerp(a, b, value) {
|
|
|
18
18
|
|
|
19
19
|
// avoid division by zero error
|
|
20
20
|
|
|
21
|
-
// this is arbitrary output, as actual answer is undefined
|
|
21
|
+
// this is arbitrary output, as the actual answer is undefined
|
|
22
22
|
|
|
23
23
|
return 0;
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../../../src/core/math/sign.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../../../src/core/math/sign.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAHW,MAAM,GACJ,MAAM,CAIlB"}
|
package/src/core/math/sign.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Positive number produce 1, negative -1 and 0 produces 0.
|
|
3
|
+
*
|
|
4
|
+
* Standard implementation in graphics languages such as HLSL and GLSL
|
|
2
5
|
*
|
|
3
6
|
* @param {number} v
|
|
4
|
-
* @returns {number} +1 if v>0
|
|
7
|
+
* @returns {number} +1 if `v > 0`, 0 if `v == 0`, -1 if `v < 0`
|
|
5
8
|
*/
|
|
6
9
|
export function sign(v) {
|
|
7
10
|
return v > 0 ? 1 : (v < 0 ? -1 : 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeImageDecoder.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/asset/loaders/image/codec/NativeImageDecoder.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NativeImageDecoder.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/asset/loaders/image/codec/NativeImageDecoder.js"],"names":[],"mappings":"AA4DA;;;GAGG;AACH;WAF0B,MAAM;YAAS,MAAM;UAAQ,UAAU;cAAY,MAAM;cAAW,MAAM;;;IAGhG;;;;OAIG;IACH,iBAHW,UAAU,GACT;QAAC,IAAI,EAAE,UAAU,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,CAgBhG;IAED;;;;;;OAiBC;CACJ;sBAxGqB,YAAY"}
|
|
@@ -4,6 +4,7 @@ import { Codec } from "./Codec.js";
|
|
|
4
4
|
*
|
|
5
5
|
* @param {Image|ImageBitmap|HTMLImageElement} img
|
|
6
6
|
* @returns {Uint8Array}
|
|
7
|
+
* @ignore
|
|
7
8
|
*/
|
|
8
9
|
function decode(img) {
|
|
9
10
|
const width = img.width;
|
|
@@ -27,6 +28,7 @@ function decode(img) {
|
|
|
27
28
|
/**
|
|
28
29
|
*
|
|
29
30
|
* @param {HTMLImageElement} image
|
|
31
|
+
* @ignore
|
|
30
32
|
*/
|
|
31
33
|
function make_decoded_data(image) {
|
|
32
34
|
|
|
@@ -49,6 +51,7 @@ function make_decoded_data(image) {
|
|
|
49
51
|
* Don't forget to call `URL.revokeObjectURL(url)` when done
|
|
50
52
|
* @param {Uint8Array} data
|
|
51
53
|
* @return {string}
|
|
54
|
+
* @ignore
|
|
52
55
|
*/
|
|
53
56
|
function data_to_url(data){
|
|
54
57
|
const blob = new Blob([data]);
|
|
@@ -163,9 +163,12 @@ export class PNGReader {
|
|
|
163
163
|
* @param {number} output_offset
|
|
164
164
|
* @param {number} output_offset_previous where does result of previous scanline begin in the output? Needed for various filters such as `Up`
|
|
165
165
|
* @param {number} length
|
|
166
|
+
*
|
|
167
|
+
* @see https://www.w3.org/TR/PNG-Filters.html
|
|
166
168
|
*/
|
|
167
169
|
unFilter(filter_type: number, data: Uint8Array, scanline_address: number, output: Uint8Array, bytes_per_pixel: number, output_offset: number, output_offset_previous: number, length: number): void;
|
|
168
170
|
/**
|
|
171
|
+
* With the None filter, the scanline is transmitted unmodified; it is only necessary to insert a filter type byte before the data.
|
|
169
172
|
*
|
|
170
173
|
* @param {Uint8Array} data
|
|
171
174
|
* @param {number} scanline_address
|
|
@@ -174,12 +177,14 @@ export class PNGReader {
|
|
|
174
177
|
* @param {number} output_offset
|
|
175
178
|
* @param {number} output_offset_previous
|
|
176
179
|
* @param {number} length
|
|
180
|
+
*
|
|
181
|
+
* @see https://www.w3.org/TR/PNG-Filters.html
|
|
177
182
|
*/
|
|
178
183
|
unFilterNone(data: Uint8Array, scanline_address: number, output: Uint8Array, bytes_per_pixel: number, output_offset: number, output_offset_previous: number, length: number): void;
|
|
179
184
|
/**
|
|
180
|
-
* The Sub
|
|
185
|
+
* The `Sub` filter transmits the difference between each byte and the value
|
|
181
186
|
* of the corresponding byte of the prior pixel.
|
|
182
|
-
* Sub(x) = Raw(x) + Raw(x - bpp)
|
|
187
|
+
* `Sub(x) = Raw(x) + Raw(x - bpp)`
|
|
183
188
|
*
|
|
184
189
|
* @param {Uint8Array} scanline raw data
|
|
185
190
|
* @param {number} scanline_offset
|
|
@@ -188,13 +193,14 @@ export class PNGReader {
|
|
|
188
193
|
* @param {number} offset
|
|
189
194
|
* @param {number} output_offset_previous
|
|
190
195
|
* @param {number} length
|
|
196
|
+
* @see https://www.w3.org/TR/PNG-Filters.html
|
|
191
197
|
*/
|
|
192
198
|
unFilterSub(scanline: Uint8Array, scanline_offset: number, pixels: Uint8Array, bpp: number, offset: number, output_offset_previous: number, length: number): void;
|
|
193
199
|
/**
|
|
194
|
-
* The Up
|
|
200
|
+
* The `Up` filter is just like the Sub() filter except that the pixel
|
|
195
201
|
* immediately above the current pixel, rather than just to its left, is used
|
|
196
202
|
* as the predictor.
|
|
197
|
-
* Up(x) = Raw(x) + Prior(x)
|
|
203
|
+
* `Up(x) = Raw(x) + Prior(x)`
|
|
198
204
|
*
|
|
199
205
|
* @param {Uint8Array} scanline raw data
|
|
200
206
|
* @param {number} scanline_offset
|
|
@@ -203,12 +209,14 @@ export class PNGReader {
|
|
|
203
209
|
* @param {number} offset
|
|
204
210
|
* @param {number} output_offset_previous
|
|
205
211
|
* @param {number} length
|
|
212
|
+
* @see https://www.w3.org/TR/PNG-Filters.html
|
|
206
213
|
*/
|
|
207
214
|
unFilterUp(scanline: Uint8Array, scanline_offset: number, pixels: Uint8Array, bpp: number, offset: number, output_offset_previous: number, length: number): void;
|
|
208
215
|
/**
|
|
209
|
-
* The Average
|
|
216
|
+
* The `Average` filter uses the average of the two neighboring pixels (left
|
|
210
217
|
* and above) to predict the value of a pixel.
|
|
211
|
-
*
|
|
218
|
+
*
|
|
219
|
+
* `Average(x) = Raw(x) + floor((Raw(x-bpp)+Prior(x))/2)`
|
|
212
220
|
*
|
|
213
221
|
* @param {Uint8Array} scanline raw data
|
|
214
222
|
* @param {number} scanline_offset
|
|
@@ -217,29 +225,14 @@ export class PNGReader {
|
|
|
217
225
|
* @param {number} offset
|
|
218
226
|
* @param {number} output_offset_previous
|
|
219
227
|
* @param {number} length
|
|
228
|
+
*
|
|
229
|
+
* @see https://www.w3.org/TR/PNG-Filters.html
|
|
220
230
|
*/
|
|
221
231
|
unFilterAverage(scanline: Uint8Array, scanline_offset: number, pixels: Uint8Array, bpp: number, offset: number, output_offset_previous: number, length: number): void;
|
|
222
232
|
/**
|
|
223
|
-
* The Paeth
|
|
224
|
-
* neighboring pixels (left, above, upper left), then chooses as predictor
|
|
225
|
-
* the neighboring pixel closest to the computed value.
|
|
226
|
-
* This technique is due to Alan W. Paeth.
|
|
233
|
+
* The `Paeth` filter computes a simple linear function of the three neighboring pixels (left, above, upper left), then chooses as predictor the neighboring pixel closest to the computed value.
|
|
227
234
|
*
|
|
228
|
-
*
|
|
229
|
-
* PaethPredictor(Raw(x-bpp), Prior(x), Prior(x-bpp))
|
|
230
|
-
* function PaethPredictor (a, b, c)
|
|
231
|
-
* begin
|
|
232
|
-
* ; a = left, b = above, c = upper left
|
|
233
|
-
* p := a + b - c ; initial estimate
|
|
234
|
-
* pa := abs(p - a) ; distances to a, b, c
|
|
235
|
-
* pb := abs(p - b)
|
|
236
|
-
* pc := abs(p - c)
|
|
237
|
-
* ; return nearest of a,b,c,
|
|
238
|
-
* ; breaking ties in order a,b,c.
|
|
239
|
-
* if pa <= pb AND pa <= pc then return a
|
|
240
|
-
* else if pb <= pc then return b
|
|
241
|
-
* else return c
|
|
242
|
-
* end
|
|
235
|
+
* This technique is due to Alan W. Paeth.
|
|
243
236
|
*
|
|
244
237
|
* @param {Uint8Array} scanline raw data
|
|
245
238
|
* @param {number} scanline_offset
|
|
@@ -248,6 +241,8 @@ export class PNGReader {
|
|
|
248
241
|
* @param {number} offset
|
|
249
242
|
* @param {number} output_offset_previous
|
|
250
243
|
* @param {number} length
|
|
244
|
+
*
|
|
245
|
+
* @see https://www.w3.org/TR/PNG-Filters.html
|
|
251
246
|
*/
|
|
252
247
|
unFilterPaeth(scanline: Uint8Array, scanline_offset: number, pixels: Uint8Array, bpp: number, offset: number, output_offset_previous: number, length: number): void;
|
|
253
248
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PNGReader.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/asset/loaders/image/png/PNGReader.js"],"names":[],"mappings":"AAyDA;;;;GAIG;AACH,iCAHW,WAAW,QAkDrB;;IApDD;;;;OAIG;IACH,mBAHW,WAAW,EAkDrB;IA9CG;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,OAFU,UAAU,CAEc;IAElC;;;OAGG;IACH,KAFU,GAAG,CAEO;IAEpB;;;OAGG;IACH,YAFU,UAAU,EAAE,CAEF;IAEpB;;;OAGG;IACH,QAFU,YAAY,CAEU;IAOhC;;;OAGG;IACH,aAFU,OAAO,CAEO;IAExB;;;OAGG;IACH,QAFU,UAAU,CAEW;IAGnC;;;;OAIG;IACH,kBAHW,MAAM,GACL,UAAU,CAarB;IAED;;OAEG;IACH,qBAkBC;IAED;;;;;;;;;OASG;IACH,eAFa,MAAM,CA4ElB;IAGD;;;OAGG;IACH,kBAFW,UAAU,QAOpB;IAED;;;OAGG;IACH,kBAFW,UAAU,QAapB;IAED;;;;OAIG;IACH,kBAFW,UAAU;;;;;MAuCpB;IAGD;;;;OAIG;IACH,kBAFW,UAAU;;;MAiCpB;IAED;;;OAGG;IACH,kBAFW,UAAU,QASpB;IACD;;;;OAIG;IACH,kBAFW,UAAU,QAwBpB;IAED;;;;;;;;;;;OAWG;IACH,6BAWC;IAED;;;;OAIG;IACH,kBAFW,UAAU,QAIpB;IAED;;OAEG;IACH,6BAGC;IAED;;;OAGG;IACH,kBAFW,UAAU,QAIpB;IAED;;OAEG;IACH,mBACC;IAED;;OAEG;IACH,qBAyBC;IAID;;OAEG;IACH,oBAFW,UAAU,cA+CpB;IAGD;;;OAGG;IACH,qBAFW,UAAU,4BA8GpB;IAID
|
|
1
|
+
{"version":3,"file":"PNGReader.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/asset/loaders/image/png/PNGReader.js"],"names":[],"mappings":"AAyDA;;;;GAIG;AACH,iCAHW,WAAW,QAkDrB;;IApDD;;;;OAIG;IACH,mBAHW,WAAW,EAkDrB;IA9CG;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,OAFU,UAAU,CAEc;IAElC;;;OAGG;IACH,KAFU,GAAG,CAEO;IAEpB;;;OAGG;IACH,YAFU,UAAU,EAAE,CAEF;IAEpB;;;OAGG;IACH,QAFU,YAAY,CAEU;IAOhC;;;OAGG;IACH,aAFU,OAAO,CAEO;IAExB;;;OAGG;IACH,QAFU,UAAU,CAEW;IAGnC;;;;OAIG;IACH,kBAHW,MAAM,GACL,UAAU,CA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UAAU,mBACV,MAAM,UACN,UAAU,OACV,MAAM,UACN,MAAM,0BACN,MAAM,UACN,MAAM,QA8DhB;IAED;;;OAGG;IACH,SAFa,GAAG,CAqBf;;oBAtgCmB,UAAU;6BAND,4CAA4C"}
|
|
@@ -654,6 +654,8 @@ PNGReader.prototype.interlaceAdam7 = function (data) {
|
|
|
654
654
|
* @param {number} output_offset
|
|
655
655
|
* @param {number} output_offset_previous where does result of previous scanline begin in the output? Needed for various filters such as `Up`
|
|
656
656
|
* @param {number} length
|
|
657
|
+
*
|
|
658
|
+
* @see https://www.w3.org/TR/PNG-Filters.html
|
|
657
659
|
*/
|
|
658
660
|
PNGReader.prototype.unFilter = function (
|
|
659
661
|
filter_type,
|
|
@@ -733,6 +735,7 @@ PNGReader.prototype.unFilter = function (
|
|
|
733
735
|
}
|
|
734
736
|
|
|
735
737
|
/**
|
|
738
|
+
* With the None filter, the scanline is transmitted unmodified; it is only necessary to insert a filter type byte before the data.
|
|
736
739
|
*
|
|
737
740
|
* @param {Uint8Array} data
|
|
738
741
|
* @param {number} scanline_address
|
|
@@ -741,6 +744,8 @@ PNGReader.prototype.unFilter = function (
|
|
|
741
744
|
* @param {number} output_offset
|
|
742
745
|
* @param {number} output_offset_previous
|
|
743
746
|
* @param {number} length
|
|
747
|
+
*
|
|
748
|
+
* @see https://www.w3.org/TR/PNG-Filters.html
|
|
744
749
|
*/
|
|
745
750
|
PNGReader.prototype.unFilterNone = function (
|
|
746
751
|
data,
|
|
@@ -790,9 +795,9 @@ PNGReader.prototype.unFilterNone = function (
|
|
|
790
795
|
};
|
|
791
796
|
|
|
792
797
|
/**
|
|
793
|
-
* The Sub
|
|
798
|
+
* The `Sub` filter transmits the difference between each byte and the value
|
|
794
799
|
* of the corresponding byte of the prior pixel.
|
|
795
|
-
* Sub(x) = Raw(x) + Raw(x - bpp)
|
|
800
|
+
* `Sub(x) = Raw(x) + Raw(x - bpp)`
|
|
796
801
|
*
|
|
797
802
|
* @param {Uint8Array} scanline raw data
|
|
798
803
|
* @param {number} scanline_offset
|
|
@@ -801,6 +806,7 @@ PNGReader.prototype.unFilterNone = function (
|
|
|
801
806
|
* @param {number} offset
|
|
802
807
|
* @param {number} output_offset_previous
|
|
803
808
|
* @param {number} length
|
|
809
|
+
* @see https://www.w3.org/TR/PNG-Filters.html
|
|
804
810
|
*/
|
|
805
811
|
PNGReader.prototype.unFilterSub = function (
|
|
806
812
|
scanline,
|
|
@@ -827,10 +833,10 @@ PNGReader.prototype.unFilterSub = function (
|
|
|
827
833
|
};
|
|
828
834
|
|
|
829
835
|
/**
|
|
830
|
-
* The Up
|
|
836
|
+
* The `Up` filter is just like the Sub() filter except that the pixel
|
|
831
837
|
* immediately above the current pixel, rather than just to its left, is used
|
|
832
838
|
* as the predictor.
|
|
833
|
-
* Up(x) = Raw(x) + Prior(x)
|
|
839
|
+
* `Up(x) = Raw(x) + Prior(x)`
|
|
834
840
|
*
|
|
835
841
|
* @param {Uint8Array} scanline raw data
|
|
836
842
|
* @param {number} scanline_offset
|
|
@@ -839,6 +845,7 @@ PNGReader.prototype.unFilterSub = function (
|
|
|
839
845
|
* @param {number} offset
|
|
840
846
|
* @param {number} output_offset_previous
|
|
841
847
|
* @param {number} length
|
|
848
|
+
* @see https://www.w3.org/TR/PNG-Filters.html
|
|
842
849
|
*/
|
|
843
850
|
PNGReader.prototype.unFilterUp = function (
|
|
844
851
|
scanline,
|
|
@@ -875,9 +882,10 @@ PNGReader.prototype.unFilterUp = function (
|
|
|
875
882
|
};
|
|
876
883
|
|
|
877
884
|
/**
|
|
878
|
-
* The Average
|
|
885
|
+
* The `Average` filter uses the average of the two neighboring pixels (left
|
|
879
886
|
* and above) to predict the value of a pixel.
|
|
880
|
-
*
|
|
887
|
+
*
|
|
888
|
+
* `Average(x) = Raw(x) + floor((Raw(x-bpp)+Prior(x))/2)`
|
|
881
889
|
*
|
|
882
890
|
* @param {Uint8Array} scanline raw data
|
|
883
891
|
* @param {number} scanline_offset
|
|
@@ -886,6 +894,8 @@ PNGReader.prototype.unFilterUp = function (
|
|
|
886
894
|
* @param {number} offset
|
|
887
895
|
* @param {number} output_offset_previous
|
|
888
896
|
* @param {number} length
|
|
897
|
+
*
|
|
898
|
+
* @see https://www.w3.org/TR/PNG-Filters.html
|
|
889
899
|
*/
|
|
890
900
|
PNGReader.prototype.unFilterAverage = function (
|
|
891
901
|
scanline,
|
|
@@ -932,26 +942,9 @@ PNGReader.prototype.unFilterAverage = function (
|
|
|
932
942
|
};
|
|
933
943
|
|
|
934
944
|
/**
|
|
935
|
-
* The Paeth
|
|
936
|
-
* neighboring pixels (left, above, upper left), then chooses as predictor
|
|
937
|
-
* the neighboring pixel closest to the computed value.
|
|
938
|
-
* This technique is due to Alan W. Paeth.
|
|
945
|
+
* The `Paeth` filter computes a simple linear function of the three neighboring pixels (left, above, upper left), then chooses as predictor the neighboring pixel closest to the computed value.
|
|
939
946
|
*
|
|
940
|
-
*
|
|
941
|
-
* PaethPredictor(Raw(x-bpp), Prior(x), Prior(x-bpp))
|
|
942
|
-
* function PaethPredictor (a, b, c)
|
|
943
|
-
* begin
|
|
944
|
-
* ; a = left, b = above, c = upper left
|
|
945
|
-
* p := a + b - c ; initial estimate
|
|
946
|
-
* pa := abs(p - a) ; distances to a, b, c
|
|
947
|
-
* pb := abs(p - b)
|
|
948
|
-
* pc := abs(p - c)
|
|
949
|
-
* ; return nearest of a,b,c,
|
|
950
|
-
* ; breaking ties in order a,b,c.
|
|
951
|
-
* if pa <= pb AND pa <= pc then return a
|
|
952
|
-
* else if pb <= pc then return b
|
|
953
|
-
* else return c
|
|
954
|
-
* end
|
|
947
|
+
* This technique is due to Alan W. Paeth.
|
|
955
948
|
*
|
|
956
949
|
* @param {Uint8Array} scanline raw data
|
|
957
950
|
* @param {number} scanline_offset
|
|
@@ -960,6 +953,8 @@ PNGReader.prototype.unFilterAverage = function (
|
|
|
960
953
|
* @param {number} offset
|
|
961
954
|
* @param {number} output_offset_previous
|
|
962
955
|
* @param {number} length
|
|
956
|
+
*
|
|
957
|
+
* @see https://www.w3.org/TR/PNG-Filters.html
|
|
963
958
|
*/
|
|
964
959
|
PNGReader.prototype.unFilterPaeth = function (
|
|
965
960
|
scanline,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GUIElementSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gui/GUIElementSystem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GUIElementSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gui/GUIElementSystem.js"],"names":[],"mappings":"AAiCA,gFAAiF;;AAEjF;IAyBI;;;;;OAKG;IACH,2BAJW,IAAI,kBAqCd;IA9DD,gBAaG;IAEH,oCAA4B;IAE5B;;;OAGG;IACH,YAAY;IA2BR,iCAAkC;IAGlC;;OAEG;IACH,8BAA0C;IAE1C;;;OAGG;IACH,eAAoB;IAIxB,gCAGC;IAED,iCAEC;IAED;;;;OAIG;IACH,2BAHW,UAAU,UACV,MAAM,QA6DhB;IAED;;;;OAIG;IACH,2BAHW,UAAU,UACV,MAAM,QAoBhB;IAED;;;;OAIG;IACH,gBAHW,UAAU,qBAiDpB;IAED;;;;OAIG;IACH,kBAHW,UAAU,qBAiBpB;CACJ;uBAhRsB,cAAc;sBAFf,qCAAqC;uBAGhB,iBAAiB;iBAF3C,uBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewportPositionSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/gui/position/ViewportPositionSystem.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ViewportPositionSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/gui/position/ViewportPositionSystem.js"],"names":[],"mappings":";AAuBA;IACI,+BAoBC;IAjBG,8DAAkD;IAElD,kEAEC;IAED,kBAAgC;IAEhC,yCAME;IAEF,SAAc;IAGlB,2CAEC;IAED,4CAEC;IAED;;;OAGG;IACH,sBAHW,UAAU,MACV,gBAAgB,QAkE1B;IAED;;;;;OAKG;IACH,SAJW,gBAAgB,MAChB,UAAU,qBA8BpB;IAED;;;;;OAKG;IACH,WAJW,gBAAgB,MAChB,UAAU,qBAmBpB;IA4EL;;;OAGG;IACH,mCAFU,OAAO,CAEwC;CA7ExD;uBAlLsB,iBAAiB;uBACjB,kBAAkB;6BAEZ,uBAAuB;4CAJR,uDAAuD;8BAJrE,iDAAiD"}
|