@woosh/meep-engine 2.88.2 → 2.88.3
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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridCellActionPlaceTags.d.ts","sourceRoot":"","sources":["../../../../../src/generation/placement/action/GridCellActionPlaceTags.js"],"names":[],"mappings":"AAKA;IAsCI;;;;;OAKG;IACH,mBAJW,MAAM,SACN,MAAM,GACJ,uBAAuB,CAgBnC;IAxDD;;;OAGG;IACH,kBAFmB,MAAM,QAAE,MAAM,KAAG,MAAM,CAEpB;IAEtB;;;OAGG;IACH,MAFU,SAAS,CAEc;IAEjC;;;OAGG;IACH,SAFU,MAAM,CAED;IAEf;;;;OAIG;IACH,gBAAe;IAGf,uCAQC;IAwBD;;;OAGG;IACH,WAFW,MAAM,QAMhB;IAED;;;;OAIG;IACH,UAHW,MAAM,KACN,MAAM,QAIhB;IAED;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"GridCellActionPlaceTags.d.ts","sourceRoot":"","sources":["../../../../../src/generation/placement/action/GridCellActionPlaceTags.js"],"names":[],"mappings":"AAKA;IAsCI;;;;;OAKG;IACH,mBAJW,MAAM,SACN,MAAM,GACJ,uBAAuB,CAgBnC;IAxDD;;;OAGG;IACH,kBAFmB,MAAM,QAAE,MAAM,KAAG,MAAM,CAEpB;IAEtB;;;OAGG;IACH,MAFU,SAAS,CAEc;IAEjC;;;OAGG;IACH,SAFU,MAAM,CAED;IAEf;;;;OAIG;IACH,gBAAe;IAGf,uCAQC;IAwBD;;;OAGG;IACH,WAFW,MAAM,QAMhB;IAED;;;;OAIG;IACH,UAHW,MAAM,KACN,MAAM,QAIhB;IAED;;OAEG;IACH,wDA2CC;CACJ;+BAhI8B,qBAAqB;0BAD1B,uDAAuD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GridCellAction } from "./GridCellAction.js";
|
|
2
|
-
import { Sampler2D } from "../../../engine/graphics/texture/sampler/Sampler2D.js";
|
|
3
1
|
import { assert } from "../../../core/assert.js";
|
|
4
2
|
import { bitwiseOr } from "../../../core/binary/operations/bitwiseOr.js";
|
|
3
|
+
import { Sampler2D } from "../../../engine/graphics/texture/sampler/Sampler2D.js";
|
|
4
|
+
import { GridCellAction } from "./GridCellAction.js";
|
|
5
5
|
|
|
6
6
|
export class GridCellActionPlaceTags extends GridCellAction {
|
|
7
7
|
|
|
@@ -99,8 +99,6 @@ export class GridCellActionPlaceTags extends GridCellAction {
|
|
|
99
99
|
for (let local_y = 0; local_y < height; local_y++) {
|
|
100
100
|
for (let local_x = 0; local_x < width; local_x++) {
|
|
101
101
|
|
|
102
|
-
//read the tag value
|
|
103
|
-
const cell_tags = tags.readChannel(local_x, local_y, 0);
|
|
104
102
|
|
|
105
103
|
//rotate rule position
|
|
106
104
|
const rotated_local_x = local_x * cos - local_y * sin
|
|
@@ -110,6 +108,19 @@ export class GridCellActionPlaceTags extends GridCellAction {
|
|
|
110
108
|
const target_x = Math.round(rotated_local_x + x);
|
|
111
109
|
const target_y = Math.round(rotated_local_y + y);
|
|
112
110
|
|
|
111
|
+
if (
|
|
112
|
+
target_x < 0
|
|
113
|
+
|| target_x >= sampler.width
|
|
114
|
+
|| target_y < 0
|
|
115
|
+
|| target_y >= sampler.height
|
|
116
|
+
) {
|
|
117
|
+
// out of bounds
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
//read the tag value
|
|
122
|
+
const cell_tags = tags.readChannel(local_x, local_y, 0);
|
|
123
|
+
|
|
113
124
|
const source = sampler.readChannel(target_x, target_y, 0);
|
|
114
125
|
|
|
115
126
|
const result = this.operation(source, cell_tags);
|