@kiberon-labs/behave-graph-scene 1.0.0 → 1.0.1

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 (136) hide show
  1. package/.turbo/turbo-build.log +7 -0
  2. package/LICENSE +6 -0
  3. package/README.md +13 -0
  4. package/dist/Abstractions/Drivers/DummyScene.d.ts +20 -0
  5. package/dist/Abstractions/Drivers/DummyScene.d.ts.map +1 -0
  6. package/dist/Abstractions/Drivers/DummyScene.js +58 -0
  7. package/dist/Abstractions/Drivers/DummyScene.js.map +1 -0
  8. package/dist/Abstractions/IScene.d.ts +16 -0
  9. package/dist/Abstractions/IScene.d.ts.map +1 -0
  10. package/dist/GLTFJson.d.ts +33 -0
  11. package/dist/GLTFJson.d.ts.map +1 -0
  12. package/dist/Nodes/Actions/EaseSceneProperty.d.ts +23 -0
  13. package/dist/Nodes/Actions/EaseSceneProperty.d.ts.map +1 -0
  14. package/dist/Nodes/Actions/EaseSceneProperty.js +73 -0
  15. package/dist/Nodes/Actions/EaseSceneProperty.js.map +1 -0
  16. package/dist/Nodes/Actions/SetSceneProperty.d.ts +5 -0
  17. package/dist/Nodes/Actions/SetSceneProperty.d.ts.map +1 -0
  18. package/dist/Nodes/Actions/SetSceneProperty.js +28 -0
  19. package/dist/Nodes/Actions/SetSceneProperty.js.map +1 -0
  20. package/dist/Nodes/Events/OnSceneNodeClick.d.ts +5 -0
  21. package/dist/Nodes/Events/OnSceneNodeClick.d.ts.map +1 -0
  22. package/dist/Nodes/Events/OnSceneNodeClick.js +39 -0
  23. package/dist/Nodes/Events/OnSceneNodeClick.js.map +1 -0
  24. package/dist/Nodes/Logic/ColorNodes.d.ts +19 -0
  25. package/dist/Nodes/Logic/ColorNodes.d.ts.map +1 -0
  26. package/dist/Nodes/Logic/ColorNodes.js +137 -0
  27. package/dist/Nodes/Logic/ColorNodes.js.map +1 -0
  28. package/dist/Nodes/Logic/EulerNodes.d.ts +18 -0
  29. package/dist/Nodes/Logic/EulerNodes.d.ts.map +1 -0
  30. package/dist/Nodes/Logic/EulerNodes.js +132 -0
  31. package/dist/Nodes/Logic/EulerNodes.js.map +1 -0
  32. package/dist/Nodes/Logic/Mat3Nodes.d.ts +28 -0
  33. package/dist/Nodes/Logic/Mat3Nodes.d.ts.map +1 -0
  34. package/dist/Nodes/Logic/Mat3Nodes.js +213 -0
  35. package/dist/Nodes/Logic/Mat3Nodes.js.map +1 -0
  36. package/dist/Nodes/Logic/Mat4Nodes.d.ts +34 -0
  37. package/dist/Nodes/Logic/Mat4Nodes.d.ts.map +1 -0
  38. package/dist/Nodes/Logic/Mat4Nodes.js +267 -0
  39. package/dist/Nodes/Logic/Mat4Nodes.js.map +1 -0
  40. package/dist/Nodes/Logic/QuatNodes.d.ts +24 -0
  41. package/dist/Nodes/Logic/QuatNodes.d.ts.map +1 -0
  42. package/dist/Nodes/Logic/QuatNodes.js +173 -0
  43. package/dist/Nodes/Logic/QuatNodes.js.map +1 -0
  44. package/dist/Nodes/Logic/Vec2Nodes.d.ts +18 -0
  45. package/dist/Nodes/Logic/Vec2Nodes.d.ts.map +1 -0
  46. package/dist/Nodes/Logic/Vec2Nodes.js +115 -0
  47. package/dist/Nodes/Logic/Vec2Nodes.js.map +1 -0
  48. package/dist/Nodes/Logic/Vec3Nodes.d.ts +19 -0
  49. package/dist/Nodes/Logic/Vec3Nodes.d.ts.map +1 -0
  50. package/dist/Nodes/Logic/Vec3Nodes.js +137 -0
  51. package/dist/Nodes/Logic/Vec3Nodes.js.map +1 -0
  52. package/dist/Nodes/Logic/Vec4Nodes.d.ts +18 -0
  53. package/dist/Nodes/Logic/Vec4Nodes.d.ts.map +1 -0
  54. package/dist/Nodes/Logic/Vec4Nodes.js +132 -0
  55. package/dist/Nodes/Logic/Vec4Nodes.js.map +1 -0
  56. package/dist/Nodes/Logic/VecElements.d.ts +9 -0
  57. package/dist/Nodes/Logic/VecElements.d.ts.map +1 -0
  58. package/dist/Nodes/Logic/VecElements.js +22 -0
  59. package/dist/Nodes/Logic/VecElements.js.map +1 -0
  60. package/dist/Nodes/Queries/GetSceneProperty.d.ts +5 -0
  61. package/dist/Nodes/Queries/GetSceneProperty.d.ts.map +1 -0
  62. package/dist/Nodes/Queries/GetSceneProperty.js +23 -0
  63. package/dist/Nodes/Queries/GetSceneProperty.js.map +1 -0
  64. package/dist/Values/ColorValue.d.ts +7 -0
  65. package/dist/Values/ColorValue.d.ts.map +1 -0
  66. package/dist/Values/ColorValue.js +20 -0
  67. package/dist/Values/ColorValue.js.map +1 -0
  68. package/dist/Values/EulerValue.d.ts +7 -0
  69. package/dist/Values/EulerValue.d.ts.map +1 -0
  70. package/dist/Values/EulerValue.js +20 -0
  71. package/dist/Values/EulerValue.js.map +1 -0
  72. package/dist/Values/Internal/Mat3.d.ts +43 -0
  73. package/dist/Values/Internal/Mat3.d.ts.map +1 -0
  74. package/dist/Values/Internal/Mat3.js +278 -0
  75. package/dist/Values/Internal/Mat3.js.map +1 -0
  76. package/dist/Values/Internal/Mat4.d.ts +53 -0
  77. package/dist/Values/Internal/Mat4.d.ts.map +1 -0
  78. package/dist/Values/Internal/Mat4.js +445 -0
  79. package/dist/Values/Internal/Mat4.js.map +1 -0
  80. package/dist/Values/Internal/Vec2.d.ts +25 -0
  81. package/dist/Values/Internal/Vec2.d.ts.map +1 -0
  82. package/dist/Values/Internal/Vec2.js +64 -0
  83. package/dist/Values/Internal/Vec2.js.map +1 -0
  84. package/dist/Values/Internal/Vec3.d.ts +38 -0
  85. package/dist/Values/Internal/Vec3.d.ts.map +1 -0
  86. package/dist/Values/Internal/Vec3.js +159 -0
  87. package/dist/Values/Internal/Vec3.js.map +1 -0
  88. package/dist/Values/Internal/Vec4.d.ts +49 -0
  89. package/dist/Values/Internal/Vec4.d.ts.map +1 -0
  90. package/dist/Values/Internal/Vec4.js +191 -0
  91. package/dist/Values/Internal/Vec4.js.map +1 -0
  92. package/dist/Values/Mat3Value.d.ts +7 -0
  93. package/dist/Values/Mat3Value.d.ts.map +1 -0
  94. package/dist/Values/Mat3Value.js +16 -0
  95. package/dist/Values/Mat3Value.js.map +1 -0
  96. package/dist/Values/Mat4Value.d.ts +7 -0
  97. package/dist/Values/Mat4Value.d.ts.map +1 -0
  98. package/dist/Values/Mat4Value.js +16 -0
  99. package/dist/Values/Mat4Value.js.map +1 -0
  100. package/dist/Values/QuatValue.d.ts +7 -0
  101. package/dist/Values/QuatValue.d.ts.map +1 -0
  102. package/dist/Values/QuatValue.js +21 -0
  103. package/dist/Values/QuatValue.js.map +1 -0
  104. package/dist/Values/Vec2Value.d.ts +7 -0
  105. package/dist/Values/Vec2Value.d.ts.map +1 -0
  106. package/dist/Values/Vec2Value.js +16 -0
  107. package/dist/Values/Vec2Value.js.map +1 -0
  108. package/dist/Values/Vec3Value.d.ts +7 -0
  109. package/dist/Values/Vec3Value.d.ts.map +1 -0
  110. package/dist/Values/Vec3Value.js +20 -0
  111. package/dist/Values/Vec3Value.js.map +1 -0
  112. package/dist/Values/Vec4Value.d.ts +7 -0
  113. package/dist/Values/Vec4Value.d.ts.map +1 -0
  114. package/dist/Values/Vec4Value.js +21 -0
  115. package/dist/Values/Vec4Value.js.map +1 -0
  116. package/dist/_virtual/rolldown_runtime.js +13 -0
  117. package/dist/buildScene.d.ts +74 -0
  118. package/dist/buildScene.d.ts.map +1 -0
  119. package/dist/buildScene.js +283 -0
  120. package/dist/buildScene.js.map +1 -0
  121. package/dist/index.d.ts +31 -0
  122. package/dist/index.js +31 -0
  123. package/dist/registerSceneProfile.d.ts +10 -0
  124. package/dist/registerSceneProfile.d.ts.map +1 -0
  125. package/dist/registerSceneProfile.js +78 -0
  126. package/dist/registerSceneProfile.js.map +1 -0
  127. package/package.json +19 -9
  128. package/src/Nodes/Logic/QuatNodes.ts +11 -11
  129. package/tests/graphs/logic/Color.json +53 -53
  130. package/tests/graphs/logic/Euler.json +53 -53
  131. package/tests/graphs/logic/Quaternion.json +56 -56
  132. package/tests/graphs/logic/Vector2.json +50 -50
  133. package/tests/graphs/logic/Vector3.json +53 -53
  134. package/tests/graphs/logic/Vector4.json +56 -56
  135. package/tests/tsconfig.json +10 -10
  136. package/tsconfig.json +54 -54
