@flighthq/lighting 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.
Files changed (50) hide show
  1. package/dist/ambientLight.d.ts +8 -0
  2. package/dist/ambientLight.d.ts.map +1 -0
  3. package/dist/ambientLight.js +16 -0
  4. package/dist/ambientLight.js.map +1 -0
  5. package/dist/areaLight.d.ts +18 -0
  6. package/dist/areaLight.d.ts.map +1 -0
  7. package/dist/areaLight.js +75 -0
  8. package/dist/areaLight.js.map +1 -0
  9. package/dist/colorFromKelvin.d.ts +2 -0
  10. package/dist/colorFromKelvin.d.ts.map +1 -0
  11. package/dist/colorFromKelvin.js +44 -0
  12. package/dist/colorFromKelvin.js.map +1 -0
  13. package/dist/directionalLight.d.ts +15 -0
  14. package/dist/directionalLight.d.ts.map +1 -0
  15. package/dist/directionalLight.js +56 -0
  16. package/dist/directionalLight.js.map +1 -0
  17. package/dist/environment.d.ts +8 -0
  18. package/dist/environment.d.ts.map +1 -0
  19. package/dist/environment.js +18 -0
  20. package/dist/environment.js.map +1 -0
  21. package/dist/hemisphereLight.d.ts +9 -0
  22. package/dist/hemisphereLight.d.ts.map +1 -0
  23. package/dist/hemisphereLight.js +22 -0
  24. package/dist/hemisphereLight.js.map +1 -0
  25. package/dist/index.d.ts +10 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +10 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/lightAnalysis.d.ts +6 -0
  30. package/dist/lightAnalysis.d.ts.map +1 -0
  31. package/dist/lightAnalysis.js +91 -0
  32. package/dist/lightAnalysis.js.map +1 -0
  33. package/dist/pointLight.d.ts +14 -0
  34. package/dist/pointLight.d.ts.map +1 -0
  35. package/dist/pointLight.js +35 -0
  36. package/dist/pointLight.js.map +1 -0
  37. package/dist/spotLight.d.ts +25 -0
  38. package/dist/spotLight.d.ts.map +1 -0
  39. package/dist/spotLight.js +86 -0
  40. package/dist/spotLight.js.map +1 -0
  41. package/package.json +39 -0
  42. package/src/ambientLight.test.ts +29 -0
  43. package/src/areaLight.test.ts +100 -0
  44. package/src/colorFromKelvin.test.ts +48 -0
  45. package/src/directionalLight.test.ts +89 -0
  46. package/src/environment.test.ts +49 -0
  47. package/src/hemisphereLight.test.ts +31 -0
  48. package/src/lightAnalysis.test.ts +188 -0
  49. package/src/pointLight.test.ts +55 -0
  50. package/src/spotLight.test.ts +143 -0
