@woosh/meep-engine 2.131.47 → 2.131.48
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 +1 -1
- package/src/core/geom/3d/plane/plane3_matrix4_project.d.ts.map +1 -1
- package/src/core/geom/3d/plane/plane3_matrix4_project.js +0 -1
- package/src/core/geom/3d/triangle/triangle_compute_plane_side.d.ts +24 -0
- package/src/core/geom/3d/triangle/triangle_compute_plane_side.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/{computeTrianglePlaneSide.js → triangle_compute_plane_side.js} +9 -5
- package/src/core/geom/3d/triangle/triangle_intersects_clipping_volume.js +2 -2
- package/src/core/geom/3d/triangle/computeTrianglePlaneSide.d.ts +0 -20
- package/src/core/geom/3d/triangle/computeTrianglePlaneSide.d.ts.map +0 -1
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.48",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plane3_matrix4_project.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/plane/plane3_matrix4_project.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plane3_matrix4_project.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/plane/plane3_matrix4_project.js"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,oDARW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,sBAClC,MAAM,UACN,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,KAClC,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QAiBhB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { v3_dot_array_array } from "../../vec3/v3_dot_array_array.js";
|
|
2
2
|
import { v3_matrix4_multiply } from "../../vec3/v3_matrix4_multiply.js";
|
|
3
|
-
import { v3_matrix4_rotate } from "../../vec3/v3_matrix4_rotate.js";
|
|
4
3
|
import { v3_matrix4_rotate_normal } from "../../vec3/v3_matrix4_rotate_normal.js";
|
|
5
4
|
import { v3_multiply_scalar } from "../../vec3/v3_multiply_scalar.js";
|
|
6
5
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Produces a numeric result to indicate which side of the plane the triangle is on
|
|
3
|
+
* between +3 and -3:
|
|
4
|
+
* +3 means that all vertices ave above the plane
|
|
5
|
+
* -3 means all vertices are below the plane
|
|
6
|
+
* values in between indicate that the plane cuts through the triangle
|
|
7
|
+
*
|
|
8
|
+
* @param {number} plane_normal_x
|
|
9
|
+
* @param {number} plane_normal_y
|
|
10
|
+
* @param {number} plane_normal_z
|
|
11
|
+
* @param {number} plane_constant
|
|
12
|
+
* @param {number} ax
|
|
13
|
+
* @param {number} ay
|
|
14
|
+
* @param {number} az
|
|
15
|
+
* @param {number} bx
|
|
16
|
+
* @param {number} by
|
|
17
|
+
* @param {number} bz
|
|
18
|
+
* @param {number} cx
|
|
19
|
+
* @param {number} cy
|
|
20
|
+
* @param {number} cz
|
|
21
|
+
* @returns {number}
|
|
22
|
+
*/
|
|
23
|
+
export function triangle_compute_plane_side(plane_normal_x: number, plane_normal_y: number, plane_normal_z: number, plane_constant: number, ax: number, ay: number, az: number, bx: number, by: number, bz: number, cx: number, cy: number, cz: number): number;
|
|
24
|
+
//# sourceMappingURL=triangle_compute_plane_side.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triangle_compute_plane_side.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/triangle/triangle_compute_plane_side.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,4DAfW,MAAM,kBACN,MAAM,kBACN,MAAM,kBACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CAgBlB"}
|
package/src/core/geom/3d/triangle/{computeTrianglePlaneSide.js → triangle_compute_plane_side.js}
RENAMED
|
@@ -2,7 +2,11 @@ import { v3_dot } from "../../vec3/v3_dot.js";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Produces a numeric result to indicate which side of the plane the triangle is on
|
|
5
|
-
* between +3 and -3
|
|
5
|
+
* between +3 and -3:
|
|
6
|
+
* +3 means that all vertices ave above the plane
|
|
7
|
+
* -3 means all vertices are below the plane
|
|
8
|
+
* values in between indicate that the plane cuts through the triangle
|
|
9
|
+
*
|
|
6
10
|
* @param {number} plane_normal_x
|
|
7
11
|
* @param {number} plane_normal_y
|
|
8
12
|
* @param {number} plane_normal_z
|
|
@@ -18,7 +22,7 @@ import { v3_dot } from "../../vec3/v3_dot.js";
|
|
|
18
22
|
* @param {number} cz
|
|
19
23
|
* @returns {number}
|
|
20
24
|
*/
|
|
21
|
-
export function
|
|
25
|
+
export function triangle_compute_plane_side(
|
|
22
26
|
plane_normal_x, plane_normal_y, plane_normal_z, plane_constant,
|
|
23
27
|
ax, ay, az,
|
|
24
28
|
bx, by, bz,
|
|
@@ -27,9 +31,9 @@ export function computeTrianglePlaneSide(
|
|
|
27
31
|
let result = 0;
|
|
28
32
|
|
|
29
33
|
// compute side for each point
|
|
30
|
-
result += v3_dot(plane_normal_x, plane_normal_y, plane_normal_z, ax, ay, az)
|
|
31
|
-
result += v3_dot(plane_normal_x, plane_normal_y, plane_normal_z, bx, by, bz)
|
|
32
|
-
result += v3_dot(plane_normal_x, plane_normal_y, plane_normal_z, cx, cy, cz)
|
|
34
|
+
result += ( v3_dot(plane_normal_x, plane_normal_y, plane_normal_z, ax, ay, az) + plane_constant ) >= 0 ? 1 : -1;
|
|
35
|
+
result += ( v3_dot(plane_normal_x, plane_normal_y, plane_normal_z, bx, by, bz) + plane_constant ) >= 0 ? 1 : -1;
|
|
36
|
+
result += ( v3_dot(plane_normal_x, plane_normal_y, plane_normal_z, cx, cy, cz) + plane_constant ) >= 0 ? 1 : -1;
|
|
33
37
|
|
|
34
38
|
return result;
|
|
35
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { triangle_compute_plane_side } from "./triangle_compute_plane_side.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @param {number[]|Float32Array} planes
|
|
@@ -31,7 +31,7 @@ export function triangle_intersects_clipping_volume(
|
|
|
31
31
|
const plane_normal_z = planes[plane_address + 2];
|
|
32
32
|
const plane_constant = planes[plane_address + 3];
|
|
33
33
|
|
|
34
|
-
const side =
|
|
34
|
+
const side = triangle_compute_plane_side(
|
|
35
35
|
plane_normal_x,
|
|
36
36
|
plane_normal_y,
|
|
37
37
|
plane_normal_z,
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Produces a numeric result to indicate which side of the plane the triangle is on
|
|
3
|
-
* between +3 and -3, +3 means that all vertices ave above the plane, -3 means all vertices are below the plane, values in between indicate that plane cuts throught the triangle
|
|
4
|
-
* @param {number} plane_normal_x
|
|
5
|
-
* @param {number} plane_normal_y
|
|
6
|
-
* @param {number} plane_normal_z
|
|
7
|
-
* @param {number} plane_constant
|
|
8
|
-
* @param {number} ax
|
|
9
|
-
* @param {number} ay
|
|
10
|
-
* @param {number} az
|
|
11
|
-
* @param {number} bx
|
|
12
|
-
* @param {number} by
|
|
13
|
-
* @param {number} bz
|
|
14
|
-
* @param {number} cx
|
|
15
|
-
* @param {number} cy
|
|
16
|
-
* @param {number} cz
|
|
17
|
-
* @returns {number}
|
|
18
|
-
*/
|
|
19
|
-
export function computeTrianglePlaneSide(plane_normal_x: number, plane_normal_y: number, plane_normal_z: number, plane_constant: number, ax: number, ay: number, az: number, bx: number, by: number, bz: number, cx: number, cy: number, cz: number): number;
|
|
20
|
-
//# sourceMappingURL=computeTrianglePlaneSide.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"computeTrianglePlaneSide.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/triangle/computeTrianglePlaneSide.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,yDAfW,MAAM,kBACN,MAAM,kBACN,MAAM,kBACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CAgBlB"}
|