@@ -0,0 +1,7 @@
1
+
2
+ > @kiberon-labs/behave-graph-scene@1.0.1 build /home/runner/work/behave-graph/behave-graph/packages/scene
3
+ > tsdown
4
+
5
+ ℹ tsdown v0.16.5 powered by rolldown v1.0.0-beta.50
6
+ ℹ Using tsdown config: /home/runner/work/behave-graph/behave-graph/packages/scene/tsdown.config.ts
7
+ ℹ Build start
package/LICENSE ADDED
@@ -0,0 +1,6 @@
1
+ Internet Systems Consortium license
2
+ Copyright (c) 2022 behave-graph authors
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
5
+
6
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # Behave-Graph Scene
2
+
3
+ [![GitHub license](https://img.shields.io/npm/l/behave-graph-scene)](https://github.com/kiberon-labs/behave-graph/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/@kiberon-labs/behave-graph-scene)](https://www.npmjs.com/package/@kiberon-labs/behave-graph-scene)
4
+
5
+ This is a set of 3D nodes for threejs when working with [behave graphs](https://www.npmjs.com/package/@kiberon-labs/behave-graph)
6
+
7
+ ## Documentation
8
+
9
+ See the dedicated documentation site [here](https://kiberon-labs.github.io/behave-graph/)
10
+
11
+ ## Licence
12
+
13
+ ISC. See [here](./LICENSE)
@@ -0,0 +1,20 @@
1
+ import { IScene } from "../IScene.js";
2
+
3
+ //#region src/Abstractions/Drivers/DummyScene.d.ts
4
+ declare class DummyScene implements IScene {
5
+ onSceneChanged: any;
6
+ private valueRegistry;
7
+ constructor();
8
+ getProperty(jsonPath: string, valueTypeName: string): any;
9
+ setProperty(): void;
10
+ addOnClickedListener(jsonPath: string, callback: (jsonPath: string) => void): void;
11
+ removeOnClickedListener(jsonPath: string, callback: (jsonPath: string) => void): void;
12
+ getQueryableProperties(): never[];
13
+ getRaycastableProperties(): never[];
14
+ getProperties(): never[];
15
+ addOnSceneChangedListener(): void;
16
+ removeOnSceneChangedListener(): void;
17
+ }
18
+ //#endregion
19
+ export { DummyScene };
20
+ //# sourceMappingURL=DummyScene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DummyScene.d.ts","names":[],"sources":["../../../src/Abstractions/Drivers/DummyScene.ts"],"sourcesContent":[],"mappings":";;;cAiBa,UAAA,YAAsB;;EAAtB,QAAA,aAAW"}
@@ -0,0 +1,58 @@
1
+ import { ColorValue } from "../../Values/ColorValue.js";
2
+ import { EulerValue } from "../../Values/EulerValue.js";
3
+ import { QuatValue } from "../../Values/QuatValue.js";
4
+ import { Vec2Value } from "../../Values/Vec2Value.js";
5
+ import { Vec3Value } from "../../Values/Vec3Value.js";
6
+ import { Vec4Value } from "../../Values/Vec4Value.js";
7
+ import { BooleanValue, EventEmitter, FloatValue, IntegerValue, StringValue } from "@kiberon-labs/behave-graph";
8
+
9
+ //#region src/Abstractions/Drivers/DummyScene.ts
10
+ var DummyScene = class {
11
+ onSceneChanged = new EventEmitter();
12
+ valueRegistry;
13
+ constructor() {
14
+ this.valueRegistry = Object.fromEntries([
15
+ BooleanValue,
16
+ StringValue,
17
+ IntegerValue,
18
+ FloatValue,
19
+ Vec2Value,
20
+ Vec3Value,
21
+ Vec4Value,
22
+ ColorValue,
23
+ EulerValue,
24
+ QuatValue
25
+ ].map((valueType) => [valueType.name, valueType]));
26
+ }
27
+ getProperty(jsonPath, valueTypeName) {
28
+ return this.valueRegistry[valueTypeName]?.creator();
29
+ }
30
+ setProperty() {
31
+ this.onSceneChanged.emit();
32
+ }
33
+ addOnClickedListener(jsonPath, callback) {
34
+ console.log("added on clicked listener");
35
+ }
36
+ removeOnClickedListener(jsonPath, callback) {
37
+ console.log("removed on clicked listener");
38
+ }
39
+ getQueryableProperties() {
40
+ return [];
41
+ }
42
+ getRaycastableProperties() {
43
+ return [];
44
+ }
45
+ getProperties() {
46
+ return [];
47
+ }
48
+ addOnSceneChangedListener() {
49
+ console.log("added on scene changed listener");
50
+ }
51
+ removeOnSceneChangedListener() {
52
+ console.log("removed on scene changed listener");
53
+ }
54
+ };
55
+
56
+ //#endregion
57
+ export { DummyScene };
58
+ //# sourceMappingURL=DummyScene.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DummyScene.js","names":[],"sources":["../../../src/Abstractions/Drivers/DummyScene.ts"],"sourcesContent":["import {\n BooleanValue,\n EventEmitter,\n FloatValue,\n IntegerValue,\n StringValue,\n type ValueType\n} from '@kiberon-labs/behave-graph';\n\nimport { ColorValue } from '../../Values/ColorValue.js';\nimport { EulerValue } from '../../Values/EulerValue.js';\nimport { QuatValue } from '../../Values/QuatValue.js';\nimport { Vec2Value } from '../../Values/Vec2Value.js';\nimport { Vec3Value } from '../../Values/Vec3Value.js';\nimport { Vec4Value } from '../../Values/Vec4Value.js';\nimport type { IScene } from '../IScene.js';\n\nexport class DummyScene implements IScene {\n public onSceneChanged = new EventEmitter<void>();\n\n private valueRegistry: Record<string, ValueType>;\n\n constructor() {\n this.valueRegistry = Object.fromEntries(\n [\n BooleanValue,\n StringValue,\n IntegerValue,\n FloatValue,\n Vec2Value,\n Vec3Value,\n Vec4Value,\n ColorValue,\n EulerValue,\n QuatValue\n ].map((valueType) => [valueType.name, valueType])\n );\n // pull in value type nodes\n }\n\n getProperty(jsonPath: string, valueTypeName: string): any {\n return this.valueRegistry[valueTypeName]?.creator();\n }\n setProperty(): void {\n this.onSceneChanged.emit();\n }\n addOnClickedListener(\n jsonPath: string,\n callback: (jsonPath: string) => void\n ): void {\n console.log('added on clicked listener');\n }\n removeOnClickedListener(\n jsonPath: string,\n callback: (jsonPath: string) => void\n ): void {\n console.log('removed on clicked listener');\n }\n\n getQueryableProperties() {\n return [];\n }\n\n getRaycastableProperties() {\n return [];\n }\n\n getProperties() {\n return [];\n }\n\n addOnSceneChangedListener() {\n console.log('added on scene changed listener');\n }\n\n removeOnSceneChangedListener(): void {\n console.log('removed on scene changed listener');\n }\n}\n"],"mappings":";;;;;;;;;AAiBA,IAAa,aAAb,MAA0C;CACxC,AAAO,iBAAiB,IAAI,cAAoB;CAEhD,AAAQ;CAER,cAAc;AACZ,OAAK,gBAAgB,OAAO,YAC1B;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,KAAK,cAAc,CAAC,UAAU,MAAM,UAAU,CAAC,CAClD;;CAIH,YAAY,UAAkB,eAA4B;AACxD,SAAO,KAAK,cAAc,gBAAgB,SAAS;;CAErD,cAAoB;AAClB,OAAK,eAAe,MAAM;;CAE5B,qBACE,UACA,UACM;AACN,UAAQ,IAAI,4BAA4B;;CAE1C,wBACE,UACA,UACM;AACN,UAAQ,IAAI,8BAA8B;;CAG5C,yBAAyB;AACvB,SAAO,EAAE;;CAGX,2BAA2B;AACzB,SAAO,EAAE;;CAGX,gBAAgB;AACd,SAAO,EAAE;;CAGX,4BAA4B;AAC1B,UAAQ,IAAI,kCAAkC;;CAGhD,+BAAqC;AACnC,UAAQ,IAAI,oCAAoC"}
@@ -0,0 +1,16 @@
1
+ import { Choices } from "@kiberon-labs/behave-graph";
2
+
3
+ //#region src/Abstractions/IScene.d.ts
4
+ interface IScene {
5
+ getProperty(jsonPath: string, valueTypeName: string): any;
6
+ setProperty(jsonPath: string, valueTypeName: string, value: any): void;
7
+ addOnClickedListener(jsonPath: string, callback: (jsonPath: string) => void): void;
8
+ removeOnClickedListener(jsonPath: string, callback: (jsonPath: string) => void): void;
9
+ getRaycastableProperties: () => Choices;
10
+ getProperties: () => Choices;
11
+ addOnSceneChangedListener(listener: () => void): void;
12
+ removeOnSceneChangedListener(listener: () => void): void;
13
+ }
14
+ //#endregion
15
+ export { IScene };
16
+ //# sourceMappingURL=IScene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IScene.d.ts","names":[],"sources":["../../src/Abstractions/IScene.ts"],"sourcesContent":[],"mappings":";;;UAEiB,MAAA;;EAAA,WAAM,CAAA,QAWW,EAAA,MAAA,EACX,aAAO,EAAA,MAAA,EAAA,KAAA,EAAA,GAAA,CAAA,EAAA,IAAA;;;kCADI;uBACX"}
@@ -0,0 +1,33 @@
1
+ //#region src/GLTFJson.d.ts
2
+ type GLTFAssetJson = {
3
+ generator: string;
4
+ version: string;
5
+ };
6
+ type GLTFSceneJson = {
7
+ name: string;
8
+ nodes: number[];
9
+ };
10
+ type GLTFNodeJson = {
11
+ name?: string;
12
+ mesh?: number;
13
+ translation?: number[];
14
+ children?: number[];
15
+ };
16
+ type GLTFMaterialJson = {
17
+ name?: string;
18
+ doubleSided?: boolean;
19
+ };
20
+ type GLTFMeshJson = {
21
+ name?: string;
22
+ };
23
+ type GLTFJson = {
24
+ asset: GLTFAssetJson;
25
+ scene: number;
26
+ scenes: GLTFSceneJson[];
27
+ nodes: GLTFNodeJson[];
28
+ materials: GLTFMaterialJson[];
29
+ meshes: GLTFMeshJson[];
30
+ };
31
+ //#endregion
32
+ export { GLTFJson };
33
+ //# sourceMappingURL=GLTFJson.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GLTFJson.d.ts","names":[],"sources":["../src/GLTFJson.ts"],"sourcesContent":[],"mappings":";KAAY,aAAA;EAAA,SAAA,EAAA,MAAa;EAKb,OAAA,EAAA,MAAA;AAKZ,CAAA;AAOY,KAZA,aAAA,GAYgB;EAKhB,IAAA,EAAA,MAAA;EAIA,KAAA,EAAA,MAAQ,EAAA;CACX;AAEC,KAnBE,YAAA,GAmBF;EACD,IAAA,CAAA,EAAA,MAAA;EACI,IAAA,CAAA,EAAA,MAAA;EACH,WAAA,CAAA,EAAA,MAAA,EAAA;EAAY,QAAA,CAAA,EAAA,MAAA,EAAA;;KAfV,gBAAA;;;;KAKA,YAAA;;;KAIA,QAAA;SACH;;UAEC;SACD;aACI;UACH"}
@@ -0,0 +1,23 @@
1
+ import { IScene } from "../../Abstractions/IScene.js";
2
+ import { AsyncNode, Engine, IGraph, ILifecycleEventEmitter, NodeDescription } from "@kiberon-labs/behave-graph";
3
+
4
+ //#region src/Nodes/Actions/EaseSceneProperty.d.ts
5
+ declare class EaseSceneProperty extends AsyncNode {
6
+ static GetDescriptions(scene: IScene, lifecycleEventEmitter: ILifecycleEventEmitter, ...valueTypeNames: string[]): any[];
7
+ readonly valueTypeName: string;
8
+ private readonly scene;
9
+ private readonly lifecycleEventEmitter;
10
+ constructor(description: NodeDescription, graph: IGraph, valueTypeName: string, scene: IScene, lifecycleEventEmitter: ILifecycleEventEmitter, id: string);
11
+ private initialValue;
12
+ private targetValue;
13
+ private duration;
14
+ private elapsedDuration;
15
+ private easing;
16
+ private startTime;
17
+ private onTick;
18
+ triggered(engine: Engine, triggeringSocketName: string, finished: () => void): void;
19
+ dispose(): void;
20
+ }
21
+ //#endregion
22
+ export { EaseSceneProperty };
23
+ //# sourceMappingURL=EaseSceneProperty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EaseSceneProperty.d.ts","names":[],"sources":["../../../src/Nodes/Actions/EaseSceneProperty.ts"],"sourcesContent":[],"mappings":";;;;cAea,iBAAA,SAA0B,SAAA;gCAE5B,+BACgB;EAHd,SAAA,aAAkB,EAAA,MAAA;EAEpB,iBAAA,KAAA;EACgB,iBAAA,qBAAA;EA2BV,WAAA,CAAA,WAAA,EAAA,eAAA,EAAA,KAAA,EACN,MADM,EAAA,aAAA,EAAA,MAAA,EAAA,KAAA,EAGN,MAHM,EAAA,qBAAA,EAIU,sBAJV,EAAA,EAAA,EAAA,MAAA;EACN,QAAA,YAAA;EAEA,QAAA,WAAA;EACgB,QAAA,QAAA;EA6Cf,QAAA,eAAA;EA/E2B,QAAA,MAAA;EAAS,QAAA,SAAA;;oBA+EpC"}
@@ -0,0 +1,73 @@
1
+ import { AsyncNode, EasingFunctions, EasingModes, Engine, NodeDescription, Socket, toCamelCase } from "@kiberon-labs/behave-graph";
2
+
3
+ //#region src/Nodes/Actions/EaseSceneProperty.ts
4
+ var EaseSceneProperty = class EaseSceneProperty extends AsyncNode {
5
+ static GetDescriptions(scene, lifecycleEventEmitter, ...valueTypeNames) {
6
+ return valueTypeNames.map((valueTypeName) => new NodeDescription(`scene/ease/${valueTypeName}`, "Action", `Ease Scene ${toCamelCase(valueTypeName)}`, (description, graph, config, id) => new EaseSceneProperty(description, graph, valueTypeName, scene, lifecycleEventEmitter, id)));
7
+ }
8
+ valueTypeName;
9
+ scene;
10
+ lifecycleEventEmitter;
11
+ constructor(description, graph, valueTypeName, scene, lifecycleEventEmitter, id) {
12
+ super(description, graph, [
13
+ new Socket("flow", "flow"),
14
+ new Socket("string", "jsonPath"),
15
+ new Socket(valueTypeName, "value"),
16
+ new Socket("string", "easingFunction", "linear", void 0, Object.keys(EasingFunctions)),
17
+ new Socket("string", "easingMode", "inOut", void 0, Object.keys(EasingModes)),
18
+ new Socket("float", "easeDuration"),
19
+ new Socket("flow", "cancel")
20
+ ], [new Socket("flow", "flow")], {}, id);
21
+ this.valueTypeName = valueTypeName;
22
+ this.scene = scene;
23
+ this.lifecycleEventEmitter = lifecycleEventEmitter;
24
+ }
25
+ initialValue = void 0;
26
+ targetValue = void 0;
27
+ duration = 0;
28
+ elapsedDuration = 0;
29
+ easing = EasingFunctions["linear"];
30
+ startTime = 0;
31
+ onTick = void 0;
32
+ triggered(engine, triggeringSocketName, finished) {
33
+ if (triggeringSocketName === "cancel") {
34
+ this.dispose();
35
+ finished();
36
+ return;
37
+ }
38
+ if (this.elapsedDuration >= this.duration) return;
39
+ this.initialValue = this.scene.getProperty(this.readInput("jsonPath"), this.valueTypeName);
40
+ this.targetValue = this.readInput("value");
41
+ this.duration = this.readInput("duration");
42
+ this.elapsedDuration = 0;
43
+ this.startTime = Date.now();
44
+ const easingFunction = EasingFunctions[this.readInput("easingFunction")];
45
+ const easingMode = EasingModes[this.readInput("easingMode")];
46
+ this.easing = easingMode(easingFunction);
47
+ const updateOnTick = () => {
48
+ const valueType = this.graph.values[this.valueTypeName];
49
+ this.elapsedDuration = (Date.now() - this.startTime) / 1e3;
50
+ const t = Math.min(this.elapsedDuration / this.duration, 1);
51
+ const easedValue = valueType.lerp(this.initialValue, this.targetValue, this.easing(t));
52
+ this.scene.setProperty(this.readInput("jsonPath"), this.valueTypeName, easedValue);
53
+ if (this.elapsedDuration >= this.duration) {
54
+ this.dispose();
55
+ engine.commitToNewFiber(this, "flow");
56
+ finished();
57
+ }
58
+ };
59
+ this.onTick = updateOnTick;
60
+ this.lifecycleEventEmitter.tickEvent.addListener(this.onTick);
61
+ }
62
+ dispose() {
63
+ this.elapsedDuration = this.duration = 0;
64
+ if (this.onTick !== void 0) {
65
+ this.lifecycleEventEmitter.tickEvent.removeListener(this.onTick);
66
+ this.onTick = void 0;
67
+ }
68
+ }
69
+ };
70
+
71
+ //#endregion
72
+ export { EaseSceneProperty };
73
+ //# sourceMappingURL=EaseSceneProperty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EaseSceneProperty.js","names":[],"sources":["../../../src/Nodes/Actions/EaseSceneProperty.ts"],"sourcesContent":["import {\n AsyncNode,\n type Easing,\n EasingFunctions,\n EasingModes,\n Engine,\n type IGraph,\n type ILifecycleEventEmitter,\n NodeDescription,\n Socket,\n toCamelCase\n} from '@kiberon-labs/behave-graph';\n\nimport type { IScene } from '../../Abstractions/IScene.js';\n\nexport class EaseSceneProperty extends AsyncNode {\n public static GetDescriptions(\n scene: IScene,\n lifecycleEventEmitter: ILifecycleEventEmitter,\n ...valueTypeNames: string[]\n ) {\n return valueTypeNames.map(\n (valueTypeName) =>\n new NodeDescription(\n `scene/ease/${valueTypeName}`,\n 'Action',\n `Ease Scene ${toCamelCase(valueTypeName)}`,\n (description, graph, config, id) =>\n new EaseSceneProperty(\n description,\n graph,\n valueTypeName,\n scene,\n lifecycleEventEmitter,\n id\n )\n )\n );\n }\n\n public readonly valueTypeName: string;\n private readonly scene: IScene;\n private readonly lifecycleEventEmitter: ILifecycleEventEmitter;\n\n constructor(\n description: NodeDescription,\n graph: IGraph,\n valueTypeName: string,\n scene: IScene,\n lifecycleEventEmitter: ILifecycleEventEmitter,\n id: string\n ) {\n super(\n description,\n graph,\n [\n new Socket('flow', 'flow'),\n new Socket('string', 'jsonPath'),\n new Socket(valueTypeName, 'value'),\n new Socket(\n 'string',\n 'easingFunction',\n 'linear',\n undefined,\n Object.keys(EasingFunctions)\n ),\n new Socket(\n 'string',\n 'easingMode',\n 'inOut',\n undefined,\n Object.keys(EasingModes)\n ),\n new Socket('float', 'easeDuration'),\n new Socket('flow', 'cancel')\n ],\n [new Socket('flow', 'flow')],\n {},\n id\n );\n this.valueTypeName = valueTypeName;\n this.scene = scene;\n this.lifecycleEventEmitter = lifecycleEventEmitter;\n }\n\n private initialValue: any = undefined;\n private targetValue: any = undefined;\n private duration = 0;\n private elapsedDuration = 0;\n private easing: Easing = EasingFunctions['linear'];\n private startTime = 0;\n private onTick: (() => void) | undefined = undefined;\n\n override triggered(\n engine: Engine,\n triggeringSocketName: string,\n finished: () => void\n ) {\n if (triggeringSocketName === 'cancel') {\n this.dispose();\n finished();\n return;\n }\n\n // if existing ease in progress, do nothing\n if (this.elapsedDuration >= this.duration) {\n return;\n }\n\n this.initialValue = this.scene.getProperty(\n this.readInput('jsonPath'),\n this.valueTypeName\n );\n this.targetValue = this.readInput('value');\n this.duration = this.readInput<number>('duration');\n this.elapsedDuration = 0;\n this.startTime = Date.now();\n\n const easingFunction =\n EasingFunctions[\n this.readInput('easingFunction') as keyof typeof EasingFunctions\n ];\n const easingMode =\n EasingModes[this.readInput('easingMode') as keyof typeof EasingModes];\n this.easing = easingMode(easingFunction);\n\n const updateOnTick = () => {\n const valueType = this.graph.values[this.valueTypeName]!;\n this.elapsedDuration = (Date.now() - this.startTime) / 1000;\n\n const t = Math.min(this.elapsedDuration / this.duration, 1);\n const easedValue = valueType.lerp(\n this.initialValue,\n this.targetValue,\n this.easing(t)\n );\n\n this.scene.setProperty(\n this.readInput('jsonPath'),\n this.valueTypeName,\n easedValue\n );\n\n if (this.elapsedDuration >= this.duration) {\n this.dispose();\n engine.commitToNewFiber(this, 'flow');\n finished();\n }\n };\n\n this.onTick = updateOnTick;\n this.lifecycleEventEmitter.tickEvent.addListener(this.onTick);\n }\n\n override dispose() {\n this.elapsedDuration = this.duration = 0;\n if (this.onTick !== undefined) {\n this.lifecycleEventEmitter.tickEvent.removeListener(this.onTick);\n this.onTick = undefined;\n }\n }\n}\n"],"mappings":";;;AAeA,IAAa,oBAAb,MAAa,0BAA0B,UAAU;CAC/C,OAAc,gBACZ,OACA,uBACA,GAAG,gBACH;AACA,SAAO,eAAe,KACnB,kBACC,IAAI,gBACF,cAAc,iBACd,UACA,cAAc,YAAY,cAAc,KACvC,aAAa,OAAO,QAAQ,OAC3B,IAAI,kBACF,aACA,OACA,eACA,OACA,uBACA,GACD,CACJ,CACJ;;CAGH,AAAgB;CAChB,AAAiB;CACjB,AAAiB;CAEjB,YACE,aACA,OACA,eACA,OACA,uBACA,IACA;AACA,QACE,aACA,OACA;GACE,IAAI,OAAO,QAAQ,OAAO;GAC1B,IAAI,OAAO,UAAU,WAAW;GAChC,IAAI,OAAO,eAAe,QAAQ;GAClC,IAAI,OACF,UACA,kBACA,UACA,QACA,OAAO,KAAK,gBAAgB,CAC7B;GACD,IAAI,OACF,UACA,cACA,SACA,QACA,OAAO,KAAK,YAAY,CACzB;GACD,IAAI,OAAO,SAAS,eAAe;GACnC,IAAI,OAAO,QAAQ,SAAS;GAC7B,EACD,CAAC,IAAI,OAAO,QAAQ,OAAO,CAAC,EAC5B,EAAE,EACF,GACD;AACD,OAAK,gBAAgB;AACrB,OAAK,QAAQ;AACb,OAAK,wBAAwB;;CAG/B,AAAQ,eAAoB;CAC5B,AAAQ,cAAmB;CAC3B,AAAQ,WAAW;CACnB,AAAQ,kBAAkB;CAC1B,AAAQ,SAAiB,gBAAgB;CACzC,AAAQ,YAAY;CACpB,AAAQ,SAAmC;CAE3C,AAAS,UACP,QACA,sBACA,UACA;AACA,MAAI,yBAAyB,UAAU;AACrC,QAAK,SAAS;AACd,aAAU;AACV;;AAIF,MAAI,KAAK,mBAAmB,KAAK,SAC/B;AAGF,OAAK,eAAe,KAAK,MAAM,YAC7B,KAAK,UAAU,WAAW,EAC1B,KAAK,cACN;AACD,OAAK,cAAc,KAAK,UAAU,QAAQ;AAC1C,OAAK,WAAW,KAAK,UAAkB,WAAW;AAClD,OAAK,kBAAkB;AACvB,OAAK,YAAY,KAAK,KAAK;EAE3B,MAAM,iBACJ,gBACE,KAAK,UAAU,iBAAiB;EAEpC,MAAM,aACJ,YAAY,KAAK,UAAU,aAAa;AAC1C,OAAK,SAAS,WAAW,eAAe;EAExC,MAAM,qBAAqB;GACzB,MAAM,YAAY,KAAK,MAAM,OAAO,KAAK;AACzC,QAAK,mBAAmB,KAAK,KAAK,GAAG,KAAK,aAAa;GAEvD,MAAM,IAAI,KAAK,IAAI,KAAK,kBAAkB,KAAK,UAAU,EAAE;GAC3D,MAAM,aAAa,UAAU,KAC3B,KAAK,cACL,KAAK,aACL,KAAK,OAAO,EAAE,CACf;AAED,QAAK,MAAM,YACT,KAAK,UAAU,WAAW,EAC1B,KAAK,eACL,WACD;AAED,OAAI,KAAK,mBAAmB,KAAK,UAAU;AACzC,SAAK,SAAS;AACd,WAAO,iBAAiB,MAAM,OAAO;AACrC,cAAU;;;AAId,OAAK,SAAS;AACd,OAAK,sBAAsB,UAAU,YAAY,KAAK,OAAO;;CAG/D,AAAS,UAAU;AACjB,OAAK,kBAAkB,KAAK,WAAW;AACvC,MAAI,KAAK,WAAW,QAAW;AAC7B,QAAK,sBAAsB,UAAU,eAAe,KAAK,OAAO;AAChE,QAAK,SAAS"}
@@ -0,0 +1,5 @@
1
+ //#region src/Nodes/Actions/SetSceneProperty.d.ts
2
+ declare const SetSceneProperty: (valueTypeNames: string[]) => any[];
3
+ //#endregion
4
+ export { SetSceneProperty };
5
+ //# sourceMappingURL=SetSceneProperty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetSceneProperty.d.ts","names":[],"sources":["../../../src/Nodes/Actions/SetSceneProperty.ts"],"sourcesContent":[],"mappings":";cAOa"}
@@ -0,0 +1,28 @@
1
+ import { NodeCategory, makeFlowNodeDefinition } from "@kiberon-labs/behave-graph";
2
+
3
+ //#region src/Nodes/Actions/SetSceneProperty.ts
4
+ const SetSceneProperty = (valueTypeNames) => valueTypeNames.map((valueTypeName) => makeFlowNodeDefinition({
5
+ typeName: `scene/set/${valueTypeName}`,
6
+ category: NodeCategory.Effect,
7
+ label: `Set Scene ${valueTypeName}`,
8
+ in: {
9
+ jsonPath: (_, graphApi) => {
10
+ return {
11
+ valueType: "string",
12
+ choices: graphApi.getDependency("IScene")?.getProperties()
13
+ };
14
+ },
15
+ value: valueTypeName,
16
+ flow: "flow"
17
+ },
18
+ out: { flow: "flow" },
19
+ initialState: void 0,
20
+ triggered: ({ commit, read, graph }) => {
21
+ graph.getDependency("IScene")?.setProperty(read("jsonPath"), valueTypeName, read("value"));
22
+ commit("flow");
23
+ }
24
+ }));
25
+
26
+ //#endregion
27
+ export { SetSceneProperty };
28
+ //# sourceMappingURL=SetSceneProperty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetSceneProperty.js","names":[],"sources":["../../../src/Nodes/Actions/SetSceneProperty.ts"],"sourcesContent":["import {\n makeFlowNodeDefinition,\n NodeCategory\n} from '@kiberon-labs/behave-graph';\n\nimport type { IScene } from '../../Abstractions/IScene.js';\n\nexport const SetSceneProperty = (valueTypeNames: string[]) =>\n valueTypeNames.map((valueTypeName) =>\n makeFlowNodeDefinition({\n typeName: `scene/set/${valueTypeName}`,\n category: NodeCategory.Effect,\n label: `Set Scene ${valueTypeName}`,\n in: {\n jsonPath: (_, graphApi) => {\n const scene = graphApi.getDependency<IScene>('IScene');\n return {\n valueType: 'string',\n choices: scene?.getProperties()\n };\n },\n value: valueTypeName,\n flow: 'flow'\n },\n out: {\n flow: 'flow'\n },\n initialState: undefined,\n triggered: ({ commit, read, graph }) => {\n const scene = graph.getDependency<IScene>('IScene');\n scene?.setProperty(read('jsonPath'), valueTypeName, read('value'));\n commit('flow');\n }\n })\n );\n"],"mappings":";;;AAOA,MAAa,oBAAoB,mBAC/B,eAAe,KAAK,kBAClB,uBAAuB;CACrB,UAAU,aAAa;CACvB,UAAU,aAAa;CACvB,OAAO,aAAa;CACpB,IAAI;EACF,WAAW,GAAG,aAAa;AAEzB,UAAO;IACL,WAAW;IACX,SAHY,SAAS,cAAsB,SAAS,EAGpC,eAAe;IAChC;;EAEH,OAAO;EACP,MAAM;EACP;CACD,KAAK,EACH,MAAM,QACP;CACD,cAAc;CACd,YAAY,EAAE,QAAQ,MAAM,YAAY;AAEtC,EADc,MAAM,cAAsB,SAAS,EAC5C,YAAY,KAAK,WAAW,EAAE,eAAe,KAAK,QAAQ,CAAC;AAClE,SAAO,OAAO;;CAEjB,CAAC,CACH"}
@@ -0,0 +1,5 @@
1
+ //#region src/Nodes/Events/OnSceneNodeClick.d.ts
2
+ declare const OnSceneNodeClick: any;
3
+ //#endregion
4
+ export { OnSceneNodeClick };
5
+ //# sourceMappingURL=OnSceneNodeClick.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnSceneNodeClick.d.ts","names":[],"sources":["../../../src/Nodes/Events/OnSceneNodeClick.ts"],"sourcesContent":[],"mappings":";cAgBa"}
@@ -0,0 +1,39 @@
1
+ import { Assert, NodeCategory, makeEventNodeDefinition } from "@kiberon-labs/behave-graph";
2
+
3
+ //#region src/Nodes/Events/OnSceneNodeClick.ts
4
+ const initialState = () => ({});
5
+ const OnSceneNodeClick = makeEventNodeDefinition({
6
+ typeName: "scene/nodeClick",
7
+ category: NodeCategory.Event,
8
+ label: "On Scene Node Click",
9
+ in: { jsonPath: (_, graphApi) => {
10
+ return {
11
+ valueType: "string",
12
+ choices: graphApi.getDependency("IScene")?.getRaycastableProperties()
13
+ };
14
+ } },
15
+ out: { flow: "flow" },
16
+ initialState: initialState(),
17
+ init: ({ read, commit, graph }) => {
18
+ const handleNodeClick = () => {
19
+ commit("flow");
20
+ };
21
+ const jsonPath = read("jsonPath");
22
+ graph.getDependency("IScene")?.addOnClickedListener(jsonPath, handleNodeClick);
23
+ return {
24
+ handleNodeClick,
25
+ jsonPath
26
+ };
27
+ },
28
+ dispose: ({ state: { handleNodeClick, jsonPath }, graph: { getDependency } }) => {
29
+ Assert.mustBeTrue(handleNodeClick !== void 0);
30
+ Assert.mustBeTrue(jsonPath !== void 0);
31
+ if (!jsonPath || !handleNodeClick) return {};
32
+ getDependency("scene")?.removeOnClickedListener(jsonPath, handleNodeClick);
33
+ return {};
34
+ }
35
+ });
36
+
37
+ //#endregion
38
+ export { OnSceneNodeClick };
39
+ //# sourceMappingURL=OnSceneNodeClick.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OnSceneNodeClick.js","names":[],"sources":["../../../src/Nodes/Events/OnSceneNodeClick.ts"],"sourcesContent":["import {\n Assert,\n makeEventNodeDefinition,\n NodeCategory\n} from '@kiberon-labs/behave-graph';\n\nimport type { IScene } from '../../Abstractions/IScene.js';\n\ntype State = {\n jsonPath?: string | undefined;\n handleNodeClick?: ((jsonPath: string) => void) | undefined;\n};\n\nconst initialState = (): State => ({});\n\n// very 3D specific.\nexport const OnSceneNodeClick = makeEventNodeDefinition({\n typeName: 'scene/nodeClick',\n category: NodeCategory.Event,\n label: 'On Scene Node Click',\n in: {\n jsonPath: (_, graphApi) => {\n const scene = graphApi.getDependency<IScene>('IScene');\n\n return {\n valueType: 'string',\n choices: scene?.getRaycastableProperties()\n };\n }\n },\n out: {\n flow: 'flow'\n },\n initialState: initialState(),\n init: ({ read, commit, graph }) => {\n const handleNodeClick = () => {\n commit('flow');\n };\n\n const jsonPath = read<string>('jsonPath');\n\n const scene = graph.getDependency<IScene>('IScene');\n scene?.addOnClickedListener(jsonPath, handleNodeClick);\n\n const state: State = {\n handleNodeClick,\n jsonPath\n };\n\n return state;\n },\n dispose: ({\n state: { handleNodeClick, jsonPath },\n graph: { getDependency }\n }) => {\n Assert.mustBeTrue(handleNodeClick !== undefined);\n Assert.mustBeTrue(jsonPath !== undefined);\n\n if (!jsonPath || !handleNodeClick) return {};\n\n const scene = getDependency<IScene>('scene');\n scene?.removeOnClickedListener(jsonPath, handleNodeClick);\n\n return {};\n }\n});\n"],"mappings":";;;AAaA,MAAM,sBAA6B,EAAE;AAGrC,MAAa,mBAAmB,wBAAwB;CACtD,UAAU;CACV,UAAU,aAAa;CACvB,OAAO;CACP,IAAI,EACF,WAAW,GAAG,aAAa;AAGzB,SAAO;GACL,WAAW;GACX,SAJY,SAAS,cAAsB,SAAS,EAIpC,0BAA0B;GAC3C;IAEJ;CACD,KAAK,EACH,MAAM,QACP;CACD,cAAc,cAAc;CAC5B,OAAO,EAAE,MAAM,QAAQ,YAAY;EACjC,MAAM,wBAAwB;AAC5B,UAAO,OAAO;;EAGhB,MAAM,WAAW,KAAa,WAAW;AAGzC,EADc,MAAM,cAAsB,SAAS,EAC5C,qBAAqB,UAAU,gBAAgB;AAOtD,SALqB;GACnB;GACA;GACD;;CAIH,UAAU,EACR,OAAO,EAAE,iBAAiB,YAC1B,OAAO,EAAE,sBACL;AACJ,SAAO,WAAW,oBAAoB,OAAU;AAChD,SAAO,WAAW,aAAa,OAAU;AAEzC,MAAI,CAAC,YAAY,CAAC,gBAAiB,QAAO,EAAE;AAG5C,EADc,cAAsB,QAAQ,EACrC,wBAAwB,UAAU,gBAAgB;AAEzD,SAAO,EAAE;;CAEZ,CAAC"}
@@ -0,0 +1,19 @@
1
+ declare namespace ColorNodes_d_exports {
2
+ export { Add, ColorToHex, ColorToHsl, Constant, Create, Elements, Equal, HexToColor, HslToColor, Mix, Negate, Scale, Subtract };
3
+ }
4
+ declare const Constant: any;
5
+ declare const Create: any;
6
+ declare const Elements: any;
7
+ declare const Add: any;
8
+ declare const Subtract: any;
9
+ declare const Negate: any;
10
+ declare const Scale: any;
11
+ declare const Mix: any;
12
+ declare const HslToColor: any;
13
+ declare const ColorToHsl: any;
14
+ declare const HexToColor: any;
15
+ declare const ColorToHex: any;
16
+ declare const Equal: any;
17
+ //#endregion
18
+ export { ColorNodes_d_exports };
19
+ //# sourceMappingURL=ColorNodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorNodes.d.ts","names":[],"sources":["../../../src/Nodes/Logic/ColorNodes.ts"],"sourcesContent":[],"mappings":";;;cAgBa;cAQA;cAQA;cAUA;cAQA;cAQA;cAQA;cAQA;cAQA;cAQA;cAQA;cAQA;cAQA"}
@@ -0,0 +1,137 @@
1
+ import { __export } from "../../_virtual/rolldown_runtime.js";
2
+ import { Vec3, hexToRGB, hslToRGB, rgbToHSL, rgbToHex, vec3Add, vec3Equals, vec3Mix, vec3MultiplyByScalar, vec3Negate, vec3Subtract } from "../../Values/Internal/Vec3.js";
3
+ import { makeInNOutFunctionDesc } from "@kiberon-labs/behave-graph";
4
+
5
+ //#region src/Nodes/Logic/ColorNodes.ts
6
+ var ColorNodes_exports = /* @__PURE__ */ __export({
7
+ Add: () => Add,
8
+ ColorToHex: () => ColorToHex,
9
+ ColorToHsl: () => ColorToHsl,
10
+ Constant: () => Constant,
11
+ Create: () => Create,
12
+ Elements: () => Elements,
13
+ Equal: () => Equal,
14
+ HexToColor: () => HexToColor,
15
+ HslToColor: () => HslToColor,
16
+ Mix: () => Mix,
17
+ Negate: () => Negate,
18
+ Scale: () => Scale,
19
+ Subtract: () => Subtract
20
+ });
21
+ const Constant = makeInNOutFunctionDesc({
22
+ name: "math/color",
23
+ label: "Color",
24
+ in: ["color"],
25
+ out: "color",
26
+ exec: (a) => a
27
+ });
28
+ const Create = makeInNOutFunctionDesc({
29
+ name: "math/toColor/rgb",
30
+ label: "RGB To Color",
31
+ in: [
32
+ { r: "float" },
33
+ { g: "float" },
34
+ { b: "float" }
35
+ ],
36
+ out: "color",
37
+ exec: (r, g, b) => new Vec3(r, g, b)
38
+ });
39
+ const Elements = makeInNOutFunctionDesc({
40
+ name: "math/toRgb/color",
41
+ label: "Color to RGB",
42
+ in: ["color"],
43
+ out: [
44
+ { r: "float" },
45
+ { g: "float" },
46
+ { b: "float" }
47
+ ],
48
+ exec: (a) => {
49
+ return {
50
+ r: a.x,
51
+ g: a.y,
52
+ b: a.z
53
+ };
54
+ }
55
+ });
56
+ const Add = makeInNOutFunctionDesc({
57
+ name: "math/add/color",
58
+ label: "+",
59
+ in: ["color", "color"],
60
+ out: "color",
61
+ exec: vec3Add
62
+ });
63
+ const Subtract = makeInNOutFunctionDesc({
64
+ name: "math/subtract/color",
65
+ label: "-",
66
+ in: ["color", "color"],
67
+ out: "color",
68
+ exec: vec3Subtract
69
+ });
70
+ const Negate = makeInNOutFunctionDesc({
71
+ name: "math/negate/color",
72
+ label: "-",
73
+ in: ["color"],
74
+ out: "color",
75
+ exec: vec3Negate
76
+ });
77
+ const Scale = makeInNOutFunctionDesc({
78
+ name: "math/scale/color",
79
+ label: "×",
80
+ in: ["color", "float"],
81
+ out: "color",
82
+ exec: vec3MultiplyByScalar
83
+ });
84
+ const Mix = makeInNOutFunctionDesc({
85
+ name: "math/mix/color",
86
+ label: "÷",
87
+ in: [
88
+ { a: "color" },
89
+ { b: "color" },
90
+ { t: "float" }
91
+ ],
92
+ out: "color",
93
+ exec: vec3Mix
94
+ });
95
+ const HslToColor = makeInNOutFunctionDesc({
96
+ name: "math/ToColor/hsl",
97
+ label: "HSL to Color",
98
+ in: ["vec3"],
99
+ out: "color",
100
+ exec: hslToRGB
101
+ });
102
+ const ColorToHsl = makeInNOutFunctionDesc({
103
+ name: "math/toHsl/color",
104
+ label: "Color to HSL",
105
+ in: ["color"],
106
+ out: "vec3",
107
+ exec: rgbToHSL
108
+ });
109
+ const HexToColor = makeInNOutFunctionDesc({
110
+ name: "math/toColor/hex",
111
+ label: "HEX to Color",
112
+ in: ["float"],
113
+ out: "color",
114
+ exec: hexToRGB
115
+ });
116
+ const ColorToHex = makeInNOutFunctionDesc({
117
+ name: "math/toHex/color",
118
+ label: "Color to HEX",
119
+ in: ["color"],
120
+ out: "float",
121
+ exec: rgbToHex
122
+ });
123
+ const Equal = makeInNOutFunctionDesc({
124
+ name: "math/equal/color",
125
+ label: "=",
126
+ in: [
127
+ { a: "color" },
128
+ { b: "color" },
129
+ { tolerance: "float" }
130
+ ],
131
+ out: "boolean",
132
+ exec: vec3Equals
133
+ });
134
+
135
+ //#endregion
136
+ export { ColorNodes_exports };
137
+ //# sourceMappingURL=ColorNodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorNodes.js","names":[],"sources":["../../../src/Nodes/Logic/ColorNodes.ts"],"sourcesContent":["import { makeInNOutFunctionDesc } from '@kiberon-labs/behave-graph';\n\nimport {\n hexToRGB,\n hslToRGB,\n rgbToHex,\n rgbToHSL,\n Vec3,\n vec3Add,\n vec3Equals,\n vec3Mix,\n vec3MultiplyByScalar,\n vec3Negate,\n vec3Subtract\n} from '../../Values/Internal/Vec3.js';\n\nexport const Constant = makeInNOutFunctionDesc({\n name: 'math/color',\n label: 'Color',\n in: ['color'],\n out: 'color',\n exec: (a: Vec3) => a\n});\n\nexport const Create = makeInNOutFunctionDesc({\n name: 'math/toColor/rgb',\n label: 'RGB To Color',\n in: [{ r: 'float' }, { g: 'float' }, { b: 'float' }],\n out: 'color',\n exec: (r: number, g: number, b: number) => new Vec3(r, g, b)\n});\n\nexport const Elements = makeInNOutFunctionDesc({\n name: 'math/toRgb/color',\n label: 'Color to RGB',\n in: ['color'],\n out: [{ r: 'float' }, { g: 'float' }, { b: 'float' }],\n exec: (a: Vec3) => {\n return { r: a.x, g: a.y, b: a.z };\n }\n});\n\nexport const Add = makeInNOutFunctionDesc({\n name: 'math/add/color',\n label: '+',\n in: ['color', 'color'],\n out: 'color',\n exec: vec3Add\n});\n\nexport const Subtract = makeInNOutFunctionDesc({\n name: 'math/subtract/color',\n label: '-',\n in: ['color', 'color'],\n out: 'color',\n exec: vec3Subtract\n});\n\nexport const Negate = makeInNOutFunctionDesc({\n name: 'math/negate/color',\n label: '-',\n in: ['color'],\n out: 'color',\n exec: vec3Negate\n});\n\nexport const Scale = makeInNOutFunctionDesc({\n name: 'math/scale/color',\n label: '×',\n in: ['color', 'float'],\n out: 'color',\n exec: vec3MultiplyByScalar\n});\n\nexport const Mix = makeInNOutFunctionDesc({\n name: 'math/mix/color',\n label: '÷',\n in: [{ a: 'color' }, { b: 'color' }, { t: 'float' }],\n out: 'color',\n exec: vec3Mix\n});\n\nexport const HslToColor = makeInNOutFunctionDesc({\n name: 'math/ToColor/hsl',\n label: 'HSL to Color',\n in: ['vec3'],\n out: 'color',\n exec: hslToRGB\n});\n\nexport const ColorToHsl = makeInNOutFunctionDesc({\n name: 'math/toHsl/color',\n label: 'Color to HSL',\n in: ['color'],\n out: 'vec3',\n exec: rgbToHSL\n});\n\nexport const HexToColor = makeInNOutFunctionDesc({\n name: 'math/toColor/hex',\n label: 'HEX to Color',\n in: ['float'],\n out: 'color',\n exec: hexToRGB\n});\n\nexport const ColorToHex = makeInNOutFunctionDesc({\n name: 'math/toHex/color',\n label: 'Color to HEX',\n in: ['color'],\n out: 'float',\n exec: rgbToHex\n});\n\nexport const Equal = makeInNOutFunctionDesc({\n name: 'math/equal/color',\n label: '=',\n in: [{ a: 'color' }, { b: 'color' }, { tolerance: 'float' }],\n out: 'boolean',\n exec: vec3Equals\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBA,MAAa,WAAW,uBAAuB;CAC7C,MAAM;CACN,OAAO;CACP,IAAI,CAAC,QAAQ;CACb,KAAK;CACL,OAAO,MAAY;CACpB,CAAC;AAEF,MAAa,SAAS,uBAAuB;CAC3C,MAAM;CACN,OAAO;CACP,IAAI;EAAC,EAAE,GAAG,SAAS;EAAE,EAAE,GAAG,SAAS;EAAE,EAAE,GAAG,SAAS;EAAC;CACpD,KAAK;CACL,OAAO,GAAW,GAAW,MAAc,IAAI,KAAK,GAAG,GAAG,EAAE;CAC7D,CAAC;AAEF,MAAa,WAAW,uBAAuB;CAC7C,MAAM;CACN,OAAO;CACP,IAAI,CAAC,QAAQ;CACb,KAAK;EAAC,EAAE,GAAG,SAAS;EAAE,EAAE,GAAG,SAAS;EAAE,EAAE,GAAG,SAAS;EAAC;CACrD,OAAO,MAAY;AACjB,SAAO;GAAE,GAAG,EAAE;GAAG,GAAG,EAAE;GAAG,GAAG,EAAE;GAAG;;CAEpC,CAAC;AAEF,MAAa,MAAM,uBAAuB;CACxC,MAAM;CACN,OAAO;CACP,IAAI,CAAC,SAAS,QAAQ;CACtB,KAAK;CACL,MAAM;CACP,CAAC;AAEF,MAAa,WAAW,uBAAuB;CAC7C,MAAM;CACN,OAAO;CACP,IAAI,CAAC,SAAS,QAAQ;CACtB,KAAK;CACL,MAAM;CACP,CAAC;AAEF,MAAa,SAAS,uBAAuB;CAC3C,MAAM;CACN,OAAO;CACP,IAAI,CAAC,QAAQ;CACb,KAAK;CACL,MAAM;CACP,CAAC;AAEF,MAAa,QAAQ,uBAAuB;CAC1C,MAAM;CACN,OAAO;CACP,IAAI,CAAC,SAAS,QAAQ;CACtB,KAAK;CACL,MAAM;CACP,CAAC;AAEF,MAAa,MAAM,uBAAuB;CACxC,MAAM;CACN,OAAO;CACP,IAAI;EAAC,EAAE,GAAG,SAAS;EAAE,EAAE,GAAG,SAAS;EAAE,EAAE,GAAG,SAAS;EAAC;CACpD,KAAK;CACL,MAAM;CACP,CAAC;AAEF,MAAa,aAAa,uBAAuB;CAC/C,MAAM;CACN,OAAO;CACP,IAAI,CAAC,OAAO;CACZ,KAAK;CACL,MAAM;CACP,CAAC;AAEF,MAAa,aAAa,uBAAuB;CAC/C,MAAM;CACN,OAAO;CACP,IAAI,CAAC,QAAQ;CACb,KAAK;CACL,MAAM;CACP,CAAC;AAEF,MAAa,aAAa,uBAAuB;CAC/C,MAAM;CACN,OAAO;CACP,IAAI,CAAC,QAAQ;CACb,KAAK;CACL,MAAM;CACP,CAAC;AAEF,MAAa,aAAa,uBAAuB;CAC/C,MAAM;CACN,OAAO;CACP,IAAI,CAAC,QAAQ;CACb,KAAK;CACL,MAAM;CACP,CAAC;AAEF,MAAa,QAAQ,uBAAuB;CAC1C,MAAM;CACN,OAAO;CACP,IAAI;EAAC,EAAE,GAAG,SAAS;EAAE,EAAE,GAAG,SAAS;EAAE,EAAE,WAAW,SAAS;EAAC;CAC5D,KAAK;CACL,MAAM;CACP,CAAC"}
@@ -0,0 +1,18 @@
1
+ declare namespace EulerNodes_d_exports {
2
+ export { Add, Constant, Create, Elements, Equal, Mat3ToEuler, Mat4ToEuler, Mix, Negate, QuatToEuler, Scale, Subtract };
3
+ }
4
+ declare const Constant: any;
5
+ declare const Create: any;
6
+ declare const Elements: any;
7
+ declare const Add: any;
8
+ declare const Subtract: any;
9
+ declare const Negate: any;
10
+ declare const Scale: any;
11
+ declare const Mix: any;
12
+ declare const Mat3ToEuler: any;
13
+ declare const Mat4ToEuler: any;
14
+ declare const QuatToEuler: any;
15
+ declare const Equal: any;
16
+ //#endregion
17
+ export { EulerNodes_d_exports };
18
+ //# sourceMappingURL=EulerNodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EulerNodes.d.ts","names":[],"sources":["../../../src/Nodes/Logic/EulerNodes.ts"],"sourcesContent":[],"mappings":";;;cAea;cAQA;cAQA;cAUA;cAQA;cAQA;cAQA;cAQA;cAWA;cAQA;cAQA;cAQA"}