@kiberon-labs/behave-graph-scene 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +18 -0
- package/.storybook/preview.ts +16 -0
- package/.storybook/vscode.css +822 -0
- package/.turbo/turbo-build.log +8 -0
- package/CHANGELOG.md +84 -0
- package/LICENSE +6 -0
- package/README.md +13 -0
- package/dist/Abstractions/Drivers/DummyScene.d.ts +64 -0
- package/dist/Abstractions/Drivers/DummyScene.d.ts.map +1 -0
- package/dist/Abstractions/Drivers/DummyScene.js +115 -0
- package/dist/Abstractions/Drivers/DummyScene.js.map +1 -0
- package/dist/Abstractions/IScene.d.ts +75 -0
- package/dist/Abstractions/IScene.d.ts.map +1 -0
- package/dist/Abstractions/IScene.js +19 -0
- package/dist/Abstractions/IScene.js.map +1 -0
- package/dist/GLTFJson.d.ts +33 -0
- package/dist/GLTFJson.d.ts.map +1 -0
- package/dist/Nodes/Actions/AddLight.d.ts +21 -0
- package/dist/Nodes/Actions/AddLight.d.ts.map +1 -0
- package/dist/Nodes/Actions/AddLight.js +38 -0
- package/dist/Nodes/Actions/AddLight.js.map +1 -0
- package/dist/Nodes/Actions/CloneMesh.d.ts +16 -0
- package/dist/Nodes/Actions/CloneMesh.d.ts.map +1 -0
- package/dist/Nodes/Actions/CloneMesh.js +28 -0
- package/dist/Nodes/Actions/CloneMesh.js.map +1 -0
- package/dist/Nodes/Actions/CreateMesh.d.ts +22 -0
- package/dist/Nodes/Actions/CreateMesh.d.ts.map +1 -0
- package/dist/Nodes/Actions/CreateMesh.js +44 -0
- package/dist/Nodes/Actions/CreateMesh.js.map +1 -0
- package/dist/Nodes/Actions/DeleteMesh.d.ts +15 -0
- package/dist/Nodes/Actions/DeleteMesh.d.ts.map +1 -0
- package/dist/Nodes/Actions/DeleteMesh.js +27 -0
- package/dist/Nodes/Actions/DeleteMesh.js.map +1 -0
- package/dist/Nodes/Actions/EaseSceneProperty.d.ts +23 -0
- package/dist/Nodes/Actions/EaseSceneProperty.d.ts.map +1 -0
- package/dist/Nodes/Actions/EaseSceneProperty.js +73 -0
- package/dist/Nodes/Actions/EaseSceneProperty.js.map +1 -0
- package/dist/Nodes/Actions/LookAt.d.ts +16 -0
- package/dist/Nodes/Actions/LookAt.d.ts.map +1 -0
- package/dist/Nodes/Actions/LookAt.js +35 -0
- package/dist/Nodes/Actions/LookAt.js.map +1 -0
- package/dist/Nodes/Actions/MoveTowards.d.ts +21 -0
- package/dist/Nodes/Actions/MoveTowards.d.ts.map +1 -0
- package/dist/Nodes/Actions/MoveTowards.js +46 -0
- package/dist/Nodes/Actions/MoveTowards.js.map +1 -0
- package/dist/Nodes/Actions/RemoveLight.d.ts +15 -0
- package/dist/Nodes/Actions/RemoveLight.d.ts.map +1 -0
- package/dist/Nodes/Actions/RemoveLight.js +27 -0
- package/dist/Nodes/Actions/RemoveLight.js.map +1 -0
- package/dist/Nodes/Actions/SetLightProperty.d.ts +25 -0
- package/dist/Nodes/Actions/SetLightProperty.d.ts.map +1 -0
- package/dist/Nodes/Actions/SetLightProperty.js +64 -0
- package/dist/Nodes/Actions/SetLightProperty.js.map +1 -0
- package/dist/Nodes/Actions/SetMaterialProperty.d.ts +25 -0
- package/dist/Nodes/Actions/SetMaterialProperty.d.ts.map +1 -0
- package/dist/Nodes/Actions/SetMaterialProperty.js +69 -0
- package/dist/Nodes/Actions/SetMaterialProperty.js.map +1 -0
- package/dist/Nodes/Actions/SetMeshPosition.d.ts +18 -0
- package/dist/Nodes/Actions/SetMeshPosition.d.ts.map +1 -0
- package/dist/Nodes/Actions/SetMeshPosition.js +34 -0
- package/dist/Nodes/Actions/SetMeshPosition.js.map +1 -0
- package/dist/Nodes/Actions/SetMeshVisible.d.ts +16 -0
- package/dist/Nodes/Actions/SetMeshVisible.d.ts.map +1 -0
- package/dist/Nodes/Actions/SetMeshVisible.js +28 -0
- package/dist/Nodes/Actions/SetMeshVisible.js.map +1 -0
- package/dist/Nodes/Actions/SetSceneProperty.d.ts +16 -0
- package/dist/Nodes/Actions/SetSceneProperty.d.ts.map +1 -0
- package/dist/Nodes/Actions/SetSceneProperty.js +28 -0
- package/dist/Nodes/Actions/SetSceneProperty.js.map +1 -0
- package/dist/Nodes/Events/OnAnyMeshClicked.d.ts +13 -0
- package/dist/Nodes/Events/OnAnyMeshClicked.d.ts.map +1 -0
- package/dist/Nodes/Events/OnAnyMeshClicked.js +34 -0
- package/dist/Nodes/Events/OnAnyMeshClicked.js.map +1 -0
- package/dist/Nodes/Events/OnSceneChanged.d.ts +12 -0
- package/dist/Nodes/Events/OnSceneChanged.d.ts.map +1 -0
- package/dist/Nodes/Events/OnSceneChanged.js +28 -0
- package/dist/Nodes/Events/OnSceneChanged.js.map +1 -0
- package/dist/Nodes/Events/OnSceneNodeClick.d.ts +18 -0
- package/dist/Nodes/Events/OnSceneNodeClick.d.ts.map +1 -0
- package/dist/Nodes/Events/OnSceneNodeClick.js +39 -0
- package/dist/Nodes/Events/OnSceneNodeClick.js.map +1 -0
- package/dist/Nodes/Logic/ColorNodes.d.ts +23 -0
- package/dist/Nodes/Logic/ColorNodes.d.ts.map +1 -0
- package/dist/Nodes/Logic/ColorNodes.js +137 -0
- package/dist/Nodes/Logic/ColorNodes.js.map +1 -0
- package/dist/Nodes/Logic/EulerNodes.d.ts +22 -0
- package/dist/Nodes/Logic/EulerNodes.d.ts.map +1 -0
- package/dist/Nodes/Logic/EulerNodes.js +132 -0
- package/dist/Nodes/Logic/EulerNodes.js.map +1 -0
- package/dist/Nodes/Logic/Mat3Nodes.d.ts +31 -0
- package/dist/Nodes/Logic/Mat3Nodes.d.ts.map +1 -0
- package/dist/Nodes/Logic/Mat3Nodes.js +199 -0
- package/dist/Nodes/Logic/Mat3Nodes.js.map +1 -0
- package/dist/Nodes/Logic/Mat4Nodes.d.ts +38 -0
- package/dist/Nodes/Logic/Mat4Nodes.d.ts.map +1 -0
- package/dist/Nodes/Logic/Mat4Nodes.js +267 -0
- package/dist/Nodes/Logic/Mat4Nodes.js.map +1 -0
- package/dist/Nodes/Logic/QuatNodes.d.ts +28 -0
- package/dist/Nodes/Logic/QuatNodes.d.ts.map +1 -0
- package/dist/Nodes/Logic/QuatNodes.js +173 -0
- package/dist/Nodes/Logic/QuatNodes.js.map +1 -0
- package/dist/Nodes/Logic/Vec2Nodes.d.ts +22 -0
- package/dist/Nodes/Logic/Vec2Nodes.d.ts.map +1 -0
- package/dist/Nodes/Logic/Vec2Nodes.js +115 -0
- package/dist/Nodes/Logic/Vec2Nodes.js.map +1 -0
- package/dist/Nodes/Logic/Vec3Nodes.d.ts +23 -0
- package/dist/Nodes/Logic/Vec3Nodes.d.ts.map +1 -0
- package/dist/Nodes/Logic/Vec3Nodes.js +137 -0
- package/dist/Nodes/Logic/Vec3Nodes.js.map +1 -0
- package/dist/Nodes/Logic/Vec4Nodes.d.ts +22 -0
- package/dist/Nodes/Logic/Vec4Nodes.d.ts.map +1 -0
- package/dist/Nodes/Logic/Vec4Nodes.js +132 -0
- package/dist/Nodes/Logic/Vec4Nodes.js.map +1 -0
- package/dist/Nodes/Logic/VecElements.d.ts +9 -0
- package/dist/Nodes/Logic/VecElements.d.ts.map +1 -0
- package/dist/Nodes/Logic/VecElements.js +22 -0
- package/dist/Nodes/Logic/VecElements.js.map +1 -0
- package/dist/Nodes/Queries/GetDistanceBetween.d.ts +18 -0
- package/dist/Nodes/Queries/GetDistanceBetween.d.ts.map +1 -0
- package/dist/Nodes/Queries/GetDistanceBetween.js +30 -0
- package/dist/Nodes/Queries/GetDistanceBetween.js.map +1 -0
- package/dist/Nodes/Queries/GetLightProperty.d.ts +23 -0
- package/dist/Nodes/Queries/GetLightProperty.d.ts.map +1 -0
- package/dist/Nodes/Queries/GetLightProperty.js +68 -0
- package/dist/Nodes/Queries/GetLightProperty.js.map +1 -0
- package/dist/Nodes/Queries/GetMaterialProperty.d.ts +23 -0
- package/dist/Nodes/Queries/GetMaterialProperty.d.ts.map +1 -0
- package/dist/Nodes/Queries/GetMaterialProperty.js +69 -0
- package/dist/Nodes/Queries/GetMaterialProperty.js.map +1 -0
- package/dist/Nodes/Queries/GetMeshPosition.d.ts +16 -0
- package/dist/Nodes/Queries/GetMeshPosition.d.ts.map +1 -0
- package/dist/Nodes/Queries/GetMeshPosition.js +29 -0
- package/dist/Nodes/Queries/GetMeshPosition.js.map +1 -0
- package/dist/Nodes/Queries/GetSceneProperty.d.ts +14 -0
- package/dist/Nodes/Queries/GetSceneProperty.d.ts.map +1 -0
- package/dist/Nodes/Queries/GetSceneProperty.js +23 -0
- package/dist/Nodes/Queries/GetSceneProperty.js.map +1 -0
- package/dist/Values/ColorValue.d.ts +7 -0
- package/dist/Values/ColorValue.d.ts.map +1 -0
- package/dist/Values/ColorValue.js +20 -0
- package/dist/Values/ColorValue.js.map +1 -0
- package/dist/Values/EulerValue.d.ts +7 -0
- package/dist/Values/EulerValue.d.ts.map +1 -0
- package/dist/Values/EulerValue.js +20 -0
- package/dist/Values/EulerValue.js.map +1 -0
- package/dist/Values/Internal/Mat3.d.ts +43 -0
- package/dist/Values/Internal/Mat3.d.ts.map +1 -0
- package/dist/Values/Internal/Mat3.js +276 -0
- package/dist/Values/Internal/Mat3.js.map +1 -0
- package/dist/Values/Internal/Mat4.d.ts +53 -0
- package/dist/Values/Internal/Mat4.d.ts.map +1 -0
- package/dist/Values/Internal/Mat4.js +443 -0
- package/dist/Values/Internal/Mat4.js.map +1 -0
- package/dist/Values/Internal/Vec2.d.ts +25 -0
- package/dist/Values/Internal/Vec2.d.ts.map +1 -0
- package/dist/Values/Internal/Vec2.js +64 -0
- package/dist/Values/Internal/Vec2.js.map +1 -0
- package/dist/Values/Internal/Vec3.d.ts +38 -0
- package/dist/Values/Internal/Vec3.d.ts.map +1 -0
- package/dist/Values/Internal/Vec3.js +157 -0
- package/dist/Values/Internal/Vec3.js.map +1 -0
- package/dist/Values/Internal/Vec4.d.ts +49 -0
- package/dist/Values/Internal/Vec4.d.ts.map +1 -0
- package/dist/Values/Internal/Vec4.js +190 -0
- package/dist/Values/Internal/Vec4.js.map +1 -0
- package/dist/Values/Mat3Value.d.ts +7 -0
- package/dist/Values/Mat3Value.d.ts.map +1 -0
- package/dist/Values/Mat3Value.js +16 -0
- package/dist/Values/Mat3Value.js.map +1 -0
- package/dist/Values/Mat4Value.d.ts +7 -0
- package/dist/Values/Mat4Value.d.ts.map +1 -0
- package/dist/Values/Mat4Value.js +16 -0
- package/dist/Values/Mat4Value.js.map +1 -0
- package/dist/Values/QuatValue.d.ts +7 -0
- package/dist/Values/QuatValue.d.ts.map +1 -0
- package/dist/Values/QuatValue.js +21 -0
- package/dist/Values/QuatValue.js.map +1 -0
- package/dist/Values/Vec2Value.d.ts +7 -0
- package/dist/Values/Vec2Value.d.ts.map +1 -0
- package/dist/Values/Vec2Value.js +16 -0
- package/dist/Values/Vec2Value.js.map +1 -0
- package/dist/Values/Vec3Value.d.ts +7 -0
- package/dist/Values/Vec3Value.d.ts.map +1 -0
- package/dist/Values/Vec3Value.js +20 -0
- package/dist/Values/Vec3Value.js.map +1 -0
- package/dist/Values/Vec4Value.d.ts +7 -0
- package/dist/Values/Vec4Value.d.ts.map +1 -0
- package/dist/Values/Vec4Value.js +21 -0
- package/dist/Values/Vec4Value.js.map +1 -0
- package/dist/_virtual/rolldown_runtime.js +35 -0
- package/dist/behave-graph.manifest.json +6082 -0
- package/dist/buildScene.d.ts +74 -0
- package/dist/buildScene.d.ts.map +1 -0
- package/dist/buildScene.js +304 -0
- package/dist/buildScene.js.map +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/manifest.source.d.ts +7 -0
- package/dist/manifest.source.d.ts.map +1 -0
- package/dist/manifest.source.js +54 -0
- package/dist/manifest.source.js.map +1 -0
- package/dist/node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.development.js +207 -0
- package/dist/node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.development.js.map +1 -0
- package/dist/node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js +40 -0
- package/dist/node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js.map +1 -0
- package/dist/node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.development.js +766 -0
- package/dist/node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.development.js.map +1 -0
- package/dist/node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js +367 -0
- package/dist/node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js.map +1 -0
- package/dist/node_modules/.pnpm/react@19.2.3/node_modules/react/index.js +15 -0
- package/dist/node_modules/.pnpm/react@19.2.3/node_modules/react/index.js.map +1 -0
- package/dist/node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js +15 -0
- package/dist/node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js.map +1 -0
- package/dist/packages/nodes/scene/package.js +7 -0
- package/dist/packages/nodes/scene/package.js.map +1 -0
- package/dist/registerSceneProfile.d.ts +10 -0
- package/dist/registerSceneProfile.d.ts.map +1 -0
- package/dist/registerSceneProfile.js +112 -0
- package/dist/registerSceneProfile.js.map +1 -0
- package/dist/ui/controls/vec3.d.ts +9 -0
- package/dist/ui/controls/vec3.d.ts.map +1 -0
- package/dist/ui/controls/vec3.js +99 -0
- package/dist/ui/controls/vec3.js.map +1 -0
- package/package.json +42 -13
- package/src/Abstractions/Drivers/DummyScene.ts +110 -2
- package/src/Abstractions/IScene.ts +74 -3
- package/src/Nodes/Actions/AddLight.ts +46 -0
- package/src/Nodes/Actions/CloneMesh.ts +31 -0
- package/src/Nodes/Actions/CreateMesh.ts +47 -0
- package/src/Nodes/Actions/DeleteMesh.ts +29 -0
- package/src/Nodes/Actions/EaseSceneProperty.ts +6 -2
- package/src/Nodes/Actions/LookAt.ts +34 -0
- package/src/Nodes/Actions/MoveTowards.ts +55 -0
- package/src/Nodes/Actions/RemoveLight.ts +29 -0
- package/src/Nodes/Actions/SetLightProperty.ts +60 -0
- package/src/Nodes/Actions/SetMaterialProperty.ts +62 -0
- package/src/Nodes/Actions/SetMeshPosition.ts +37 -0
- package/src/Nodes/Actions/SetMeshVisible.ts +31 -0
- package/src/Nodes/Actions/SetSceneProperty.ts +3 -5
- package/src/Nodes/Events/OnAnyMeshClicked.ts +48 -0
- package/src/Nodes/Events/OnSceneChanged.ts +43 -0
- package/src/Nodes/Events/OnSceneNodeClick.ts +3 -3
- package/src/Nodes/Logic/Mat3Nodes.ts +0 -10
- package/src/Nodes/Logic/QuatNodes.ts +11 -11
- package/src/Nodes/Queries/GetDistanceBetween.ts +37 -0
- package/src/Nodes/Queries/GetLightProperty.ts +53 -0
- package/src/Nodes/Queries/GetMaterialProperty.ts +55 -0
- package/src/Nodes/Queries/GetMeshPosition.ts +32 -0
- package/src/Nodes/Queries/GetSceneProperty.ts +4 -5
- package/src/Values/Internal/Mat3.ts +3 -3
- package/src/Values/Internal/Mat4.ts +5 -4
- package/src/Values/Internal/Vec3.ts +5 -4
- package/src/Values/Internal/Vec4.ts +3 -2
- package/src/buildScene.ts +36 -2
- package/src/index.ts +26 -2
- package/src/manifest.source.ts +61 -0
- package/src/registerSceneProfile.ts +41 -4
- package/src/ui/controls/vec3.tsx +69 -0
- package/stories/click.stories.tsx +112 -0
- package/stories/components/DemoScene.ts +610 -0
- package/stories/components/SceneViewer.tsx +204 -0
- package/stories/components/SceneViewerPanel.tsx +41 -0
- package/stories/data/clickDemo.json +94 -0
- package/stories/data/rotate.json +402 -0
- package/stories/index.stories.tsx +90 -0
- package/stories/plugin/sceneViewerPlugin.tsx +88 -0
- package/tests/graphs/logic/Color.json +53 -53
- package/tests/graphs/logic/Euler.json +53 -53
- package/tests/graphs/logic/Quaternion.json +56 -56
- package/tests/graphs/logic/Vector2.json +50 -50
- package/tests/graphs/logic/Vector3.json +53 -53
- package/tests/graphs/logic/Vector4.json +56 -56
- package/tests/manifest.test.ts +65 -0
- package/tests/readSceneGraphs.test.ts +8 -1
- package/tests/registerSceneProfile.test.ts +6 -5
- package/tests/tsconfig.json +10 -10
- package/tsconfig.json +61 -54
- package/tsdown.config.ts +5 -1
- package/vite.config.js +7 -0
- package/src/Values/Internal/Mat2.ts +0 -214
- package/src/loadScene.ts +0 -81
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { GeometryType } from "../../Abstractions/IScene.js";
|
|
2
|
+
import { NodeCategory, makeFlowNodeDefinition } from "@kiberon-labs/behave-graph";
|
|
3
|
+
|
|
4
|
+
//#region src/Nodes/Actions/CreateMesh.ts
|
|
5
|
+
const geometryChoices = Object.values(GeometryType).map((v) => ({
|
|
6
|
+
text: v,
|
|
7
|
+
value: v
|
|
8
|
+
}));
|
|
9
|
+
const CreateMesh = makeFlowNodeDefinition({
|
|
10
|
+
typeName: "scene/createMesh",
|
|
11
|
+
category: NodeCategory.Effect,
|
|
12
|
+
label: "Create Mesh",
|
|
13
|
+
in: {
|
|
14
|
+
flow: "flow",
|
|
15
|
+
name: "string",
|
|
16
|
+
geometryType: (_) => ({
|
|
17
|
+
valueType: "string",
|
|
18
|
+
choices: geometryChoices
|
|
19
|
+
}),
|
|
20
|
+
sizeX: "float",
|
|
21
|
+
sizeY: "float",
|
|
22
|
+
sizeZ: "float"
|
|
23
|
+
},
|
|
24
|
+
out: { flow: "flow" },
|
|
25
|
+
initialState: void 0,
|
|
26
|
+
triggered: ({ commit, read, graph }) => {
|
|
27
|
+
const scene = graph.getDependency("IScene");
|
|
28
|
+
const name = read("name");
|
|
29
|
+
const geometryType = read("geometryType");
|
|
30
|
+
const sizeX = read("sizeX");
|
|
31
|
+
const sizeY = read("sizeY");
|
|
32
|
+
const sizeZ = read("sizeZ");
|
|
33
|
+
scene?.createMesh(name, geometryType, {
|
|
34
|
+
x: sizeX,
|
|
35
|
+
y: sizeY,
|
|
36
|
+
z: sizeZ
|
|
37
|
+
});
|
|
38
|
+
commit("flow");
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { CreateMesh };
|
|
44
|
+
//# sourceMappingURL=CreateMesh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateMesh.js","names":[],"sources":["../../../src/Nodes/Actions/CreateMesh.ts"],"sourcesContent":["import {\n makeFlowNodeDefinition,\n NodeCategory\n} from '@kiberon-labs/behave-graph';\n\nimport { GeometryType } from '../../Abstractions/IScene.js';\n\nconst geometryChoices = Object.values(GeometryType).map((v) => ({\n text: v,\n value: v\n}));\n\nexport const CreateMesh = makeFlowNodeDefinition({\n typeName: 'scene/createMesh',\n category: NodeCategory.Effect,\n label: 'Create Mesh',\n in: {\n flow: 'flow',\n name: 'string',\n geometryType: (_) => ({\n valueType: 'string',\n choices: geometryChoices\n }),\n sizeX: 'float',\n sizeY: 'float',\n sizeZ: 'float'\n },\n out: {\n flow: 'flow'\n },\n initialState: undefined,\n triggered: ({ commit, read, graph }) => {\n const scene = graph.getDependency('IScene');\n const name = read<string>('name');\n const geometryType = read<string>('geometryType');\n const sizeX = read<number>('sizeX');\n const sizeY = read<number>('sizeY');\n const sizeZ = read<number>('sizeZ');\n\n scene?.createMesh(\n name,\n geometryType as (typeof GeometryType)[keyof typeof GeometryType],\n { x: sizeX, y: sizeY, z: sizeZ }\n );\n commit('flow');\n }\n});\n"],"mappings":";;;;AAOA,MAAM,kBAAkB,OAAO,OAAO,aAAa,CAAC,KAAK,OAAO;CAC9D,MAAM;CACN,OAAO;CACR,EAAE;AAEH,MAAa,aAAa,uBAAuB;CAC/C,UAAU;CACV,UAAU,aAAa;CACvB,OAAO;CACP,IAAI;EACF,MAAM;EACN,MAAM;EACN,eAAe,OAAO;GACpB,WAAW;GACX,SAAS;GACV;EACD,OAAO;EACP,OAAO;EACP,OAAO;EACR;CACD,KAAK,EACH,MAAM,QACP;CACD,cAAc;CACd,YAAY,EAAE,QAAQ,MAAM,YAAY;EACtC,MAAM,QAAQ,MAAM,cAAc,SAAS;EAC3C,MAAM,OAAO,KAAa,OAAO;EACjC,MAAM,eAAe,KAAa,eAAe;EACjD,MAAM,QAAQ,KAAa,QAAQ;EACnC,MAAM,QAAQ,KAAa,QAAQ;EACnC,MAAM,QAAQ,KAAa,QAAQ;AAEnC,SAAO,WACL,MACA,cACA;GAAE,GAAG;GAAO,GAAG;GAAO,GAAG;GAAO,CACjC;AACD,SAAO,OAAO;;CAEjB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as _kiberon_labs_behave_graph16 from "@kiberon-labs/behave-graph";
|
|
2
|
+
|
|
3
|
+
//#region src/Nodes/Actions/DeleteMesh.d.ts
|
|
4
|
+
declare const DeleteMesh: _kiberon_labs_behave_graph16.IFlowNodeDefinition<{
|
|
5
|
+
flow: string;
|
|
6
|
+
name: (_: _kiberon_labs_behave_graph16.NodeConfiguration, graphApi: _kiberon_labs_behave_graph16.IGraph) => {
|
|
7
|
+
valueType: string;
|
|
8
|
+
choices: _kiberon_labs_behave_graph16.Choices | undefined;
|
|
9
|
+
};
|
|
10
|
+
}, {
|
|
11
|
+
flow: string;
|
|
12
|
+
}, _kiberon_labs_behave_graph16.NodeConfigurationDescription, undefined>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { DeleteMesh };
|
|
15
|
+
//# sourceMappingURL=DeleteMesh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeleteMesh.d.ts","names":[],"sources":["../../../src/Nodes/Actions/DeleteMesh.ts"],"sourcesContent":[],"mappings":";;;cAKa,yCAAU;;YAuBrB,4BAAA,CAAA;IAvBW,SAuBX,EAAA,MAAA;IAAA,OAAA,yCAAA,SAAA;;;;8DAvBqB,SAAA,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { NodeCategory, makeFlowNodeDefinition } from "@kiberon-labs/behave-graph";
|
|
2
|
+
|
|
3
|
+
//#region src/Nodes/Actions/DeleteMesh.ts
|
|
4
|
+
const DeleteMesh = makeFlowNodeDefinition({
|
|
5
|
+
typeName: "scene/deleteMesh",
|
|
6
|
+
category: NodeCategory.Effect,
|
|
7
|
+
label: "Delete Mesh",
|
|
8
|
+
in: {
|
|
9
|
+
flow: "flow",
|
|
10
|
+
name: (_, graphApi) => {
|
|
11
|
+
return {
|
|
12
|
+
valueType: "string",
|
|
13
|
+
choices: graphApi.getDependency("IScene")?.getMeshNames()
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
out: { flow: "flow" },
|
|
18
|
+
initialState: void 0,
|
|
19
|
+
triggered: ({ commit, read, graph }) => {
|
|
20
|
+
graph.getDependency("IScene")?.deleteMesh(read("name"));
|
|
21
|
+
commit("flow");
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { DeleteMesh };
|
|
27
|
+
//# sourceMappingURL=DeleteMesh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeleteMesh.js","names":[],"sources":["../../../src/Nodes/Actions/DeleteMesh.ts"],"sourcesContent":["import {\n makeFlowNodeDefinition,\n NodeCategory\n} from '@kiberon-labs/behave-graph';\n\nexport const DeleteMesh = makeFlowNodeDefinition({\n typeName: 'scene/deleteMesh',\n category: NodeCategory.Effect,\n label: 'Delete Mesh',\n in: {\n flow: 'flow',\n name: (_, graphApi) => {\n const scene = graphApi.getDependency('IScene');\n return {\n valueType: 'string',\n choices: scene?.getMeshNames()\n };\n }\n },\n out: {\n flow: 'flow'\n },\n initialState: undefined,\n triggered: ({ commit, read, graph }) => {\n const scene = graph.getDependency('IScene');\n scene?.deleteMesh(read<string>('name'));\n commit('flow');\n }\n});\n"],"mappings":";;;AAKA,MAAa,aAAa,uBAAuB;CAC/C,UAAU;CACV,UAAU,aAAa;CACvB,OAAO;CACP,IAAI;EACF,MAAM;EACN,OAAO,GAAG,aAAa;AAErB,UAAO;IACL,WAAW;IACX,SAHY,SAAS,cAAc,SAAS,EAG5B,cAAc;IAC/B;;EAEJ;CACD,KAAK,EACH,MAAM,QACP;CACD,cAAc;CACd,YAAY,EAAE,QAAQ,MAAM,YAAY;AAEtC,EADc,MAAM,cAAc,SAAS,EACpC,WAAW,KAAa,OAAO,CAAC;AACvC,SAAO,OAAO;;CAEjB,CAAC"}
|
|
@@ -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[]): NodeDescription[];
|
|
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":";;;;cAkBa,iBAAA,SAA0B,SAAA;gCAE5B,+BACgB,sDACI;EAJlB,SAAA,aAAkB,EAAA,MAAA;EAEpB,iBAAA,KAAA;EACgB,iBAAA,qBAAA;EACI,WAAA,CAAA,WAAA,EA0Bd,eA1Bc,EAAA,KAAA,EA2BpB,MA3BoB,EAAA,aAAA,EAAA,MAAA,EAAA,KAAA,EA6BpB,MA7BoB,EAAA,qBAAA,EA8BJ,sBA9BI,EAAA,EAAA,EAAA,MAAA;EA0Bd,QAAA,YAAA;EACN,QAAA,WAAA;EAEA,QAAA,QAAA;EACgB,QAAA,eAAA;EA6Cf,QAAA,MAAA;EA/E2B,QAAA,SAAA;EAAS,QAAA,MAAA;oBA+EpC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { AsyncNode, EasingFunctions, EasingModes, Engine, NodeDescription, Socket, lerpValue, 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 = lerpValue(valueType, 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 EasingFunctions,\n EasingModes,\n Engine,\n type IGraph,\n type ILifecycleEventEmitter,\n lerpValue,\n NodeDescription,\n Socket,\n toCamelCase\n} from '@kiberon-labs/behave-graph';\n\n/** An easing curve: maps a normalized time `t` in [0,1] to an eased value. */\ntype Easing = (typeof EasingFunctions)[keyof typeof EasingFunctions];\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 = lerpValue(\n valueType,\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":";;;AAkBA,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,UACjB,WACA,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,16 @@
|
|
|
1
|
+
import * as _kiberon_labs_behave_graph0 from "@kiberon-labs/behave-graph";
|
|
2
|
+
|
|
3
|
+
//#region src/Nodes/Actions/LookAt.d.ts
|
|
4
|
+
declare const LookAt: _kiberon_labs_behave_graph0.IFlowNodeDefinition<{
|
|
5
|
+
flow: string;
|
|
6
|
+
meshName: (_: _kiberon_labs_behave_graph0.NodeConfiguration, graphApi: _kiberon_labs_behave_graph0.IGraph) => {
|
|
7
|
+
valueType: string;
|
|
8
|
+
choices: _kiberon_labs_behave_graph0.Choices | undefined;
|
|
9
|
+
};
|
|
10
|
+
target: string;
|
|
11
|
+
}, {
|
|
12
|
+
flow: string;
|
|
13
|
+
}, _kiberon_labs_behave_graph0.NodeConfigurationDescription, undefined>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { LookAt };
|
|
16
|
+
//# sourceMappingURL=LookAt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LookAt.d.ts","names":[],"sources":["../../../src/Nodes/Actions/LookAt.ts"],"sourcesContent":[],"mappings":";;;cAOa,oCAAM;;gBA0BjB,2BAAA,CAAA;IA1BW,SA0BX,EAAA,MAAA;IAAA,OAAA,wCAAA,SAAA;;;;;CA1BiB,4DAAA,SAAA,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { NodeCategory, makeFlowNodeDefinition } from "@kiberon-labs/behave-graph";
|
|
2
|
+
|
|
3
|
+
//#region src/Nodes/Actions/LookAt.ts
|
|
4
|
+
const LookAt = makeFlowNodeDefinition({
|
|
5
|
+
typeName: "scene/lookAt",
|
|
6
|
+
category: NodeCategory.Effect,
|
|
7
|
+
label: "Look At",
|
|
8
|
+
in: {
|
|
9
|
+
flow: "flow",
|
|
10
|
+
meshName: (_, graphApi) => {
|
|
11
|
+
return {
|
|
12
|
+
valueType: "string",
|
|
13
|
+
choices: graphApi.getDependency("IScene")?.getMeshNames()
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
target: "vec3"
|
|
17
|
+
},
|
|
18
|
+
out: { flow: "flow" },
|
|
19
|
+
initialState: void 0,
|
|
20
|
+
triggered: ({ commit, read, graph }) => {
|
|
21
|
+
const scene = graph.getDependency("IScene");
|
|
22
|
+
const meshName = read("meshName");
|
|
23
|
+
const target = read("target");
|
|
24
|
+
scene?.lookAt(meshName, {
|
|
25
|
+
x: target.x,
|
|
26
|
+
y: target.y,
|
|
27
|
+
z: target.z
|
|
28
|
+
});
|
|
29
|
+
commit("flow");
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { LookAt };
|
|
35
|
+
//# sourceMappingURL=LookAt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LookAt.js","names":[],"sources":["../../../src/Nodes/Actions/LookAt.ts"],"sourcesContent":["import type { Vec3 } from '@/Values/Internal/Vec3';\nimport {\n makeFlowNodeDefinition,\n NodeCategory\n} from '@kiberon-labs/behave-graph';\n\n// Orient a mesh to face a world-space target position.\nexport const LookAt = makeFlowNodeDefinition({\n typeName: 'scene/lookAt',\n category: NodeCategory.Effect,\n label: 'Look At',\n in: {\n flow: 'flow',\n meshName: (_, graphApi) => {\n const scene = graphApi.getDependency('IScene');\n return {\n valueType: 'string',\n choices: scene?.getMeshNames()\n };\n },\n target: 'vec3'\n },\n out: {\n flow: 'flow'\n },\n initialState: undefined,\n triggered: ({ commit, read, graph }) => {\n const scene = graph.getDependency('IScene');\n const meshName = read<string>('meshName');\n const target = read<Vec3>('target');\n scene?.lookAt(meshName, { x: target.x, y: target.y, z: target.z });\n commit('flow');\n }\n});\n"],"mappings":";;;AAOA,MAAa,SAAS,uBAAuB;CAC3C,UAAU;CACV,UAAU,aAAa;CACvB,OAAO;CACP,IAAI;EACF,MAAM;EACN,WAAW,GAAG,aAAa;AAEzB,UAAO;IACL,WAAW;IACX,SAHY,SAAS,cAAc,SAAS,EAG5B,cAAc;IAC/B;;EAEH,QAAQ;EACT;CACD,KAAK,EACH,MAAM,QACP;CACD,cAAc;CACd,YAAY,EAAE,QAAQ,MAAM,YAAY;EACtC,MAAM,QAAQ,MAAM,cAAc,SAAS;EAC3C,MAAM,WAAW,KAAa,WAAW;EACzC,MAAM,SAAS,KAAW,SAAS;AACnC,SAAO,OAAO,UAAU;GAAE,GAAG,OAAO;GAAG,GAAG,OAAO;GAAG,GAAG,OAAO;GAAG,CAAC;AAClE,SAAO,OAAO;;CAEjB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as _kiberon_labs_behave_graph26 from "@kiberon-labs/behave-graph";
|
|
2
|
+
|
|
3
|
+
//#region src/Nodes/Actions/MoveTowards.d.ts
|
|
4
|
+
declare const MoveTowards: _kiberon_labs_behave_graph26.IFlowNodeDefinition<{
|
|
5
|
+
flow: string;
|
|
6
|
+
meshName: (_: _kiberon_labs_behave_graph26.NodeConfiguration, graphApi: _kiberon_labs_behave_graph26.IGraph) => {
|
|
7
|
+
valueType: string;
|
|
8
|
+
choices: _kiberon_labs_behave_graph26.Choices | undefined;
|
|
9
|
+
};
|
|
10
|
+
targetX: string;
|
|
11
|
+
targetY: string;
|
|
12
|
+
targetZ: string;
|
|
13
|
+
speed: string;
|
|
14
|
+
deltaSeconds: string;
|
|
15
|
+
}, {
|
|
16
|
+
ongoing: string;
|
|
17
|
+
done: string;
|
|
18
|
+
}, _kiberon_labs_behave_graph26.NodeConfigurationDescription, undefined>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { MoveTowards };
|
|
21
|
+
//# sourceMappingURL=MoveTowards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoveTowards.d.ts","names":[],"sources":["../../../src/Nodes/Actions/MoveTowards.ts"],"sourcesContent":[],"mappings":";;;cAQa,0CAAW;;gBA8CtB,4BAAA,CAAA;IA9CW,SAAA,EA8CX,MAAA;IAAA,OAAA,yCAAA,SAAA;;;;;EA9CsB,KAAA,EAAA,MAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { NodeCategory, makeFlowNodeDefinition } from "@kiberon-labs/behave-graph";
|
|
2
|
+
|
|
3
|
+
//#region src/Nodes/Actions/MoveTowards.ts
|
|
4
|
+
const MoveTowards = makeFlowNodeDefinition({
|
|
5
|
+
typeName: "scene/moveTowards",
|
|
6
|
+
category: NodeCategory.Effect,
|
|
7
|
+
label: "Move Towards",
|
|
8
|
+
in: {
|
|
9
|
+
flow: "flow",
|
|
10
|
+
meshName: (_, graphApi) => {
|
|
11
|
+
return {
|
|
12
|
+
valueType: "string",
|
|
13
|
+
choices: graphApi.getDependency("IScene")?.getMeshNames()
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
targetX: "float",
|
|
17
|
+
targetY: "float",
|
|
18
|
+
targetZ: "float",
|
|
19
|
+
speed: "float",
|
|
20
|
+
deltaSeconds: "float"
|
|
21
|
+
},
|
|
22
|
+
out: {
|
|
23
|
+
ongoing: "flow",
|
|
24
|
+
done: "flow"
|
|
25
|
+
},
|
|
26
|
+
initialState: void 0,
|
|
27
|
+
triggered: ({ commit, read, graph }) => {
|
|
28
|
+
const scene = graph.getDependency("IScene");
|
|
29
|
+
const meshName = read("meshName");
|
|
30
|
+
const targetX = read("targetX");
|
|
31
|
+
const targetY = read("targetY");
|
|
32
|
+
const targetZ = read("targetZ");
|
|
33
|
+
const speed = read("speed");
|
|
34
|
+
const deltaSeconds = read("deltaSeconds");
|
|
35
|
+
if (scene?.moveTowards(meshName, {
|
|
36
|
+
x: targetX,
|
|
37
|
+
y: targetY,
|
|
38
|
+
z: targetZ
|
|
39
|
+
}, speed, deltaSeconds)) commit("done");
|
|
40
|
+
else commit("ongoing");
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { MoveTowards };
|
|
46
|
+
//# sourceMappingURL=MoveTowards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoveTowards.js","names":[],"sources":["../../../src/Nodes/Actions/MoveTowards.ts"],"sourcesContent":["import {\n makeFlowNodeDefinition,\n NodeCategory\n} from '@kiberon-labs/behave-graph';\n\n// Move a mesh towards a target position by (speed * deltaSeconds).\n// Outputs 'done' when the mesh has arrived, otherwise 'ongoing'.\n// Designed to be driven from an OnTick loop.\nexport const MoveTowards = makeFlowNodeDefinition({\n typeName: 'scene/moveTowards',\n category: NodeCategory.Effect,\n label: 'Move Towards',\n in: {\n flow: 'flow',\n meshName: (_, graphApi) => {\n const scene = graphApi.getDependency('IScene');\n return {\n valueType: 'string',\n choices: scene?.getMeshNames()\n };\n },\n targetX: 'float',\n targetY: 'float',\n targetZ: 'float',\n speed: 'float',\n deltaSeconds: 'float'\n },\n out: {\n ongoing: 'flow',\n done: 'flow'\n },\n initialState: undefined,\n triggered: ({ commit, read, graph }) => {\n const scene = graph.getDependency('IScene');\n const meshName = read<string>('meshName');\n const targetX = read<number>('targetX');\n const targetY = read<number>('targetY');\n const targetZ = read<number>('targetZ');\n const speed = read<number>('speed');\n const deltaSeconds = read<number>('deltaSeconds');\n\n const arrived = scene?.moveTowards(\n meshName,\n { x: targetX, y: targetY, z: targetZ },\n speed,\n deltaSeconds\n );\n\n if (arrived) {\n commit('done');\n } else {\n commit('ongoing');\n }\n }\n});\n"],"mappings":";;;AAQA,MAAa,cAAc,uBAAuB;CAChD,UAAU;CACV,UAAU,aAAa;CACvB,OAAO;CACP,IAAI;EACF,MAAM;EACN,WAAW,GAAG,aAAa;AAEzB,UAAO;IACL,WAAW;IACX,SAHY,SAAS,cAAc,SAAS,EAG5B,cAAc;IAC/B;;EAEH,SAAS;EACT,SAAS;EACT,SAAS;EACT,OAAO;EACP,cAAc;EACf;CACD,KAAK;EACH,SAAS;EACT,MAAM;EACP;CACD,cAAc;CACd,YAAY,EAAE,QAAQ,MAAM,YAAY;EACtC,MAAM,QAAQ,MAAM,cAAc,SAAS;EAC3C,MAAM,WAAW,KAAa,WAAW;EACzC,MAAM,UAAU,KAAa,UAAU;EACvC,MAAM,UAAU,KAAa,UAAU;EACvC,MAAM,UAAU,KAAa,UAAU;EACvC,MAAM,QAAQ,KAAa,QAAQ;EACnC,MAAM,eAAe,KAAa,eAAe;AASjD,MAPgB,OAAO,YACrB,UACA;GAAE,GAAG;GAAS,GAAG;GAAS,GAAG;GAAS,EACtC,OACA,aACD,CAGC,QAAO,OAAO;MAEd,QAAO,UAAU;;CAGtB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as _kiberon_labs_behave_graph31 from "@kiberon-labs/behave-graph";
|
|
2
|
+
|
|
3
|
+
//#region src/Nodes/Actions/RemoveLight.d.ts
|
|
4
|
+
declare const RemoveLight: _kiberon_labs_behave_graph31.IFlowNodeDefinition<{
|
|
5
|
+
flow: string;
|
|
6
|
+
name: (_: _kiberon_labs_behave_graph31.NodeConfiguration, graphApi: _kiberon_labs_behave_graph31.IGraph) => {
|
|
7
|
+
valueType: string;
|
|
8
|
+
choices: _kiberon_labs_behave_graph31.Choices | undefined;
|
|
9
|
+
};
|
|
10
|
+
}, {
|
|
11
|
+
flow: string;
|
|
12
|
+
}, _kiberon_labs_behave_graph31.NodeConfigurationDescription, undefined>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { RemoveLight };
|
|
15
|
+
//# sourceMappingURL=RemoveLight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemoveLight.d.ts","names":[],"sources":["../../../src/Nodes/Actions/RemoveLight.ts"],"sourcesContent":[],"mappings":";;;cAKa,0CAAW;;YAuBtB,4BAAA,CAAA;IAvBW,SAAA,EAuBX,MAAA;IAAA,OAAA,yCAAA,SAAA;;;;8DAvBsB,SAAA,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { NodeCategory, makeFlowNodeDefinition } from "@kiberon-labs/behave-graph";
|
|
2
|
+
|
|
3
|
+
//#region src/Nodes/Actions/RemoveLight.ts
|
|
4
|
+
const RemoveLight = makeFlowNodeDefinition({
|
|
5
|
+
typeName: "scene/removeLight",
|
|
6
|
+
category: NodeCategory.Effect,
|
|
7
|
+
label: "Remove Light",
|
|
8
|
+
in: {
|
|
9
|
+
flow: "flow",
|
|
10
|
+
name: (_, graphApi) => {
|
|
11
|
+
return {
|
|
12
|
+
valueType: "string",
|
|
13
|
+
choices: graphApi.getDependency("IScene")?.getLightNames()
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
out: { flow: "flow" },
|
|
18
|
+
initialState: void 0,
|
|
19
|
+
triggered: ({ commit, read, graph }) => {
|
|
20
|
+
graph.getDependency("IScene")?.removeLight(read("name"));
|
|
21
|
+
commit("flow");
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { RemoveLight };
|
|
27
|
+
//# sourceMappingURL=RemoveLight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemoveLight.js","names":[],"sources":["../../../src/Nodes/Actions/RemoveLight.ts"],"sourcesContent":["import {\n makeFlowNodeDefinition,\n NodeCategory\n} from '@kiberon-labs/behave-graph';\n\nexport const RemoveLight = makeFlowNodeDefinition({\n typeName: 'scene/removeLight',\n category: NodeCategory.Effect,\n label: 'Remove Light',\n in: {\n flow: 'flow',\n name: (_, graphApi) => {\n const scene = graphApi.getDependency('IScene');\n return {\n valueType: 'string',\n choices: scene?.getLightNames()\n };\n }\n },\n out: {\n flow: 'flow'\n },\n initialState: undefined,\n triggered: ({ commit, read, graph }) => {\n const scene = graph.getDependency('IScene');\n scene?.removeLight(read<string>('name'));\n commit('flow');\n }\n});\n"],"mappings":";;;AAKA,MAAa,cAAc,uBAAuB;CAChD,UAAU;CACV,UAAU,aAAa;CACvB,OAAO;CACP,IAAI;EACF,MAAM;EACN,OAAO,GAAG,aAAa;AAErB,UAAO;IACL,WAAW;IACX,SAHY,SAAS,cAAc,SAAS,EAG5B,eAAe;IAChC;;EAEJ;CACD,KAAK,EACH,MAAM,QACP;CACD,cAAc;CACd,YAAY,EAAE,QAAQ,MAAM,YAAY;AAEtC,EADc,MAAM,cAAc,SAAS,EACpC,YAAY,KAAa,OAAO,CAAC;AACxC,SAAO,OAAO;;CAEjB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as _kiberon_labs_behave_graph36 from "@kiberon-labs/behave-graph";
|
|
2
|
+
|
|
3
|
+
//#region src/Nodes/Actions/SetLightProperty.d.ts
|
|
4
|
+
declare const SetLightProperty: _kiberon_labs_behave_graph36.IFlowNodeDefinition<{
|
|
5
|
+
flow: string;
|
|
6
|
+
name: (_: _kiberon_labs_behave_graph36.NodeConfiguration, graphApi: _kiberon_labs_behave_graph36.IGraph) => {
|
|
7
|
+
valueType: string;
|
|
8
|
+
choices: _kiberon_labs_behave_graph36.Choices | undefined;
|
|
9
|
+
};
|
|
10
|
+
property: (_: _kiberon_labs_behave_graph36.NodeConfiguration) => {
|
|
11
|
+
valueType: string;
|
|
12
|
+
choices: {
|
|
13
|
+
text: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
floatValue: string;
|
|
18
|
+
colorValue: string;
|
|
19
|
+
vec3Value: string;
|
|
20
|
+
}, {
|
|
21
|
+
flow: string;
|
|
22
|
+
}, _kiberon_labs_behave_graph36.NodeConfigurationDescription, undefined>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { SetLightProperty };
|
|
25
|
+
//# sourceMappingURL=SetLightProperty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetLightProperty.d.ts","names":[],"sources":["../../../src/Nodes/Actions/SetLightProperty.ts"],"sourcesContent":[],"mappings":";;;cAWa,+CAAgB;;YAgD3B,4BAAA,CAAA;IAhDW,SAAA,EAAA,MAgDX;IAAA,OAAA,yCAAA,SAAA;;;;;;MAhD2B,KAAA,EAAA,MAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { NodeCategory, makeFlowNodeDefinition } from "@kiberon-labs/behave-graph";
|
|
2
|
+
|
|
3
|
+
//#region src/Nodes/Actions/SetLightProperty.ts
|
|
4
|
+
const lightPropertyChoices = [
|
|
5
|
+
{
|
|
6
|
+
text: "color",
|
|
7
|
+
value: "color"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
text: "intensity",
|
|
11
|
+
value: "intensity"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
text: "position",
|
|
15
|
+
value: "position"
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
const SetLightProperty = makeFlowNodeDefinition({
|
|
19
|
+
typeName: "scene/setLightProperty",
|
|
20
|
+
category: NodeCategory.Effect,
|
|
21
|
+
label: "Set Light Property",
|
|
22
|
+
in: {
|
|
23
|
+
flow: "flow",
|
|
24
|
+
name: (_, graphApi) => {
|
|
25
|
+
return {
|
|
26
|
+
valueType: "string",
|
|
27
|
+
choices: graphApi.getDependency("IScene")?.getLightNames()
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
property: (_) => ({
|
|
31
|
+
valueType: "string",
|
|
32
|
+
choices: lightPropertyChoices
|
|
33
|
+
}),
|
|
34
|
+
floatValue: "float",
|
|
35
|
+
colorValue: "color",
|
|
36
|
+
vec3Value: "vec3"
|
|
37
|
+
},
|
|
38
|
+
out: { flow: "flow" },
|
|
39
|
+
initialState: void 0,
|
|
40
|
+
triggered: ({ commit, read, graph }) => {
|
|
41
|
+
const scene = graph.getDependency("IScene");
|
|
42
|
+
const name = read("name");
|
|
43
|
+
const property = read("property");
|
|
44
|
+
let value;
|
|
45
|
+
switch (property) {
|
|
46
|
+
case "intensity":
|
|
47
|
+
value = read("floatValue");
|
|
48
|
+
break;
|
|
49
|
+
case "color":
|
|
50
|
+
value = read("colorValue");
|
|
51
|
+
break;
|
|
52
|
+
case "position":
|
|
53
|
+
value = read("vec3Value");
|
|
54
|
+
break;
|
|
55
|
+
default: value = read("floatValue");
|
|
56
|
+
}
|
|
57
|
+
scene?.setLightProperty(name, property, value);
|
|
58
|
+
commit("flow");
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { SetLightProperty };
|
|
64
|
+
//# sourceMappingURL=SetLightProperty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetLightProperty.js","names":["value: unknown"],"sources":["../../../src/Nodes/Actions/SetLightProperty.ts"],"sourcesContent":["import {\n makeFlowNodeDefinition,\n NodeCategory\n} from '@kiberon-labs/behave-graph';\n\nconst lightPropertyChoices = [\n { text: 'color', value: 'color' },\n { text: 'intensity', value: 'intensity' },\n { text: 'position', value: 'position' }\n];\n\nexport const SetLightProperty = makeFlowNodeDefinition({\n typeName: 'scene/setLightProperty',\n category: NodeCategory.Effect,\n label: 'Set Light Property',\n in: {\n flow: 'flow',\n name: (_, graphApi) => {\n const scene = graphApi.getDependency('IScene');\n return {\n valueType: 'string',\n choices: scene?.getLightNames()\n };\n },\n property: (_) => ({\n valueType: 'string',\n choices: lightPropertyChoices\n }),\n floatValue: 'float',\n colorValue: 'color',\n vec3Value: 'vec3'\n },\n out: {\n flow: 'flow'\n },\n initialState: undefined,\n triggered: ({ commit, read, graph }) => {\n const scene = graph.getDependency('IScene');\n const name = read<string>('name');\n const property = read<string>('property');\n\n let value: unknown;\n switch (property) {\n case 'intensity':\n value = read<number>('floatValue');\n break;\n case 'color':\n value = read('colorValue');\n break;\n case 'position':\n value = read('vec3Value');\n break;\n default:\n value = read<number>('floatValue');\n }\n\n scene?.setLightProperty(name, property, value);\n commit('flow');\n }\n});\n"],"mappings":";;;AAKA,MAAM,uBAAuB;CAC3B;EAAE,MAAM;EAAS,OAAO;EAAS;CACjC;EAAE,MAAM;EAAa,OAAO;EAAa;CACzC;EAAE,MAAM;EAAY,OAAO;EAAY;CACxC;AAED,MAAa,mBAAmB,uBAAuB;CACrD,UAAU;CACV,UAAU,aAAa;CACvB,OAAO;CACP,IAAI;EACF,MAAM;EACN,OAAO,GAAG,aAAa;AAErB,UAAO;IACL,WAAW;IACX,SAHY,SAAS,cAAc,SAAS,EAG5B,eAAe;IAChC;;EAEH,WAAW,OAAO;GAChB,WAAW;GACX,SAAS;GACV;EACD,YAAY;EACZ,YAAY;EACZ,WAAW;EACZ;CACD,KAAK,EACH,MAAM,QACP;CACD,cAAc;CACd,YAAY,EAAE,QAAQ,MAAM,YAAY;EACtC,MAAM,QAAQ,MAAM,cAAc,SAAS;EAC3C,MAAM,OAAO,KAAa,OAAO;EACjC,MAAM,WAAW,KAAa,WAAW;EAEzC,IAAIA;AACJ,UAAQ,UAAR;GACE,KAAK;AACH,YAAQ,KAAa,aAAa;AAClC;GACF,KAAK;AACH,YAAQ,KAAK,aAAa;AAC1B;GACF,KAAK;AACH,YAAQ,KAAK,YAAY;AACzB;GACF,QACE,SAAQ,KAAa,aAAa;;AAGtC,SAAO,iBAAiB,MAAM,UAAU,MAAM;AAC9C,SAAO,OAAO;;CAEjB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as _kiberon_labs_behave_graph42 from "@kiberon-labs/behave-graph";
|
|
2
|
+
|
|
3
|
+
//#region src/Nodes/Actions/SetMaterialProperty.d.ts
|
|
4
|
+
declare const SetMaterialProperty: _kiberon_labs_behave_graph42.IFlowNodeDefinition<{
|
|
5
|
+
flow: string;
|
|
6
|
+
meshName: (_: _kiberon_labs_behave_graph42.NodeConfiguration, graphApi: _kiberon_labs_behave_graph42.IGraph) => {
|
|
7
|
+
valueType: string;
|
|
8
|
+
choices: _kiberon_labs_behave_graph42.Choices | undefined;
|
|
9
|
+
};
|
|
10
|
+
property: (_: _kiberon_labs_behave_graph42.NodeConfiguration) => {
|
|
11
|
+
valueType: string;
|
|
12
|
+
choices: {
|
|
13
|
+
text: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
floatValue: string;
|
|
18
|
+
booleanValue: string;
|
|
19
|
+
colorValue: string;
|
|
20
|
+
}, {
|
|
21
|
+
flow: string;
|
|
22
|
+
}, _kiberon_labs_behave_graph42.NodeConfigurationDescription, undefined>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { SetMaterialProperty };
|
|
25
|
+
//# sourceMappingURL=SetMaterialProperty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetMaterialProperty.d.ts","names":[],"sources":["../../../src/Nodes/Actions/SetMaterialProperty.ts"],"sourcesContent":[],"mappings":";;;cAYa,kDAAmB;;gBAiD9B,4BAAA,CAAA;IAjDW,SAAA,EAAA,MAAA;IAiDX,OAAA,yCAAA,SAAA;;;;;;MAjD8B,KAAA,EAAA,MAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { NodeCategory, makeFlowNodeDefinition } from "@kiberon-labs/behave-graph";
|
|
2
|
+
|
|
3
|
+
//#region src/Nodes/Actions/SetMaterialProperty.ts
|
|
4
|
+
const materialPropertyChoices = [
|
|
5
|
+
{
|
|
6
|
+
text: "color",
|
|
7
|
+
value: "color"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
text: "opacity",
|
|
11
|
+
value: "opacity"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
text: "visible",
|
|
15
|
+
value: "visible"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
text: "wireframe",
|
|
19
|
+
value: "wireframe"
|
|
20
|
+
}
|
|
21
|
+
];
|
|
22
|
+
const SetMaterialProperty = makeFlowNodeDefinition({
|
|
23
|
+
typeName: "scene/setMaterialProperty",
|
|
24
|
+
category: NodeCategory.Effect,
|
|
25
|
+
label: "Set Material Property",
|
|
26
|
+
in: {
|
|
27
|
+
flow: "flow",
|
|
28
|
+
meshName: (_, graphApi) => {
|
|
29
|
+
return {
|
|
30
|
+
valueType: "string",
|
|
31
|
+
choices: graphApi.getDependency("IScene")?.getMeshNames()
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
property: (_) => ({
|
|
35
|
+
valueType: "string",
|
|
36
|
+
choices: materialPropertyChoices
|
|
37
|
+
}),
|
|
38
|
+
floatValue: "float",
|
|
39
|
+
booleanValue: "boolean",
|
|
40
|
+
colorValue: "color"
|
|
41
|
+
},
|
|
42
|
+
out: { flow: "flow" },
|
|
43
|
+
initialState: void 0,
|
|
44
|
+
triggered: ({ commit, read, graph }) => {
|
|
45
|
+
const scene = graph.getDependency("IScene");
|
|
46
|
+
const meshName = read("meshName");
|
|
47
|
+
const property = read("property");
|
|
48
|
+
let value;
|
|
49
|
+
switch (property) {
|
|
50
|
+
case "color":
|
|
51
|
+
value = read("colorValue");
|
|
52
|
+
break;
|
|
53
|
+
case "opacity":
|
|
54
|
+
value = read("floatValue");
|
|
55
|
+
break;
|
|
56
|
+
case "visible":
|
|
57
|
+
case "wireframe":
|
|
58
|
+
value = read("booleanValue");
|
|
59
|
+
break;
|
|
60
|
+
default: value = read("floatValue");
|
|
61
|
+
}
|
|
62
|
+
scene?.setMaterialProperty(meshName, property, value);
|
|
63
|
+
commit("flow");
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
export { SetMaterialProperty };
|
|
69
|
+
//# sourceMappingURL=SetMaterialProperty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetMaterialProperty.js","names":["value: unknown"],"sources":["../../../src/Nodes/Actions/SetMaterialProperty.ts"],"sourcesContent":["import {\n makeFlowNodeDefinition,\n NodeCategory\n} from '@kiberon-labs/behave-graph';\n\nconst materialPropertyChoices = [\n { text: 'color', value: 'color' },\n { text: 'opacity', value: 'opacity' },\n { text: 'visible', value: 'visible' },\n { text: 'wireframe', value: 'wireframe' }\n];\n\nexport const SetMaterialProperty = makeFlowNodeDefinition({\n typeName: 'scene/setMaterialProperty',\n category: NodeCategory.Effect,\n label: 'Set Material Property',\n in: {\n flow: 'flow',\n meshName: (_, graphApi) => {\n const scene = graphApi.getDependency('IScene');\n return {\n valueType: 'string',\n choices: scene?.getMeshNames()\n };\n },\n property: (_) => ({\n valueType: 'string',\n choices: materialPropertyChoices\n }),\n floatValue: 'float',\n booleanValue: 'boolean',\n colorValue: 'color'\n },\n out: {\n flow: 'flow'\n },\n initialState: undefined,\n triggered: ({ commit, read, graph }) => {\n const scene = graph.getDependency('IScene');\n const meshName = read<string>('meshName');\n const property = read<string>('property');\n\n let value: unknown;\n switch (property) {\n case 'color':\n value = read('colorValue');\n break;\n case 'opacity':\n value = read<number>('floatValue');\n break;\n case 'visible':\n case 'wireframe':\n value = read<boolean>('booleanValue');\n break;\n default:\n value = read<number>('floatValue');\n }\n\n scene?.setMaterialProperty(meshName, property, value);\n commit('flow');\n }\n});\n"],"mappings":";;;AAKA,MAAM,0BAA0B;CAC9B;EAAE,MAAM;EAAS,OAAO;EAAS;CACjC;EAAE,MAAM;EAAW,OAAO;EAAW;CACrC;EAAE,MAAM;EAAW,OAAO;EAAW;CACrC;EAAE,MAAM;EAAa,OAAO;EAAa;CAC1C;AAED,MAAa,sBAAsB,uBAAuB;CACxD,UAAU;CACV,UAAU,aAAa;CACvB,OAAO;CACP,IAAI;EACF,MAAM;EACN,WAAW,GAAG,aAAa;AAEzB,UAAO;IACL,WAAW;IACX,SAHY,SAAS,cAAc,SAAS,EAG5B,cAAc;IAC/B;;EAEH,WAAW,OAAO;GAChB,WAAW;GACX,SAAS;GACV;EACD,YAAY;EACZ,cAAc;EACd,YAAY;EACb;CACD,KAAK,EACH,MAAM,QACP;CACD,cAAc;CACd,YAAY,EAAE,QAAQ,MAAM,YAAY;EACtC,MAAM,QAAQ,MAAM,cAAc,SAAS;EAC3C,MAAM,WAAW,KAAa,WAAW;EACzC,MAAM,WAAW,KAAa,WAAW;EAEzC,IAAIA;AACJ,UAAQ,UAAR;GACE,KAAK;AACH,YAAQ,KAAK,aAAa;AAC1B;GACF,KAAK;AACH,YAAQ,KAAa,aAAa;AAClC;GACF,KAAK;GACL,KAAK;AACH,YAAQ,KAAc,eAAe;AACrC;GACF,QACE,SAAQ,KAAa,aAAa;;AAGtC,SAAO,oBAAoB,UAAU,UAAU,MAAM;AACrD,SAAO,OAAO;;CAEjB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as _kiberon_labs_behave_graph48 from "@kiberon-labs/behave-graph";
|
|
2
|
+
|
|
3
|
+
//#region src/Nodes/Actions/SetMeshPosition.d.ts
|
|
4
|
+
declare const SetMeshPosition: _kiberon_labs_behave_graph48.IFlowNodeDefinition<{
|
|
5
|
+
flow: string;
|
|
6
|
+
meshName: (_: _kiberon_labs_behave_graph48.NodeConfiguration, graphApi: _kiberon_labs_behave_graph48.IGraph) => {
|
|
7
|
+
valueType: string;
|
|
8
|
+
choices: _kiberon_labs_behave_graph48.Choices | undefined;
|
|
9
|
+
};
|
|
10
|
+
x: string;
|
|
11
|
+
y: string;
|
|
12
|
+
z: string;
|
|
13
|
+
}, {
|
|
14
|
+
flow: string;
|
|
15
|
+
}, _kiberon_labs_behave_graph48.NodeConfigurationDescription, undefined>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { SetMeshPosition };
|
|
18
|
+
//# sourceMappingURL=SetMeshPosition.d.ts.map
|