@flighthq/lighting 0.5.1-next.904.b545d9c → 0.5.1-next.905.5fbf787
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/README.md +2 -2
- package/package.json +5 -5
- package/src/ambientLight.test.ts +6 -1
- package/src/areaLight.test.ts +6 -1
- package/src/directionalLight.test.ts +7 -1
- package/src/environment.test.ts +6 -1
- package/src/hemisphereLight.test.ts +6 -1
- package/src/pointLight.test.ts +6 -1
- package/src/sceneLights.test.ts +6 -1
- package/src/spotLight.test.ts +7 -1
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/lighting`. The `@fli
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/lighting@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/lighting@0.5.1-next.905.5fbf787](https://github.com/flighthq/flight/tree/5fbf7874064c384307542d68b4dcb6a895ff0dcf/packages/lighting)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/5fbf7874064c384307542d68b4dcb6a895ff0dcf/LICENSE.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/lighting",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.905.5fbf787",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/color": "0.5.1-next.
|
|
42
|
-
"@flighthq/entity": "0.5.1-next.
|
|
43
|
-
"@flighthq/geometry": "0.5.1-next.
|
|
44
|
-
"@flighthq/types": "0.5.1-next.
|
|
41
|
+
"@flighthq/color": "0.5.1-next.905.5fbf787",
|
|
42
|
+
"@flighthq/entity": "0.5.1-next.905.5fbf787",
|
|
43
|
+
"@flighthq/geometry": "0.5.1-next.905.5fbf787",
|
|
44
|
+
"@flighthq/types": "0.5.1-next.905.5fbf787"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"typescript": "^5.3.0"
|
package/src/ambientLight.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AmbientLightKind, LuxLightUnit, UnitlessLightUnit } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import { cloneAmbientLight, createAmbientLight } from './ambientLight';
|
|
3
|
+
import { cloneAmbientLight, createAmbientLight, initializeAmbientLight } from './ambientLight';
|
|
4
4
|
|
|
5
5
|
describe('cloneAmbientLight', () => {
|
|
6
6
|
it('creates an independent copy with the same fields', () => {
|
|
@@ -38,3 +38,8 @@ describe('createAmbientLight', () => {
|
|
|
38
38
|
expect(light.intensityUnit).toBe(LuxLightUnit);
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
|
+
describe('initializeAmbientLight', () => {
|
|
42
|
+
it('is the construction initializer of createAmbientLight', () => {
|
|
43
|
+
expect(typeof initializeAmbientLight).toBe('function');
|
|
44
|
+
});
|
|
45
|
+
});
|
package/src/areaLight.test.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createVector3 } from '@flighthq/geometry/contract';
|
|
2
2
|
import { AreaLightKind, LumenLightUnit, UnitlessLightUnit } from '@flighthq/types/contract';
|
|
3
3
|
|
|
4
|
-
import { cloneAreaLight, createAreaLight, setAreaLightOrientation } from './areaLight';
|
|
4
|
+
import { cloneAreaLight, createAreaLight, initializeAreaLight, setAreaLightOrientation } from './areaLight';
|
|
5
5
|
|
|
6
6
|
describe('cloneAreaLight', () => {
|
|
7
7
|
it('creates an independent copy with fresh position/direction/right/up vectors', () => {
|
|
@@ -88,6 +88,11 @@ describe('createAreaLight', () => {
|
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
+
describe('initializeAreaLight', () => {
|
|
92
|
+
it('is the construction initializer of createAreaLight', () => {
|
|
93
|
+
expect(typeof initializeAreaLight).toBe('function');
|
|
94
|
+
});
|
|
95
|
+
});
|
|
91
96
|
describe('setAreaLightOrientation', () => {
|
|
92
97
|
it('updates the direction, right, and up axes while preserving half-extent lengths', () => {
|
|
93
98
|
// right has length 3, up has length 4 — half-extents should survive the orientation update.
|
|
@@ -4,6 +4,7 @@ import { DirectionalLightKind, LuxLightUnit, UnitlessLightUnit } from '@flighthq
|
|
|
4
4
|
import {
|
|
5
5
|
cloneDirectionalLight,
|
|
6
6
|
createDirectionalLight,
|
|
7
|
+
initializeDirectionalLight,
|
|
7
8
|
setDirectionalLightDirection,
|
|
8
9
|
setDirectionalLightTarget,
|
|
9
10
|
} from './directionalLight';
|
|
@@ -94,6 +95,12 @@ describe('createDirectionalLight', () => {
|
|
|
94
95
|
});
|
|
95
96
|
});
|
|
96
97
|
|
|
98
|
+
describe('initializeDirectionalLight', () => {
|
|
99
|
+
it('is the construction initializer of createDirectionalLight', () => {
|
|
100
|
+
expect(typeof initializeDirectionalLight).toBe('function');
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
97
104
|
describe('setDirectionalLightDirection', () => {
|
|
98
105
|
it('writes a normalized direction into the light', () => {
|
|
99
106
|
const light = createDirectionalLight();
|
|
@@ -109,7 +116,6 @@ describe('setDirectionalLightDirection', () => {
|
|
|
109
116
|
expect(light.direction.y).toBeCloseTo(-1, 6);
|
|
110
117
|
});
|
|
111
118
|
});
|
|
112
|
-
|
|
113
119
|
describe('setDirectionalLightTarget', () => {
|
|
114
120
|
it('sets direction toward the target from the from-point', () => {
|
|
115
121
|
const light = createDirectionalLight();
|
package/src/environment.test.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { createVector2 } from '@flighthq/geometry/contract';
|
|
|
3
3
|
import type { Texture, Sampler } from '@flighthq/types/contract';
|
|
4
4
|
import { EnvironmentKind } from '@flighthq/types/contract';
|
|
5
5
|
|
|
6
|
-
import { cloneEnvironment, createEnvironment } from './environment';
|
|
6
|
+
import { cloneEnvironment, createEnvironment, initializeEnvironment } from './environment';
|
|
7
7
|
|
|
8
8
|
function createTestCubeTexture(): Texture {
|
|
9
9
|
const sampler = allocateEntity<any>();
|
|
@@ -57,3 +57,8 @@ describe('createEnvironment', () => {
|
|
|
57
57
|
expect(environment.intensity).toBe(2);
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
|
+
describe('initializeEnvironment', () => {
|
|
61
|
+
it('is the construction initializer of createEnvironment', () => {
|
|
62
|
+
expect(typeof initializeEnvironment).toBe('function');
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HemisphereLightKind, LuxLightUnit, UnitlessLightUnit } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import { cloneHemisphereLight, createHemisphereLight } from './hemisphereLight';
|
|
3
|
+
import { cloneHemisphereLight, createHemisphereLight, initializeHemisphereLight } from './hemisphereLight';
|
|
4
4
|
|
|
5
5
|
describe('cloneHemisphereLight', () => {
|
|
6
6
|
it('creates an independent copy with the same fields', () => {
|
|
@@ -39,3 +39,8 @@ describe('createHemisphereLight', () => {
|
|
|
39
39
|
expect(light.skyColor).toBe(0x0000ffff);
|
|
40
40
|
});
|
|
41
41
|
});
|
|
42
|
+
describe('initializeHemisphereLight', () => {
|
|
43
|
+
it('is the construction initializer of createHemisphereLight', () => {
|
|
44
|
+
expect(typeof initializeHemisphereLight).toBe('function');
|
|
45
|
+
});
|
|
46
|
+
});
|
package/src/pointLight.test.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createVector3 } from '@flighthq/geometry/contract';
|
|
2
2
|
import { CandelaLightUnit, PointLightKind, UnitlessLightUnit } from '@flighthq/types/contract';
|
|
3
3
|
|
|
4
|
-
import { clonePointLight, createPointLight } from './pointLight';
|
|
4
|
+
import { clonePointLight, createPointLight, initializePointLight } from './pointLight';
|
|
5
5
|
|
|
6
6
|
describe('clonePointLight', () => {
|
|
7
7
|
it('creates an independent copy with a fresh position vector', () => {
|
|
@@ -74,3 +74,8 @@ describe('createPointLight', () => {
|
|
|
74
74
|
expect(light.position.y).toBe(2);
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
|
+
describe('initializePointLight', () => {
|
|
78
|
+
it('is the construction initializer of createPointLight', () => {
|
|
79
|
+
expect(typeof initializePointLight).toBe('function');
|
|
80
|
+
});
|
|
81
|
+
});
|
package/src/sceneLights.test.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { describe, expect, it } from 'vitest';
|
|
|
4
4
|
import { createAmbientLight } from './ambientLight';
|
|
5
5
|
import { createDirectionalLight } from './directionalLight';
|
|
6
6
|
import { createPointLight } from './pointLight';
|
|
7
|
-
import { createScene3DLights } from './sceneLights';
|
|
7
|
+
import { createScene3DLights, initializeScene3DLights } from './sceneLights';
|
|
8
8
|
|
|
9
9
|
describe('createScene3DLights', () => {
|
|
10
10
|
it('fills every absent slot — singles to null, punctual arrays to empty', () => {
|
|
@@ -36,3 +36,8 @@ describe('createScene3DLights', () => {
|
|
|
36
36
|
expect(lights.directional).toBe(directional);
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
|
+
describe('initializeScene3DLights', () => {
|
|
40
|
+
it('is the construction initializer of createScene3DLights', () => {
|
|
41
|
+
expect(typeof initializeScene3DLights).toBe('function');
|
|
42
|
+
});
|
|
43
|
+
});
|
package/src/spotLight.test.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
cloneSpotLight,
|
|
6
6
|
createSpotLight,
|
|
7
7
|
getSpotLightConeDegrees,
|
|
8
|
+
initializeSpotLight,
|
|
8
9
|
setSpotLightBlend,
|
|
9
10
|
setSpotLightCone,
|
|
10
11
|
setSpotLightDirection,
|
|
@@ -125,6 +126,12 @@ describe('getSpotLightConeDegrees', () => {
|
|
|
125
126
|
});
|
|
126
127
|
});
|
|
127
128
|
|
|
129
|
+
describe('initializeSpotLight', () => {
|
|
130
|
+
it('is the construction initializer of createSpotLight', () => {
|
|
131
|
+
expect(typeof initializeSpotLight).toBe('function');
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
128
135
|
describe('setSpotLightBlend', () => {
|
|
129
136
|
it('stores a blend within the normalized range', () => {
|
|
130
137
|
const light = createSpotLight();
|
|
@@ -171,7 +178,6 @@ describe('setSpotLightDirection', () => {
|
|
|
171
178
|
expect(light.direction.y).toBeCloseTo(-1, 6);
|
|
172
179
|
});
|
|
173
180
|
});
|
|
174
|
-
|
|
175
181
|
describe('setSpotLightTarget', () => {
|
|
176
182
|
it('sets direction from position toward target', () => {
|
|
177
183
|
const light = createSpotLight({ position: createVector3(0, 0, 0) });
|