@@ -0,0 +1,8 @@
1
+ import type { AmbientLight } from '@flighthq/types';
2
+ export interface AmbientLightOptions {
3
+ color?: number;
4
+ intensity?: number;
5
+ }
6
+ export declare function cloneAmbientLight(source: Readonly<AmbientLight>): AmbientLight;
7
+ export declare function createAmbientLight(options?: Readonly<AmbientLightOptions>): AmbientLight;
8
+ //# sourceMappingURL=ambientLight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ambientLight.d.ts","sourceRoot":"","sources":["../src/ambientLight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,YAAY,CAE9E;AAID,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GAAG,YAAY,CAMxF"}
@@ -0,0 +1,16 @@
1
+ import { createEntity } from '@flighthq/entity';
2
+ import { AmbientLightKind } from '@flighthq/types';
3
+ // Independent copy of an ambient light's data. The `kind` discriminant is carried over.
4
+ export function cloneAmbientLight(source) {
5
+ return createAmbientLight({ color: source.color, intensity: source.intensity });
6
+ }
7
+ // Uniform omnidirectional fill light. Color is packed sRgb-albedo RGBA (0xrrggbbaa); defaults to
8
+ // opaque white at unit intensity. Ambient lights do not cast shadows.
9
+ export function createAmbientLight(options) {
10
+ return createEntity({
11
+ color: options?.color ?? 0xffffffff,
12
+ intensity: options?.intensity ?? 1,
13
+ kind: AmbientLightKind,
14
+ });
15
+ }
16
+ //# sourceMappingURL=ambientLight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ambientLight.js","sourceRoot":"","sources":["../src/ambientLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAOnD,wFAAwF;AACxF,MAAM,UAAU,iBAAiB,CAAC,MAA8B;IAC9D,OAAO,kBAAkB,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;AAClF,CAAC;AAED,iGAAiG;AACjG,sEAAsE;AACtE,MAAM,UAAU,kBAAkB,CAAC,OAAuC;IACxE,OAAO,YAAY,CAAC;QAClB,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,UAAU;QACnC,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,CAAC;QAClC,IAAI,EAAE,gBAAgB;KACvB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { AreaLight, Vector3Like } from '@flighthq/types';
2
+ export interface AreaLightOptions {
3
+ castsShadow?: boolean;
4
+ color?: number;
5
+ direction?: Readonly<Vector3Like>;
6
+ intensity?: number;
7
+ normalBias?: number;
8
+ pcfRadius?: number;
9
+ position?: Readonly<Vector3Like>;
10
+ range?: number;
11
+ right?: Readonly<Vector3Like>;
12
+ shadowBias?: number;
13
+ up?: Readonly<Vector3Like>;
14
+ }
15
+ export declare function cloneAreaLight(source: Readonly<AreaLight>): AreaLight;
16
+ export declare function createAreaLight(options?: Readonly<AreaLightOptions>): AreaLight;
17
+ export declare function setAreaLightOrientation(out: AreaLight, direction: Readonly<Vector3Like>, right: Readonly<Vector3Like>, up: Readonly<Vector3Like>): void;
18
+ //# sourceMappingURL=areaLight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"areaLight.d.ts","sourceRoot":"","sources":["../src/areaLight.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9D,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,KAAK,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,EAAE,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;CAC5B;AAGD,wBAAgB,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS,CAerE;AAMD,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAmB/E;AAOD,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,EAChC,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,EAC5B,EAAE,EAAE,QAAQ,CAAC,WAAW,CAAC,GACxB,IAAI,CA6BN"}
@@ -0,0 +1,75 @@
1
+ import { createEntity } from '@flighthq/entity';
2
+ import { cloneVector3, createVector3, normalizeVector3, setVector3 } from '@flighthq/geometry';
3
+ import { AreaLightKind } from '@flighthq/types';
4
+ // Independent copy of an area light's data, including fresh position/direction/right/up vectors.
5
+ export function cloneAreaLight(source) {
6
+ return createEntity({
7
+ castsShadow: source.castsShadow,
8
+ color: source.color,
9
+ direction: cloneVector3(source.direction),
10
+ intensity: source.intensity,
11
+ kind: AreaLightKind,
12
+ normalBias: source.normalBias,
13
+ pcfRadius: source.pcfRadius,
14
+ position: cloneVector3(source.position),
15
+ range: source.range,
16
+ right: cloneVector3(source.right),
17
+ shadowBias: source.shadowBias,
18
+ up: cloneVector3(source.up),
19
+ });
20
+ }
21
+ // Rectangular area light (LTC-shaded). `position` is the rectangle center, `direction` its facing
22
+ // normal, `right`/`up` its half-extent axes (length encodes half-width/half-height). Color is
23
+ // packed sRgb-albedo RGBA (0xrrggbbaa); defaults to opaque white at unit intensity, at the origin
24
+ // facing down (0, -1, 0), unit-half-extent (1,0,0)/(0,0,1) rectangle, infinite range, shadows off.
25
+ export function createAreaLight(options) {
26
+ const position = options?.position;
27
+ const direction = options?.direction;
28
+ const right = options?.right;
29
+ const up = options?.up;
30
+ return createEntity({
31
+ castsShadow: options?.castsShadow ?? false,
32
+ color: options?.color ?? 0xffffffff,
33
+ direction: direction ? cloneVector3(direction) : createVector3(0, -1, 0),
34
+ intensity: options?.intensity ?? 1,
35
+ kind: AreaLightKind,
36
+ normalBias: options?.normalBias ?? 0,
37
+ pcfRadius: options?.pcfRadius ?? 0,
38
+ position: position ? cloneVector3(position) : createVector3(0, 0, 0),
39
+ range: options?.range ?? -1,
40
+ right: right ? cloneVector3(right) : createVector3(1, 0, 0),
41
+ shadowBias: options?.shadowBias ?? 0,
42
+ up: up ? cloneVector3(up) : createVector3(0, 0, 1),
43
+ });
44
+ }
45
+ // Sets the orientation of a rectangular area light by writing normalized `direction`, `right`,
46
+ // and `up` vectors. `direction` is the facing normal; `right`/`up` carry their existing lengths
47
+ // as half-extents (they are not renormalized here — only the directions are updated). The input
48
+ // direction, right, and up vectors are normalized before storing; zero-length inputs are ignored.
49
+ // Alias-safe: all inputs are read into locals before writing.
50
+ export function setAreaLightOrientation(out, direction, right, up) {
51
+ // Read all extents and direction components into locals before writing.
52
+ const rightLen = Math.sqrt(right.x * right.x + right.y * right.y + right.z * right.z);
53
+ const upLen = Math.sqrt(up.x * up.x + up.y * up.y + up.z * up.z);
54
+ const dirLen = Math.sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z);
55
+ // Preserve existing half-extent lengths; only update the directions.
56
+ const existingRightLen = Math.sqrt(out.right.x * out.right.x + out.right.y * out.right.y + out.right.z * out.right.z);
57
+ const existingUpLen = Math.sqrt(out.up.x * out.up.x + out.up.y * out.up.y + out.up.z * out.up.z);
58
+ if (dirLen > 0) {
59
+ normalizeVector3(out.direction, direction);
60
+ }
61
+ if (rightLen > 0) {
62
+ // Normalize direction, then scale back to original half-extent.
63
+ setVector3(out.right, right.x / rightLen, right.y / rightLen, right.z / rightLen);
64
+ if (existingRightLen > 0) {
65
+ setVector3(out.right, out.right.x * existingRightLen, out.right.y * existingRightLen, out.right.z * existingRightLen);
66
+ }
67
+ }
68
+ if (upLen > 0) {
69
+ setVector3(out.up, up.x / upLen, up.y / upLen, up.z / upLen);
70
+ if (existingUpLen > 0) {
71
+ setVector3(out.up, out.up.x * existingUpLen, out.up.y * existingUpLen, out.up.z * existingUpLen);
72
+ }
73
+ }
74
+ }
75
+ //# sourceMappingURL=areaLight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"areaLight.js","sourceRoot":"","sources":["../src/areaLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE/F,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAkBhD,iGAAiG;AACjG,MAAM,UAAU,cAAc,CAAC,MAA2B;IACxD,OAAO,YAAY,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC,WA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AAG,CAAC,EAAE,CAAC;QACd,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;QAC7D,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YACtB,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,aAAa,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,aAAa,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;QACnG,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function createColorFromKelvin(kelvin: number): number;
2
+ //# sourceMappingURL=colorFromKelvin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colorFromKelvin.d.ts","sourceRoot":"","sources":["../src/colorFromKelvin.ts"],"names":[],"mappings":"AAOA,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAqC5D"}
@@ -0,0 +1,44 @@
1
+ // Creates a packed sRgb-albedo RGBA color (0xrrggbbaa) from a color temperature in Kelvin.
2
+ // Uses the Tanner Helland piecewise approximation (accurate to within ±1% for 1000 K–40000 K),
3
+ // the same algorithm used in Blender, three.js, and Filament's color-temperature helper.
4
+ // Returns opaque white (0xffffffff) for temperatures outside the 1000–40000 K range.
5
+ //
6
+ // Common temperatures: 1800 K = candlelight, 3000 K = warm bulb, 5500 K = noon sunlight,
7
+ // 6500 K = D65 white, 10000 K = overcast sky.
8
+ export function createColorFromKelvin(kelvin) {
9
+ // Clamp to the valid range.
10
+ const temp = Math.max(1000, Math.min(40000, kelvin)) / 100;
11
+ let r;
12
+ let g;
13
+ let b;
14
+ // Red channel.
15
+ if (temp <= 66) {
16
+ r = 255;
17
+ }
18
+ else {
19
+ r = 329.698727446 * Math.pow(temp - 60, -0.1332047592);
20
+ }
21
+ // Green channel.
22
+ if (temp <= 66) {
23
+ g = 99.4708025861 * Math.log(temp) - 161.1195681661;
24
+ }
25
+ else {
26
+ g = 288.1221695283 * Math.pow(temp - 60, -0.0755148492);
27
+ }
28
+ // Blue channel.
29
+ if (temp >= 66) {
30
+ b = 255;
31
+ }
32
+ else if (temp <= 19) {
33
+ b = 0;
34
+ }
35
+ else {
36
+ b = 138.5177312231 * Math.log(temp - 10) - 305.0447927307;
37
+ }
38
+ const ri = Math.max(0, Math.min(255, Math.round(r)));
39
+ const gi = Math.max(0, Math.min(255, Math.round(g)));
40
+ const bi = Math.max(0, Math.min(255, Math.round(b)));
41
+ // Pack as 0xrrggbbaa with fully opaque alpha.
42
+ return ((ri << 24) | (gi << 16) | (bi << 8) | 0xff) >>> 0;
43
+ }
44
+ //# sourceMappingURL=colorFromKelvin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colorFromKelvin.js","sourceRoot":"","sources":["../src/colorFromKelvin.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,+FAA+F;AAC/F,yFAAyF;AACzF,qFAAqF;AACrF,EAAE;AACF,yFAAyF;AACzF,8CAA8C;AAC9C,MAAM,UAAU,qBAAqB,CAAC,MAAc;IAClD,4BAA4B;IAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,GAAG,GAAG,CAAC;IAE3D,IAAI,CAAS,CAAC;IACd,IAAI,CAAS,CAAC;IACd,IAAI,CAAS,CAAC;IAEd,eAAe;IACf,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;QACf,CAAC,GAAG,GAAG,CAAC;IACV,CAAC;SAAM,CAAC;QACN,CAAC,GAAG,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC;IACzD,CAAC;IAED,iBA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DirectionalLight, Vector3Like } from '@flighthq/types';
2
+ export interface DirectionalLightOptions {
3
+ castsShadow?: boolean;
4
+ color?: number;
5
+ direction?: Readonly<Vector3Like>;
6
+ intensity?: number;
7
+ normalBias?: number;
8
+ pcfRadius?: number;
9
+ shadowBias?: number;
10
+ }
11
+ export declare function cloneDirectionalLight(source: Readonly<DirectionalLight>): DirectionalLight;
12
+ export declare function createDirectionalLight(options?: Readonly<DirectionalLightOptions>): DirectionalLight;
13
+ export declare function setDirectionalLightDirection(out: DirectionalLight, x: number, y: number, z: number): void;
14
+ export declare function setDirectionalLightTarget(out: DirectionalLight, fromX: number, fromY: number, fromZ: number, toX: number, toY: number, toZ: number): void;
15
+ //# sourceMappingURL=directionalLight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directionalLight.d.ts","sourceRoot":"","sources":["../src/directionalLight.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGrE,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAW1F;AAKD,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,uBAAuB,CAAC,GAAG,gBAAgB,CAYpG;AAID,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,gBAAgB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CASzG;AAID,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,gBAAgB,EACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,IAAI,CAQN"}
@@ -0,0 +1,56 @@
1
+ import { createEntity } from '@flighthq/entity';
2
+ import { cloneVector3, createVector3, setVector3 } from '@flighthq/geometry';
3
+ import { DirectionalLightKind } from '@flighthq/types';
4
+ // Independent copy of a directional light's data, including a fresh `direction` vector.
5
+ export function cloneDirectionalLight(source) {
6
+ return createEntity({
7
+ castsShadow: source.castsShadow,
8
+ color: source.color,
9
+ direction: cloneVector3(source.direction),
10
+ intensity: source.intensity,
11
+ kind: DirectionalLightKind,
12
+ normalBias: source.normalBias,
13
+ pcfRadius: source.pcfRadius,
14
+ shadowBias: source.shadowBias,
15
+ });
16
+ }
17
+ // Infinitely distant directional light (sun). `direction` is the world-space travel direction
18
+ // of the light; surfaces are lit from -direction. Color is packed sRgb-albedo RGBA (0xrrggbbaa);
19
+ // defaults to opaque white at unit intensity, pointing straight down (0, -1, 0) with shadows off.
20
+ export function createDirectionalLight(options) {
21
+ const direction = options?.direction;
22
+ return createEntity({
23
+ castsShadow: options?.castsShadow ?? false,
24
+ color: options?.color ?? 0xffffffff,
25
+ direction: direction ? cloneVector3(direction) : createVector3(0, -1, 0),
26
+ intensity: options?.intensity ?? 1,
27
+ kind: DirectionalLightKind,
28
+ normalBias: options?.normalBias ?? 0,
29
+ pcfRadius: options?.pcfRadius ?? 0,
30
+ shadowBias: options?.shadowBias ?? 0,
31
+ });
32
+ }
33
+ // Writes a normalized direction into `out.direction`. Normalizes the supplied x/y/z components
34
+ // before storing so the renderer can rely on a unit-length direction. Alias-safe.
35
+ export function setDirectionalLightDirection(out, x, y, z) {
36
+ // Read into locals for alias safety (out.direction may alias inputs through pooling).
37
+ const lx = x;
38
+ const ly = y;
39
+ const lz = z;
40
+ const len = Math.sqrt(lx * lx + ly * ly + lz * lz);
41
+ if (len > 0) {
42
+ setVector3(out.direction, lx / len, ly / len, lz / len);
43
+ }
44
+ }
45
+ // Writes the normalized direction from `fromX,fromY,fromZ` toward `toX,toY,toZ` into the
46
+ // light's `direction`. The direction vector is normalized before storing. Alias-safe.
47
+ export function setDirectionalLightTarget(out, fromX, fromY, fromZ, toX, toY, toZ) {
48
+ const dx = toX - fromX;
49
+ const dy = toY - fromY;
50
+ const dz = toZ - fromZ;
51
+ const len = Math.sqrt(dx * dx + dy * dy + dz * dz);
52
+ if (len > 0) {
53
+ setVector3(out.direction, dx / len, dy / len, dz / len);
54
+ }
55
+ }
56
+ //# sourceMappingURL=directionalLight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directionalLight.js","sourceRoot":"","sources":["../src/directionalLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAYvD,wFAAwF;AACxF,MAAM,UAAU,qBAAqB,CAAC,MAAkC;IACtE,OAAO,YAAY,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC;QACzC,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,IAAI,EAAE,oBAAoB;QAC1B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;KAC9B,CAAC,CAAC;AACL,CAAC;AAED,8FAA8F;AAC9F,iGAAiG;AACjG,kGAAkG;AAClG,MAAM,UAAU,sBAAsB,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X,GAAW;IAEX,MAAM,EAAE,GAAG,GAAG,GAAG,KAAK,CAAC;IACvB,MAAM,EAAE,GAAG,GAAG,GAAG,KAAK,CAAC;IACvB,MAAM,EAAE,GAAG,GAAG,GAAG,KAAK,CAAC;IACvB,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACnD,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;QACZ,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,GAAG,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,EAAE,GAAG,GAAG,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { CubeTexture, Environment } from '@flighthq/types';
2
+ export interface EnvironmentOptions {
3
+ environment?: CubeTexture | null;
4
+ intensity?: number;
5
+ }
6
+ export declare function cloneEnvironment(source: Readonly<Environment>): Environment;
7
+ export declare function createEnvironment(options?: Readonly<EnvironmentOptions>): Environment;
8
+ //# sourceMappingURL=environment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGhE,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,WAAW,CAE3E;AAKD,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAAG,WAAW,CAMrF"}
@@ -0,0 +1,18 @@
1
+ import { createEntity } from '@flighthq/entity';
2
+ import { EnvironmentKind } from '@flighthq/types';
3
+ // Independent copy of the environment's data. The `environment` cubemap reference is shared, not
4
+ // deep-copied: a CubeTexture is a GPU-backed resource, so the copy aliases the same source.
5
+ export function cloneEnvironment(source) {
6
+ return createEnvironment({ environment: source.environment, intensity: source.intensity });
7
+ }
8
+ // Image-based environment lighting + skybox source. `environment` is the radiance cubemap used
9
+ // for the skybox and as the IBL specular/irradiance source; `intensity` scales its contribution.
10
+ // Defaults to no cubemap (null) at unit intensity.
11
+ export function createEnvironment(options) {
12
+ return createEntity({
13
+ environment: options?.environment ?? null,
14
+ intensity: options?.intensity ?? 1,
15
+ kind: EnvironmentKind,
16
+ });
17
+ }
18
+ //# sourceMappingURL=environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAOlD,iGAAiG;AACjG,4FAA4F;AAC5F,MAAM,UAAU,gBAAgB,CAAC,MAA6B;IAC5D,OAAO,iBAAiB,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;AAC7F,CAAC;AAED,+FAA+F;AAC/F,iGAAiG;AACjG,mDAAmD;AACnD,MAAM,UAAU,iBAAiB,CAAC,OAAsC;IACtE,OAAO,YAAY,CAAC;QAClB,WAAW,EAAE,OAAO,EAAE,WAAW,IAAI,IAAI;QACzC,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,CAAC;QAClC,IAAI,EAAE,eAAe;KACtB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { HemisphereLight } from '@flighthq/types';
2
+ export interface HemisphereLightOptions {
3
+ groundColor?: number;
4
+ intensity?: number;
5
+ skyColor?: number;
6
+ }
7
+ export declare function cloneHemisphereLight(source: Readonly<HemisphereLight>): HemisphereLight;
8
+ export declare function createHemisphereLight(options?: Readonly<HemisphereLightOptions>): HemisphereLight;
9
+ //# sourceMappingURL=hemisphereLight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hemisphereLight.d.ts","sourceRoot":"","sources":["../src/hemisphereLight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD,MAAM,WAAW,sBAAsB;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAGD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG,eAAe,CAMvF;AAKD,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,sBAAsB,CAAC,GAAG,eAAe,CAOjG"}
@@ -0,0 +1,22 @@
1
+ import { createEntity } from '@flighthq/entity';
2
+ import { HemisphereLightKind } from '@flighthq/types';
3
+ // Independent copy of a hemisphere light's data. The `kind` discriminant is carried over.
4
+ export function cloneHemisphereLight(source) {
5
+ return createHemisphereLight({
6
+ groundColor: source.groundColor,
7
+ intensity: source.intensity,
8
+ skyColor: source.skyColor,
9
+ });
10
+ }
11
+ // Gradient ambient: `skyColor` from above, `groundColor` from below, blended by the surface
12
+ // normal's vertical component. Colors are packed sRgb-albedo RGBA (0xrrggbbaa); both default to
13
+ // opaque white at unit intensity. Hemisphere lights do not cast shadows.
14
+ export function createHemisphereLight(options) {
15
+ return createEntity({
16
+ groundColor: options?.groundColor ?? 0xffffffff,
17
+ intensity: options?.intensity ?? 1,
18
+ kind: HemisphereLightKind,
19
+ skyColor: options?.skyColor ?? 0xffffffff,
20
+ });
21
+ }
22
+ //# sourceMappingURL=hemisphereLight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hemisphereLight.js","sourceRoot":"","sources":["../src/hemisphereLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAQtD,0FAA0F;AAC1F,MAAM,UAAU,oBAAoB,CAAC,MAAiC;IACpE,OAAO,qBAAqB,CAAC;QAC3B,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B,CAAC,CAAC;AACL,CAAC;AAED,4FAA4F;AAC5F,gGAAgG;AAChG,yEAAyE;AACzE,MAAM,UAAU,qBAAqB,CAAC,OAA0C;IAC9E,OAAO,YAAY,CAAC;QAClB,WAAW,EAAE,OAAO,EAAE,WAAW,IAAI,UAAU;QAC/C,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,CAAC;QAClC,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,OAAO,EAAE,QAAQ,IAAI,UAAU;KAC1C,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,10 @@
1
+ export * from './ambientLight';
2
+ export * from './areaLight';
3
+ export * from './colorFromKelvin';
4
+ export * from './directionalLight';
5
+ export * from './environment';
6
+ export * from './hemisphereLight';
7
+ export * from './lightAnalysis';
8
+ export * from './pointLight';
9
+ export * from './spotLight';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ export * from './ambientLight';
2
+ export * from './areaLight';
3
+ export * from './colorFromKelvin';
4
+ export * from './directionalLight';
5
+ export * from './environment';
6
+ export * from './hemisphereLight';
7
+ export * from './lightAnalysis';
8
+ export * from './pointLight';
9
+ export * from './spotLight';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { BoundingSphereLike, Light } from '@flighthq/types';
2
+ export declare function getLightInfluenceBounds(out: BoundingSphereLike, light: Readonly<Light>): void;
3
+ export declare function getLightLuminance(light: Readonly<Light>): number;
4
+ export declare function hasLightInfluenceOnBounds(light: Readonly<Light>, bounds: Readonly<BoundingSphereLike>): boolean;
5
+ export declare function isLightShadowCasting(light: Readonly<Light>): boolean;
6
+ //# sourceMappingURL=lightAnalysis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lightAnalysis.d.ts","sourceRoot":"","sources":["../src/lightAnalysis.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAc,MAAM,iBAAiB,CAAC;AAe7E,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAqC7F;AAMD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,MAAM,CAUhE;AAMD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAc/G;AAID,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,OAAO,CAMpE"}
@@ -0,0 +1,91 @@
1
+ import { createBoundingSphere } from '@flighthq/geometry';
2
+ import { AmbientLightKind, AreaLightKind, DirectionalLightKind, EnvironmentKind, HemisphereLightKind, PointLightKind, SpotLightKind, } from '@flighthq/types';
3
+ // Writes the world-space influence bounding sphere of a light into `out`. The sphere bounds the
4
+ // region the light can illuminate. Lights with a finite `range` produce a sphere centered at
5
+ // `position` with `radius = range`. Non-spatial lights (ambient, hemisphere, environment) and
6
+ // infinite-range spatial lights produce a sentinel sphere with `radius = -1` (unlimited reach).
7
+ export function getLightInfluenceBounds(out, light) {
8
+ const kind = light.kind;
9
+ if (kind === AmbientLightKind ||
10
+ kind === HemisphereLightKind ||
11
+ kind === EnvironmentKind ||
12
+ kind === DirectionalLightKind) {
13
+ // Non-spatial or infinite-reach lights — sentinel radius.
14
+ out.center.x = 0;
15
+ out.center.y = 0;
16
+ out.center.z = 0;
17
+ out.radius = -1;
18
+ return;
19
+ }
20
+ if (kind === PointLightKind || kind === SpotLightKind || kind === AreaLightKind) {
21
+ const spatial = light;
22
+ const range = spatial.range;
23
+ if (range < 0) {
24
+ // Infinite range — sentinel.
25
+ out.center.x = 0;
26
+ out.center.y = 0;
27
+ out.center.z = 0;
28
+ out.radius = -1;
29
+ return;
30
+ }
31
+ out.center.x = spatial.position.x;
32
+ out.center.y = spatial.position.y;
33
+ out.center.z = spatial.position.z;
34
+ out.radius = range;
35
+ return;
36
+ }
37
+ // Unknown light kind — sentinel.
38
+ out.center.x = 0;
39
+ out.center.y = 0;
40
+ out.center.z = 0;
41
+ out.radius = -1;
42
+ }
43
+ // Returns the perceptual luminance of a light's color × intensity. The luminance is computed
44
+ // from the packed sRgb-albedo RGBA color using the standard ITU-R BT.709 coefficients, then
45
+ // scaled by `intensity`. Useful for ranking lights by visual importance when prioritizing a
46
+ // forward-light budget.
47
+ export function getLightLuminance(light) {
48
+ const colored = light;
49
+ const color = colored.color;
50
+ if (color === undefined)
51
+ return 0;
52
+ const r = ((color >>> 24) & 0xff) / 255;
53
+ const g = ((color >>> 16) & 0xff) / 255;
54
+ const b = ((color >>> 8) & 0xff) / 255;
55
+ const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;
56
+ const intensity = colored.intensity ?? 1;
57
+ return luma * intensity;
58
+ }
59
+ // Returns true when `light` could influence a point within `bounds`. Non-spatial lights (ambient,
60
+ // hemisphere, directional, environment) and infinite-range lights always return true. For spatial
61
+ // lights with a finite range, tests whether the influence sphere intersects `bounds` using a
62
+ // sphere-sphere overlap test. An empty `bounds` (radius < 0) is treated as no overlap.
63
+ export function hasLightInfluenceOnBounds(light, bounds) {
64
+ // Use module-level scratch to avoid per-call allocation.
65
+ getLightInfluenceBounds(scratchSphere, light);
66
+ // Sentinel radius (-1) = unlimited reach.
67
+ if (scratchSphere.radius < 0)
68
+ return true;
69
+ // Empty bounds — treat as no overlap.
70
+ if (bounds.radius < 0)
71
+ return false;
72
+ // Sphere-sphere overlap: distance between centers <= sum of radii.
73
+ const dx = scratchSphere.center.x - bounds.center.x;
74
+ const dy = scratchSphere.center.y - bounds.center.y;
75
+ const dz = scratchSphere.center.z - bounds.center.z;
76
+ const distSq = dx * dx + dy * dy + dz * dz;
77
+ const radSum = scratchSphere.radius + bounds.radius;
78
+ return distSq <= radSum * radSum;
79
+ }
80
+ // Returns true when the light is configured to cast shadows. Non-shadow-capable light types
81
+ // (AmbientLight, HemisphereLight, Environment) always return false.
82
+ export function isLightShadowCasting(light) {
83
+ const kind = light.kind;
84
+ if (kind === AmbientLightKind || kind === HemisphereLightKind || kind === EnvironmentKind) {
85
+ return false;
86
+ }
87
+ return light.castsShadow;
88
+ }
89
+ // Scratch sphere used by hasLightInfluenceOnBounds to avoid per-call allocation.
90
+ const scratchSphere = createBoundingSphere(0, 0, 0, -1);
91
+ //# sourceMappingURL=lightAnalysis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lightAnalysis.js","sourceRoot":"","sources":["../src/lightAnalysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAC;AAEzB,gGAAgG;AAChG,6FAA6F;AAC7F,8FAA8F;AAC9F,gGAAgG;AAChG,MAAM,UAAU,uBAAuB,CAAC,GAAuB,EAAE,KAAsB;IACrF,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACxB,IACE,IAAI,KAAK,gBAAgB;QACzB,IAAI,KAAK,mBAAmB;QAC5B,IAAI,KAAK,eAAe;QACxB,IAAI,KAAK,oBAAoB,EAC7B,CAAC;QACD,0DAA0D;QAC1D,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;QACjB,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;QACjB,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;QACjB,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAChB,OAAO;IACT,CAAC;IACD,IAAI,IAAI,KAAK,cAAc,IAAI,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,aAAa,EAAE,CAAC;QAChF,MAAM,OAAO,GAAG,KAA6B,CAAC;QAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACd,6BAA6B;YAC7B,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;YACjB,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;YACjB,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,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AC;IACf,CAAC;IACD,OAAQ,KAAuD,CAAC,WAAW,CAAC;AAC9E,CAAC;AAED,iFAAiF;AACjF,MAAM,aAAa,GAAG,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { PointLight, Vector3Like } from '@flighthq/types';
2
+ export interface PointLightOptions {
3
+ castsShadow?: boolean;
4
+ color?: number;
5
+ intensity?: number;
6
+ normalBias?: number;
7
+ pcfRadius?: number;
8
+ position?: Readonly<Vector3Like>;
9
+ range?: number;
10
+ shadowBias?: number;
11
+ }
12
+ export declare function clonePointLight(source: Readonly<PointLight>): PointLight;
13
+ export declare function createPointLight(options?: Readonly<PointLightOptions>): PointLight;
14
+ //# sourceMappingURL=pointLight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointLight.d.ts","sourceRoot":"","sources":["../src/pointLight.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG/D,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,UAAU,CAYxE;AAKD,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,UAAU,CAalF"}
@@ -0,0 +1,35 @@
1
+ import { createEntity } from '@flighthq/entity';
2
+ import { cloneVector3, createVector3 } from '@flighthq/geometry';
3
+ import { PointLightKind } from '@flighthq/types';
4
+ // Independent copy of a point light's data, including a fresh `position` vector.
5
+ export function clonePointLight(source) {
6
+ return createEntity({
7
+ castsShadow: source.castsShadow,
8
+ color: source.color,
9
+ intensity: source.intensity,
10
+ kind: PointLightKind,
11
+ normalBias: source.normalBias,
12
+ pcfRadius: source.pcfRadius,
13
+ position: cloneVector3(source.position),
14
+ range: source.range,
15
+ shadowBias: source.shadowBias,
16
+ });
17
+ }
18
+ // Omnidirectional point light. `position` is world-space; intensity falls off with distance up
19
+ // to `range` (-1 = infinite). Color is packed sRgb-albedo RGBA (0xrrggbbaa); defaults to opaque
20
+ // white at unit intensity, at the origin, infinite range, shadows off.
21
+ export function createPointLight(options) {
22
+ const position = options?.position;
23
+ return createEntity({
24
+ castsShadow: options?.castsShadow ?? false,
25
+ color: options?.color ?? 0xffffffff,
26
+ intensity: options?.intensity ?? 1,
27
+ kind: PointLightKind,
28
+ normalBias: options?.normalBias ?? 0,
29
+ pcfRadius: options?.pcfRadius ?? 0,
30
+ position: position ? cloneVector3(position) : createVector3(0, 0, 0),
31
+ range: options?.range ?? -1,
32
+ shadowBias: options?.shadowBias ?? 0,
33
+ });
34
+ }
35
+ //# sourceMappingURL=pointLight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointLight.js","sourceRoot":"","sources":["../src/pointLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAajD,iFAAiF;AACjF,MAAM,UAAU,eAAe,CAAC,MAA4B;IAC1D,OAAO,YAAY,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,IAAI,EAAE,cAAc;QACpB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC;QACvC,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,UAAU,EAAE,MAAM,CAAC,UAAU;KAC9B,CAAC,CAAC;AACL,CAAC;AAED,+FAA+F;AAC/F,gGAAgG;AAChG,uEAAuE;AACvE,MAAM,UAAU,gBAAgB,CAAC,OAAqC;IACpE,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,CAAC;IACnC,OAAO,YAAY,CAAC;QAClB,WAAW,EAAE,OAAO,EAAE,WAAW,IAAI,KAAK;QAC1C,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,UAAU;QACnC,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,CAAC;QAClC,IAAI,EAAE,cAAc;QACpB,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,CAAC;QACpC,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,CAAC;QAClC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACpE,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC,CAAC;QAC3B,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,CAAC;KACrC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { SpotLight, Vector3Like } from '@flighthq/types';
2
+ export interface SpotLightConeAngles {
3
+ innerDegrees: number;
4
+ outerDegrees: number;
5
+ }
6
+ export interface SpotLightOptions {
7
+ castsShadow?: boolean;
8
+ color?: number;
9
+ direction?: Readonly<Vector3Like>;
10
+ innerConeDegrees?: number;
11
+ intensity?: number;
12
+ normalBias?: number;
13
+ outerConeDegrees?: number;
14
+ pcfRadius?: number;
15
+ position?: Readonly<Vector3Like>;
16
+ range?: number;
17
+ shadowBias?: number;
18
+ }
19
+ export declare function cloneSpotLight(source: Readonly<SpotLight>): SpotLight;
20
+ export declare function createSpotLight(options?: Readonly<SpotLightOptions>): SpotLight;
21
+ export declare function getSpotLightConeDegrees(out: SpotLightConeAngles, source: Readonly<SpotLight>): void;
22
+ export declare function setSpotLightCone(out: SpotLight, innerDegrees: number, outerDegrees: number): void;
23
+ export declare function setSpotLightDirection(out: SpotLight, x: number, y: number, z: number): void;
24
+ export declare function setSpotLightTarget(out: SpotLight, targetX: number, targetY: number, targetZ: number): void;
25
+ //# sourceMappingURL=spotLight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spotLight.d.ts","sourceRoot":"","sources":["../src/spotLight.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9D,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAElC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,wBAAgB,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,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