math 0.0.3 → 0.1.0
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/API.md +1605 -0
- package/LICENSE +21 -0
- package/README.md +197 -0
- package/dist/color/color.js +136 -0
- package/dist/color/color.js.map +1 -0
- package/dist/color/colorspace.js +43 -0
- package/dist/color/colorspace.js.map +1 -0
- package/dist/color/hsl.js +123 -0
- package/dist/color/hsl.js.map +1 -0
- package/dist/color/index.js +7 -0
- package/dist/color/index.js.map +1 -0
- package/dist/color/parse.js +276 -0
- package/dist/color/parse.js.map +1 -0
- package/dist/core/angle.js +43 -0
- package/dist/core/angle.js.map +1 -0
- package/dist/core/euler.js +212 -0
- package/dist/core/euler.js.map +1 -0
- package/dist/core/mat2.js +385 -0
- package/dist/core/mat2.js.map +1 -0
- package/dist/core/mat2d.js +422 -0
- package/dist/core/mat2d.js.map +1 -0
- package/dist/core/mat3.js +749 -0
- package/dist/core/mat3.js.map +1 -0
- package/dist/core/mat4.js +2197 -0
- package/dist/core/mat4.js.map +1 -0
- package/dist/core/polar.js +200 -0
- package/dist/core/polar.js.map +1 -0
- package/dist/core/quat.js +730 -0
- package/dist/core/quat.js.map +1 -0
- package/dist/core/quat2.js +883 -0
- package/dist/core/quat2.js.map +1 -0
- package/dist/core/scalar.js +112 -0
- package/dist/core/scalar.js.map +1 -0
- package/dist/core/spherical.js +248 -0
- package/dist/core/spherical.js.map +1 -0
- package/dist/core/vec2.js +597 -0
- package/dist/core/vec2.js.map +1 -0
- package/dist/core/vec3.js +916 -0
- package/dist/core/vec3.js.map +1 -0
- package/dist/core/vec4.js +573 -0
- package/dist/core/vec4.js.map +1 -0
- package/dist/geometry/circumcircle.js +39 -0
- package/dist/geometry/circumcircle.js.map +1 -0
- package/dist/geometry/index.js +6 -0
- package/dist/geometry/index.js.map +1 -0
- package/dist/geometry/polygon2-decompose.js +411 -0
- package/dist/geometry/polygon2-decompose.js.map +1 -0
- package/dist/geometry/polygon2-triangulate.js +222 -0
- package/dist/geometry/polygon2-triangulate.js.map +1 -0
- package/dist/geometry/quickhull2.js +123 -0
- package/dist/geometry/quickhull2.js.map +1 -0
- package/dist/geometry/quickhull3.js +605 -0
- package/dist/geometry/quickhull3.js.map +1 -0
- package/dist/ik/fabrik2.js +675 -0
- package/dist/ik/fabrik2.js.map +1 -0
- package/dist/ik/fabrik3.js +912 -0
- package/dist/ik/fabrik3.js.map +1 -0
- package/dist/ik/index.js +5 -0
- package/dist/ik/index.js.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/noise/fractal.js +185 -0
- package/dist/noise/fractal.js.map +1 -0
- package/dist/noise/index.js +16 -0
- package/dist/noise/index.js.map +1 -0
- package/dist/noise/perlin2d.js +50 -0
- package/dist/noise/perlin2d.js.map +1 -0
- package/dist/noise/perlin3d.js +72 -0
- package/dist/noise/perlin3d.js.map +1 -0
- package/dist/noise/permutation.js +120 -0
- package/dist/noise/permutation.js.map +1 -0
- package/dist/noise/simplex2d.js +84 -0
- package/dist/noise/simplex2d.js.map +1 -0
- package/dist/noise/simplex3d.js +147 -0
- package/dist/noise/simplex3d.js.map +1 -0
- package/dist/noise/simplex4d.js +149 -0
- package/dist/noise/simplex4d.js.map +1 -0
- package/dist/noise/worley2d.js +50 -0
- package/dist/noise/worley2d.js.map +1 -0
- package/dist/noise/worley3d.js +61 -0
- package/dist/noise/worley3d.js.map +1 -0
- package/dist/random/index.js +9 -0
- package/dist/random/index.js.map +1 -0
- package/dist/random/isaac32.js +164 -0
- package/dist/random/isaac32.js.map +1 -0
- package/dist/random/isaac64.js +215 -0
- package/dist/random/isaac64.js.map +1 -0
- package/dist/random/mulberry32.js +48 -0
- package/dist/random/mulberry32.js.map +1 -0
- package/dist/random/random.js +120 -0
- package/dist/random/random.js.map +1 -0
- package/dist/shapes/box2.js +300 -0
- package/dist/shapes/box2.js.map +1 -0
- package/dist/shapes/box3.js +550 -0
- package/dist/shapes/box3.js.map +1 -0
- package/dist/shapes/circle.js +6 -0
- package/dist/shapes/circle.js.map +1 -0
- package/dist/shapes/frustum.js +662 -0
- package/dist/shapes/frustum.js.map +1 -0
- package/dist/shapes/index.js +25 -0
- package/dist/shapes/index.js.map +1 -0
- package/dist/shapes/obb3.js +557 -0
- package/dist/shapes/obb3.js.map +1 -0
- package/dist/shapes/plane3.js +267 -0
- package/dist/shapes/plane3.js.map +1 -0
- package/dist/shapes/polygon2.js +451 -0
- package/dist/shapes/polygon2.js.map +1 -0
- package/dist/shapes/raycast3.js +164 -0
- package/dist/shapes/raycast3.js.map +1 -0
- package/dist/shapes/segment2.js +82 -0
- package/dist/shapes/segment2.js.map +1 -0
- package/dist/shapes/sphere.js +23 -0
- package/dist/shapes/sphere.js.map +1 -0
- package/dist/shapes/triangle2.js +79 -0
- package/dist/shapes/triangle2.js.map +1 -0
- package/dist/shapes/triangle3.js +60 -0
- package/dist/shapes/triangle3.js.map +1 -0
- package/dist/src/color/color.d.ts +50 -0
- package/dist/src/color/colorspace.d.ts +15 -0
- package/dist/src/color/hsl.d.ts +28 -0
- package/dist/src/color/index.d.ts +5 -0
- package/dist/src/color/parse.d.ts +15 -0
- package/dist/src/core/angle.d.ts +29 -0
- package/dist/src/core/arrays.d.ts +4 -0
- package/dist/src/core/euler.d.ts +78 -0
- package/dist/src/core/index.d.ts +27 -0
- package/dist/src/core/mat2.d.ts +217 -0
- package/dist/src/core/mat2d.d.ts +218 -0
- package/dist/src/core/mat3.d.ts +295 -0
- package/dist/src/core/mat4.d.ts +667 -0
- package/dist/src/core/polar.d.ts +151 -0
- package/dist/src/core/quat.d.ts +370 -0
- package/dist/src/core/quat2.d.ts +344 -0
- package/dist/src/core/scalar.d.ts +75 -0
- package/dist/src/core/spherical.d.ts +165 -0
- package/dist/src/core/vec2.d.ts +403 -0
- package/dist/src/core/vec3.d.ts +493 -0
- package/dist/src/core/vec4.d.ts +336 -0
- package/dist/src/geometry/circumcircle.d.ts +9 -0
- package/dist/src/geometry/index.d.ts +5 -0
- package/dist/src/geometry/polygon2-decompose.d.ts +25 -0
- package/dist/src/geometry/polygon2-triangulate.d.ts +15 -0
- package/dist/src/geometry/quickhull2.d.ts +10 -0
- package/dist/src/geometry/quickhull3.d.ts +27 -0
- package/dist/src/ik/fabrik2.d.ts +314 -0
- package/dist/src/ik/fabrik3.d.ts +371 -0
- package/dist/src/ik/index.d.ts +2 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/noise/fractal.d.ts +95 -0
- package/dist/src/noise/index.d.ts +9 -0
- package/dist/src/noise/perlin2d.d.ts +19 -0
- package/dist/src/noise/perlin3d.d.ts +20 -0
- package/dist/src/noise/permutation.d.ts +22 -0
- package/dist/src/noise/simplex2d.d.ts +19 -0
- package/dist/src/noise/simplex3d.d.ts +20 -0
- package/dist/src/noise/simplex4d.d.ts +24 -0
- package/dist/src/noise/worley2d.d.ts +22 -0
- package/dist/src/noise/worley3d.d.ts +23 -0
- package/dist/src/random/index.d.ts +8 -0
- package/dist/src/random/isaac32.d.ts +62 -0
- package/dist/src/random/isaac64.d.ts +75 -0
- package/dist/src/random/mulberry32.d.ts +43 -0
- package/dist/src/random/random.d.ts +67 -0
- package/dist/src/shapes/box2.d.ts +174 -0
- package/dist/src/shapes/box3.d.ts +213 -0
- package/dist/src/shapes/circle.d.ts +7 -0
- package/dist/src/shapes/frustum.d.ts +147 -0
- package/dist/src/shapes/index.d.ts +20 -0
- package/dist/src/shapes/obb3.d.ts +105 -0
- package/dist/src/shapes/plane3.d.ts +130 -0
- package/dist/src/shapes/polygon2.d.ts +155 -0
- package/dist/src/shapes/raycast3.d.ts +42 -0
- package/dist/src/shapes/segment2.d.ts +34 -0
- package/dist/src/shapes/sphere.d.ts +19 -0
- package/dist/src/shapes/triangle2.d.ts +53 -0
- package/dist/src/shapes/triangle3.d.ts +29 -0
- package/dist/src/time/easing.d.ts +21 -0
- package/dist/src/time/index.d.ts +6 -0
- package/dist/src/time/spring-core.d.ts +15 -0
- package/dist/src/time/spring.d.ts +36 -0
- package/dist/src/time/spring2.d.ts +11 -0
- package/dist/src/time/spring3.d.ts +11 -0
- package/dist/src/time/spring4.d.ts +11 -0
- package/dist/time/easing.js +24 -0
- package/dist/time/easing.js.map +1 -0
- package/dist/time/index.js +11 -0
- package/dist/time/index.js.map +1 -0
- package/dist/time/spring-core.js +48 -0
- package/dist/time/spring-core.js.map +1 -0
- package/dist/time/spring.js +62 -0
- package/dist/time/spring.js.map +1 -0
- package/dist/time/spring2.js +31 -0
- package/dist/time/spring2.js.map +1 -0
- package/dist/time/spring3.js +32 -0
- package/dist/time/spring3.js.map +1 -0
- package/dist/time/spring4.js +32 -0
- package/dist/time/spring4.js.map +1 -0
- package/package.json +90 -16
- package/skills/math/SKILL.md +140 -0
- package/AUTHORS +0 -1
- package/Cakefile +0 -28
- package/math.coffee +0 -112
- package/math.js +0 -141
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { clone as clone$1, copy as copy$1, dot, equals as equals$1, exactEquals as exactEquals$1, negate as negate$1, length, scale, scaleAndAdd } from '../core/vec3.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new plane with normal (0, 1, 0) and constant 0
|
|
5
|
+
* @returns A new plane
|
|
6
|
+
*/
|
|
7
|
+
function create() {
|
|
8
|
+
return { normal: [0, 1, 0], constant: 0 };
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Creates a plane from a normal and constant
|
|
12
|
+
* @param out - The output plane
|
|
13
|
+
* @param normal - The plane normal (should be unit length)
|
|
14
|
+
* @param constant - The signed distance from origin
|
|
15
|
+
* @returns The output plane
|
|
16
|
+
*/
|
|
17
|
+
function fromNormalAndConstant(out, normal, constant) {
|
|
18
|
+
copy$1(out.normal, normal);
|
|
19
|
+
out.constant = constant;
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a plane from a normal and a point on the plane
|
|
24
|
+
* @param out - The output plane
|
|
25
|
+
* @param normal - The plane normal (should be unit length)
|
|
26
|
+
* @param point - A point on the plane
|
|
27
|
+
* @returns The output plane
|
|
28
|
+
*/
|
|
29
|
+
function fromNormalAndPoint(out, normal, point) {
|
|
30
|
+
copy$1(out.normal, normal);
|
|
31
|
+
out.constant = -dot(normal, point);
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Creates a plane from three coplanar points
|
|
36
|
+
* @param out - The output plane
|
|
37
|
+
* @param a - First point
|
|
38
|
+
* @param b - Second point
|
|
39
|
+
* @param c - Third point
|
|
40
|
+
* @returns The output plane
|
|
41
|
+
*/
|
|
42
|
+
function fromCoplanarPoints(out, a, b, c) {
|
|
43
|
+
const ax = a[0];
|
|
44
|
+
const ay = a[1];
|
|
45
|
+
const az = a[2];
|
|
46
|
+
// edge vectors v1 = b - a, v2 = c - a
|
|
47
|
+
const v1x = b[0] - ax;
|
|
48
|
+
const v1y = b[1] - ay;
|
|
49
|
+
const v1z = b[2] - az;
|
|
50
|
+
const v2x = c[0] - ax;
|
|
51
|
+
const v2y = c[1] - ay;
|
|
52
|
+
const v2z = c[2] - az;
|
|
53
|
+
// normal = normalize(v1 × v2) (matches vec3.normalize: zero-length stays zero)
|
|
54
|
+
let nx = v1y * v2z - v1z * v2y;
|
|
55
|
+
let ny = v1z * v2x - v1x * v2z;
|
|
56
|
+
let nz = v1x * v2y - v1y * v2x;
|
|
57
|
+
let len = nx * nx + ny * ny + nz * nz;
|
|
58
|
+
if (len > 0) {
|
|
59
|
+
len = 1 / Math.sqrt(len);
|
|
60
|
+
}
|
|
61
|
+
nx *= len;
|
|
62
|
+
ny *= len;
|
|
63
|
+
nz *= len;
|
|
64
|
+
out.normal[0] = nx;
|
|
65
|
+
out.normal[1] = ny;
|
|
66
|
+
out.normal[2] = nz;
|
|
67
|
+
out.constant = -(nx * ax + ny * ay + nz * az);
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Clones a plane
|
|
72
|
+
* @param plane - The plane to clone
|
|
73
|
+
* @returns A new plane
|
|
74
|
+
*/
|
|
75
|
+
function clone(plane) {
|
|
76
|
+
return {
|
|
77
|
+
normal: clone$1(plane.normal),
|
|
78
|
+
constant: plane.constant,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Copies one plane to another
|
|
83
|
+
* @param out - The output plane
|
|
84
|
+
* @param plane - The source plane
|
|
85
|
+
* @returns The output plane
|
|
86
|
+
*/
|
|
87
|
+
function copy(out, plane) {
|
|
88
|
+
copy$1(out.normal, plane.normal);
|
|
89
|
+
out.constant = plane.constant;
|
|
90
|
+
return out;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Normalizes a plane (ensures the normal vector is unit length)
|
|
94
|
+
* @param out - The output plane
|
|
95
|
+
* @param plane - The input plane
|
|
96
|
+
* @returns The normalized plane
|
|
97
|
+
*/
|
|
98
|
+
function normalize(out, plane) {
|
|
99
|
+
const invMagnitude = 1.0 / length(plane.normal);
|
|
100
|
+
scale(out.normal, plane.normal, invMagnitude);
|
|
101
|
+
out.constant = plane.constant * invMagnitude;
|
|
102
|
+
return out;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Negates a plane (flips the normal and constant)
|
|
106
|
+
* @param out - The output plane
|
|
107
|
+
* @param plane - The input plane
|
|
108
|
+
* @returns The negated plane
|
|
109
|
+
*/
|
|
110
|
+
function negate(out, plane) {
|
|
111
|
+
negate$1(out.normal, plane.normal);
|
|
112
|
+
out.constant = -plane.constant;
|
|
113
|
+
return out;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Offsets a plane by a distance along its normal
|
|
117
|
+
* @param out - The output plane
|
|
118
|
+
* @param plane - The input plane
|
|
119
|
+
* @param distance - The distance to offset (positive = in direction of normal)
|
|
120
|
+
* @returns The offset plane
|
|
121
|
+
*/
|
|
122
|
+
function offset(out, plane, distance) {
|
|
123
|
+
copy$1(out.normal, plane.normal);
|
|
124
|
+
out.constant = plane.constant - distance;
|
|
125
|
+
return out;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Calculates the signed distance from a point to the plane
|
|
129
|
+
* @param plane - The plane
|
|
130
|
+
* @param point - The point
|
|
131
|
+
* @returns The signed distance (positive = in direction of normal)
|
|
132
|
+
*/
|
|
133
|
+
function distanceToPoint(plane, point) {
|
|
134
|
+
return dot(plane.normal, point) + plane.constant;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Projects a point onto the plane
|
|
138
|
+
* @param out - The output point
|
|
139
|
+
* @param plane - The plane
|
|
140
|
+
* @param point - The point to project
|
|
141
|
+
* @returns The projected point
|
|
142
|
+
*/
|
|
143
|
+
function projectPoint(out, plane, point) {
|
|
144
|
+
const distance = distanceToPoint(plane, point);
|
|
145
|
+
return scaleAndAdd(out, point, plane.normal, -distance);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Transforms a plane by a 4x4 matrix
|
|
149
|
+
* @param out - The output plane
|
|
150
|
+
* @param plane - The plane to transform
|
|
151
|
+
* @param matrix - The transformation matrix
|
|
152
|
+
* @returns The transformed plane
|
|
153
|
+
*/
|
|
154
|
+
function transform(out, plane, matrix) {
|
|
155
|
+
// Transform the normal by the inverse transpose of the matrix
|
|
156
|
+
// For a proper implementation, you'd need mat4.invert and proper normal transformation
|
|
157
|
+
// This is a simplified version (rotation-only normal transform). fully scalar, no allocations.
|
|
158
|
+
const inx = plane.normal[0];
|
|
159
|
+
const iny = plane.normal[1];
|
|
160
|
+
const inz = plane.normal[2];
|
|
161
|
+
// a point on the plane: normal * -constant
|
|
162
|
+
const px = inx * -plane.constant;
|
|
163
|
+
const py = iny * -plane.constant;
|
|
164
|
+
const pz = inz * -plane.constant;
|
|
165
|
+
// transform normal (rotation part only)
|
|
166
|
+
let nx = matrix[0] * inx + matrix[4] * iny + matrix[8] * inz;
|
|
167
|
+
let ny = matrix[1] * inx + matrix[5] * iny + matrix[9] * inz;
|
|
168
|
+
let nz = matrix[2] * inx + matrix[6] * iny + matrix[10] * inz;
|
|
169
|
+
// transform the point by the full matrix (matches vec3.transformMat4, incl. w divide)
|
|
170
|
+
let w = matrix[3] * px + matrix[7] * py + matrix[11] * pz + matrix[15];
|
|
171
|
+
w = w || 1.0;
|
|
172
|
+
const tpx = (matrix[0] * px + matrix[4] * py + matrix[8] * pz + matrix[12]) / w;
|
|
173
|
+
const tpy = (matrix[1] * px + matrix[5] * py + matrix[9] * pz + matrix[13]) / w;
|
|
174
|
+
const tpz = (matrix[2] * px + matrix[6] * py + matrix[10] * pz + matrix[14]) / w;
|
|
175
|
+
// normalize transformed normal (matches vec3.normalize)
|
|
176
|
+
let len = nx * nx + ny * ny + nz * nz;
|
|
177
|
+
if (len > 0) {
|
|
178
|
+
len = 1 / Math.sqrt(len);
|
|
179
|
+
}
|
|
180
|
+
nx *= len;
|
|
181
|
+
ny *= len;
|
|
182
|
+
nz *= len;
|
|
183
|
+
out.normal[0] = nx;
|
|
184
|
+
out.normal[1] = ny;
|
|
185
|
+
out.normal[2] = nz;
|
|
186
|
+
out.constant = -(nx * tpx + ny * tpy + nz * tpz);
|
|
187
|
+
return out;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Tests if a sphere intersects the plane
|
|
191
|
+
* @param plane - The plane
|
|
192
|
+
* @param sphere - The sphere
|
|
193
|
+
* @returns True if they intersect
|
|
194
|
+
*/
|
|
195
|
+
function intersectsSphere(plane, sphere) {
|
|
196
|
+
const distance = Math.abs(distanceToPoint(plane, sphere.center));
|
|
197
|
+
return distance <= sphere.radius;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Tests if two planes are exactly equal
|
|
201
|
+
* @param a - First plane
|
|
202
|
+
* @param b - Second plane
|
|
203
|
+
* @returns True if planes are exactly equal
|
|
204
|
+
*/
|
|
205
|
+
function exactEquals(a, b) {
|
|
206
|
+
return exactEquals$1(a.normal, b.normal) && a.constant === b.constant;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Finds the intersection point of three planes
|
|
210
|
+
* @param out - The output point where the three planes intersect
|
|
211
|
+
* @param p1 - First plane
|
|
212
|
+
* @param p2 - Second plane
|
|
213
|
+
* @param p3 - Third plane
|
|
214
|
+
* @returns True if intersection exists, false if planes are degenerate or parallel
|
|
215
|
+
*/
|
|
216
|
+
function intersect(out, p1, p2, p3) {
|
|
217
|
+
// point = -(d1*(N2×N3) + d2*(N3×N1) + d3*(N1×N2)) / (N1·(N2×N3))
|
|
218
|
+
// Cramer's rule: the three cross products are the columns of adj(M) and are reused
|
|
219
|
+
// between the determinant and the numerator. fully scalar, zero allocations.
|
|
220
|
+
const n1x = p1.normal[0];
|
|
221
|
+
const n1y = p1.normal[1];
|
|
222
|
+
const n1z = p1.normal[2];
|
|
223
|
+
const n2x = p2.normal[0];
|
|
224
|
+
const n2y = p2.normal[1];
|
|
225
|
+
const n2z = p2.normal[2];
|
|
226
|
+
const n3x = p3.normal[0];
|
|
227
|
+
const n3y = p3.normal[1];
|
|
228
|
+
const n3z = p3.normal[2];
|
|
229
|
+
// N2 × N3
|
|
230
|
+
const c1x = n2y * n3z - n2z * n3y;
|
|
231
|
+
const c1y = n2z * n3x - n2x * n3z;
|
|
232
|
+
const c1z = n2x * n3y - n2y * n3x;
|
|
233
|
+
// denominator: N1 · (N2 × N3)
|
|
234
|
+
const denom = n1x * c1x + n1y * c1y + n1z * c1z;
|
|
235
|
+
// planes are parallel or degenerate (determinant is zero)
|
|
236
|
+
if (Math.abs(denom) < 0.000001) {
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
// N3 × N1
|
|
240
|
+
const c2x = n3y * n1z - n3z * n1y;
|
|
241
|
+
const c2y = n3z * n1x - n3x * n1z;
|
|
242
|
+
const c2z = n3x * n1y - n3y * n1x;
|
|
243
|
+
// N1 × N2
|
|
244
|
+
const c3x = n1y * n2z - n1z * n2y;
|
|
245
|
+
const c3y = n1z * n2x - n1x * n2z;
|
|
246
|
+
const c3z = n1x * n2y - n1y * n2x;
|
|
247
|
+
const d1 = p1.constant;
|
|
248
|
+
const d2 = p2.constant;
|
|
249
|
+
const d3 = p3.constant;
|
|
250
|
+
const s = -1 / denom;
|
|
251
|
+
out[0] = (d1 * c1x + d2 * c2x + d3 * c3x) * s;
|
|
252
|
+
out[1] = (d1 * c1y + d2 * c2y + d3 * c3y) * s;
|
|
253
|
+
out[2] = (d1 * c1z + d2 * c2z + d3 * c3z) * s;
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Tests if two planes are equal
|
|
258
|
+
* @param a - First plane
|
|
259
|
+
* @param b - Second plane
|
|
260
|
+
* @returns True if planes are equal
|
|
261
|
+
*/
|
|
262
|
+
function equals(a, b) {
|
|
263
|
+
return equals$1(a.normal, b.normal) && Math.abs(a.constant - b.constant) < 0.000001;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export { clone, copy, create, distanceToPoint, equals, exactEquals, fromCoplanarPoints, fromNormalAndConstant, fromNormalAndPoint, intersect, intersectsSphere, negate, normalize, offset, projectPoint, transform };
|
|
267
|
+
//# sourceMappingURL=plane3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plane3.js","sources":["../../src/shapes/plane3.ts"],"sourcesContent":["import type { Mat4 } from '../core/mat4';\nimport type { Vec3 } from '../core/vec3';\nimport * as vec3 from '../core/vec3';\nimport type { Sphere } from './sphere';\n\n/**\n * A plane in 3D space\n * normal - a unit length vector defining the normal of the plane.\n * constant - the signed distance from the origin to the plane.\n */\nexport type Plane3 = { normal: Vec3; constant: number };\n\n/**\n * Creates a new plane with normal (0, 1, 0) and constant 0\n * @returns A new plane\n */\nexport function create(): Plane3 {\n return { normal: [0, 1, 0], constant: 0 };\n}\n\n/**\n * Creates a plane from a normal and constant\n * @param out - The output plane\n * @param normal - The plane normal (should be unit length)\n * @param constant - The signed distance from origin\n * @returns The output plane\n */\nexport function fromNormalAndConstant(out: Plane3, normal: Vec3, constant: number): Plane3 {\n vec3.copy(out.normal, normal);\n out.constant = constant;\n return out;\n}\n\n/**\n * Creates a plane from a normal and a point on the plane\n * @param out - The output plane\n * @param normal - The plane normal (should be unit length)\n * @param point - A point on the plane\n * @returns The output plane\n */\nexport function fromNormalAndPoint(out: Plane3, normal: Vec3, point: Vec3): Plane3 {\n vec3.copy(out.normal, normal);\n out.constant = -vec3.dot(normal, point);\n return out;\n}\n\n/**\n * Creates a plane from three coplanar points\n * @param out - The output plane\n * @param a - First point\n * @param b - Second point\n * @param c - Third point\n * @returns The output plane\n */\nexport function fromCoplanarPoints(out: Plane3, a: Vec3, b: Vec3, c: Vec3): Plane3 {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n\n // edge vectors v1 = b - a, v2 = c - a\n const v1x = b[0] - ax;\n const v1y = b[1] - ay;\n const v1z = b[2] - az;\n const v2x = c[0] - ax;\n const v2y = c[1] - ay;\n const v2z = c[2] - az;\n\n // normal = normalize(v1 × v2) (matches vec3.normalize: zero-length stays zero)\n let nx = v1y * v2z - v1z * v2y;\n let ny = v1z * v2x - v1x * v2z;\n let nz = v1x * v2y - v1y * v2x;\n let len = nx * nx + ny * ny + nz * nz;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n nx *= len;\n ny *= len;\n nz *= len;\n\n out.normal[0] = nx;\n out.normal[1] = ny;\n out.normal[2] = nz;\n out.constant = -(nx * ax + ny * ay + nz * az);\n\n return out;\n}\n\n/**\n * Clones a plane\n * @param plane - The plane to clone\n * @returns A new plane\n */\nexport function clone(plane: Plane3): Plane3 {\n return {\n normal: vec3.clone(plane.normal),\n constant: plane.constant,\n };\n}\n\n/**\n * Copies one plane to another\n * @param out - The output plane\n * @param plane - The source plane\n * @returns The output plane\n */\nexport function copy(out: Plane3, plane: Plane3): Plane3 {\n vec3.copy(out.normal, plane.normal);\n out.constant = plane.constant;\n return out;\n}\n\n/**\n * Normalizes a plane (ensures the normal vector is unit length)\n * @param out - The output plane\n * @param plane - The input plane\n * @returns The normalized plane\n */\nexport function normalize(out: Plane3, plane: Plane3): Plane3 {\n const invMagnitude = 1.0 / vec3.length(plane.normal);\n vec3.scale(out.normal, plane.normal, invMagnitude);\n out.constant = plane.constant * invMagnitude;\n return out;\n}\n\n/**\n * Negates a plane (flips the normal and constant)\n * @param out - The output plane\n * @param plane - The input plane\n * @returns The negated plane\n */\nexport function negate(out: Plane3, plane: Plane3): Plane3 {\n vec3.negate(out.normal, plane.normal);\n out.constant = -plane.constant;\n return out;\n}\n\n/**\n * Offsets a plane by a distance along its normal\n * @param out - The output plane\n * @param plane - The input plane\n * @param distance - The distance to offset (positive = in direction of normal)\n * @returns The offset plane\n */\nexport function offset(out: Plane3, plane: Plane3, distance: number): Plane3 {\n vec3.copy(out.normal, plane.normal);\n out.constant = plane.constant - distance;\n return out;\n}\n\n/**\n * Calculates the signed distance from a point to the plane\n * @param plane - The plane\n * @param point - The point\n * @returns The signed distance (positive = in direction of normal)\n */\nexport function distanceToPoint(plane: Plane3, point: Vec3): number {\n return vec3.dot(plane.normal, point) + plane.constant;\n}\n\n/**\n * Projects a point onto the plane\n * @param out - The output point\n * @param plane - The plane\n * @param point - The point to project\n * @returns The projected point\n */\nexport function projectPoint(out: Vec3, plane: Plane3, point: Vec3): Vec3 {\n const distance = distanceToPoint(plane, point);\n return vec3.scaleAndAdd(out, point, plane.normal, -distance);\n}\n\n/**\n * Transforms a plane by a 4x4 matrix\n * @param out - The output plane\n * @param plane - The plane to transform\n * @param matrix - The transformation matrix\n * @returns The transformed plane\n */\nexport function transform(out: Plane3, plane: Plane3, matrix: Mat4): Plane3 {\n // Transform the normal by the inverse transpose of the matrix\n // For a proper implementation, you'd need mat4.invert and proper normal transformation\n // This is a simplified version (rotation-only normal transform). fully scalar, no allocations.\n const inx = plane.normal[0];\n const iny = plane.normal[1];\n const inz = plane.normal[2];\n\n // a point on the plane: normal * -constant\n const px = inx * -plane.constant;\n const py = iny * -plane.constant;\n const pz = inz * -plane.constant;\n\n // transform normal (rotation part only)\n let nx = matrix[0] * inx + matrix[4] * iny + matrix[8] * inz;\n let ny = matrix[1] * inx + matrix[5] * iny + matrix[9] * inz;\n let nz = matrix[2] * inx + matrix[6] * iny + matrix[10] * inz;\n\n // transform the point by the full matrix (matches vec3.transformMat4, incl. w divide)\n let w = matrix[3] * px + matrix[7] * py + matrix[11] * pz + matrix[15];\n w = w || 1.0;\n const tpx = (matrix[0] * px + matrix[4] * py + matrix[8] * pz + matrix[12]) / w;\n const tpy = (matrix[1] * px + matrix[5] * py + matrix[9] * pz + matrix[13]) / w;\n const tpz = (matrix[2] * px + matrix[6] * py + matrix[10] * pz + matrix[14]) / w;\n\n // normalize transformed normal (matches vec3.normalize)\n let len = nx * nx + ny * ny + nz * nz;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n nx *= len;\n ny *= len;\n nz *= len;\n\n out.normal[0] = nx;\n out.normal[1] = ny;\n out.normal[2] = nz;\n out.constant = -(nx * tpx + ny * tpy + nz * tpz);\n\n return out;\n}\n\n/**\n * Tests if a sphere intersects the plane\n * @param plane - The plane\n * @param sphere - The sphere\n * @returns True if they intersect\n */\nexport function intersectsSphere(plane: Plane3, sphere: Sphere): boolean {\n const distance = Math.abs(distanceToPoint(plane, sphere.center));\n return distance <= sphere.radius;\n}\n\n/**\n * Tests if two planes are exactly equal\n * @param a - First plane\n * @param b - Second plane\n * @returns True if planes are exactly equal\n */\nexport function exactEquals(a: Plane3, b: Plane3): boolean {\n return vec3.exactEquals(a.normal, b.normal) && a.constant === b.constant;\n}\n\n/**\n * Finds the intersection point of three planes\n * @param out - The output point where the three planes intersect\n * @param p1 - First plane\n * @param p2 - Second plane\n * @param p3 - Third plane\n * @returns True if intersection exists, false if planes are degenerate or parallel\n */\nexport function intersect(out: Vec3, p1: Plane3, p2: Plane3, p3: Plane3): boolean {\n // point = -(d1*(N2×N3) + d2*(N3×N1) + d3*(N1×N2)) / (N1·(N2×N3))\n // Cramer's rule: the three cross products are the columns of adj(M) and are reused\n // between the determinant and the numerator. fully scalar, zero allocations.\n const n1x = p1.normal[0];\n const n1y = p1.normal[1];\n const n1z = p1.normal[2];\n const n2x = p2.normal[0];\n const n2y = p2.normal[1];\n const n2z = p2.normal[2];\n const n3x = p3.normal[0];\n const n3y = p3.normal[1];\n const n3z = p3.normal[2];\n\n // N2 × N3\n const c1x = n2y * n3z - n2z * n3y;\n const c1y = n2z * n3x - n2x * n3z;\n const c1z = n2x * n3y - n2y * n3x;\n\n // denominator: N1 · (N2 × N3)\n const denom = n1x * c1x + n1y * c1y + n1z * c1z;\n\n // planes are parallel or degenerate (determinant is zero)\n if (Math.abs(denom) < 0.000001) {\n return false;\n }\n\n // N3 × N1\n const c2x = n3y * n1z - n3z * n1y;\n const c2y = n3z * n1x - n3x * n1z;\n const c2z = n3x * n1y - n3y * n1x;\n\n // N1 × N2\n const c3x = n1y * n2z - n1z * n2y;\n const c3y = n1z * n2x - n1x * n2z;\n const c3z = n1x * n2y - n1y * n2x;\n\n const d1 = p1.constant;\n const d2 = p2.constant;\n const d3 = p3.constant;\n const s = -1 / denom;\n\n out[0] = (d1 * c1x + d2 * c2x + d3 * c3x) * s;\n out[1] = (d1 * c1y + d2 * c2y + d3 * c3y) * s;\n out[2] = (d1 * c1z + d2 * c2z + d3 * c3z) * s;\n\n return true;\n}\n\n/**\n * Tests if two planes are equal\n * @param a - First plane\n * @param b - Second plane\n * @returns True if planes are equal\n */\nexport function equals(a: Plane3, b: Plane3): boolean {\n return vec3.equals(a.normal, b.normal) && Math.abs(a.constant - b.constant) < 0.000001;\n}\n"],"names":["vec3.copy","vec3.dot","vec3.clone","vec3.length","vec3.scale","vec3.negate","vec3.scaleAndAdd","vec3.exactEquals","vec3.equals"],"mappings":";;AAYA;;;AAGG;SACa,MAAM,GAAA;AAClB,IAAA,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAA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