@woosh/meep-engine 2.75.3 → 2.75.4
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/package.json
CHANGED
|
@@ -3,6 +3,8 @@ import {AttributeSpec} from "./AttributeSpec";
|
|
|
3
3
|
export class VertexDataSpec {
|
|
4
4
|
readonly attributes: AttributeSpec[]
|
|
5
5
|
|
|
6
|
+
static from(...attributes: AttributeSpec[]): VertexDataSpec
|
|
7
|
+
|
|
6
8
|
getAttributeByName(name: string): AttributeSpec | undefined
|
|
7
9
|
|
|
8
10
|
add(attribute: AttributeSpec): this
|
|
@@ -12,4 +14,12 @@ export class VertexDataSpec {
|
|
|
12
14
|
equals(other: VertexDataSpec): boolean
|
|
13
15
|
|
|
14
16
|
hash(): number
|
|
17
|
+
|
|
18
|
+
toJSON(): any
|
|
19
|
+
|
|
20
|
+
fromJSON(json: any): void
|
|
21
|
+
|
|
22
|
+
getByteSize(): number
|
|
23
|
+
|
|
24
|
+
readonly isVertexDataSpec: true
|
|
15
25
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
2
2
|
import { computeHashArray } from "../../../core/collection/array/computeHashArray.js";
|
|
3
3
|
import { isArrayEqual } from "../../../core/collection/array/isArrayEqual.js";
|
|
4
|
+
import { invokeObjectHash } from "../../../core/model/object/invokeObjectHash.js";
|
|
4
5
|
import { AttributeSpec } from "./AttributeSpec.js";
|
|
5
|
-
import { assert } from "../../../core/assert.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @readonly
|
|
@@ -15,20 +15,19 @@ const DEFAULT_HASH = 1234567;
|
|
|
15
15
|
* @example "uv","position" and "normal" attributes of geometry vertices
|
|
16
16
|
*/
|
|
17
17
|
export class VertexDataSpec {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {AttributeSpec[]}
|
|
22
|
+
*/
|
|
23
|
+
attributes = [];
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Cached hash for speed
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
#hash = DEFAULT_HASH;
|
|
32
31
|
|
|
33
32
|
/**
|
|
34
33
|
*
|
|
@@ -112,7 +111,7 @@ export class VertexDataSpec {
|
|
|
112
111
|
this.attributes.push(attribute);
|
|
113
112
|
|
|
114
113
|
// reset hash
|
|
115
|
-
this
|
|
114
|
+
this.#hash = DEFAULT_HASH;
|
|
116
115
|
|
|
117
116
|
//for chaining, return self
|
|
118
117
|
return this;
|
|
@@ -138,7 +137,7 @@ export class VertexDataSpec {
|
|
|
138
137
|
this.attributes.splice(0, this.attributes.length);
|
|
139
138
|
|
|
140
139
|
// reset hash to trigger hash update
|
|
141
|
-
this
|
|
140
|
+
this.#hash = DEFAULT_HASH;
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
/**
|
|
@@ -159,11 +158,11 @@ export class VertexDataSpec {
|
|
|
159
158
|
}
|
|
160
159
|
|
|
161
160
|
hash() {
|
|
162
|
-
if (this
|
|
163
|
-
this
|
|
161
|
+
if (this.#hash === DEFAULT_HASH) {
|
|
162
|
+
this.#hash = this.computeHash();
|
|
164
163
|
}
|
|
165
164
|
|
|
166
|
-
return this
|
|
165
|
+
return this.#hash;
|
|
167
166
|
}
|
|
168
167
|
|
|
169
168
|
toJSON() {
|
|
@@ -159,7 +159,7 @@ export class VirtualTexturePage {
|
|
|
159
159
|
texture.minFilter = NearestFilter;
|
|
160
160
|
texture.magFilter = LinearFilter;
|
|
161
161
|
// texture.magFilter = NearestFilter;
|
|
162
|
-
texture.anisotropy = this.#tile_margin;
|
|
162
|
+
texture.anisotropy = this.#tile_margin*2;
|
|
163
163
|
|
|
164
164
|
this.#tile_copy_texture.wrapT = ClampToEdgeWrapping;
|
|
165
165
|
this.#tile_copy_texture.wrapS = ClampToEdgeWrapping;
|