From 3cf7fdde190aab0149ded43cade1ebbad7f66a1a Mon Sep 17 00:00:00 2001 From: Robert Dorn Date: Wed, 18 Dec 2024 11:14:10 +0100 Subject: [PATCH] added missing math/length registrations --- src/BasicBehaveEngine/BasicBehaveEngine.ts | 2 ++ src/authoring/AuthoringNodeSpecs.ts | 31 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/BasicBehaveEngine/BasicBehaveEngine.ts b/src/BasicBehaveEngine/BasicBehaveEngine.ts index ae35115..34899c6 100644 --- a/src/BasicBehaveEngine/BasicBehaveEngine.ts +++ b/src/BasicBehaveEngine/BasicBehaveEngine.ts @@ -54,6 +54,7 @@ import {SquareRoot} from "./nodes/math/exponential/SquareRoot"; import {CubeRoot} from "./nodes/math/exponential/CubeRoot"; import {Random} from "./nodes/experimental/Random"; import {Dot} from "./nodes/math/vector/Dot"; +import {Normalize} from "./nodes/math/vector/Normalize"; import {Rotate2D} from "./nodes/math/vector/Rotate2D"; import {Rotate3D} from "./nodes/math/vector/Rotate3D"; import {VectorLength} from "./nodes/math/vector/VectorLength"; @@ -389,6 +390,7 @@ export class BasicBehaveEngine implements IBehaveEngine { this.registerBehaveEngineNode("math/ge", GreaterThanOrEqualTo); this.registerBehaveEngineNode("math/gt", GreaterThan); this.registerBehaveEngineNode("math/dot", Dot); + this.registerBehaveEngineNode("math/normalize", Normalize); this.registerBehaveEngineNode("math/rotate2d", Rotate2D); this.registerBehaveEngineNode("math/rotate3d", Rotate3D); this.registerBehaveEngineNode("math/length", VectorLength); diff --git a/src/authoring/AuthoringNodeSpecs.ts b/src/authoring/AuthoringNodeSpecs.ts index bb6ec09..e5cce93 100644 --- a/src/authoring/AuthoringNodeSpecs.ts +++ b/src/authoring/AuthoringNodeSpecs.ts @@ -3865,6 +3865,37 @@ export const vectorNodes: IAuthoringNode[] = [ ] } }, + { + type: "math/length", + description: "Length of a Vector", + configuration: [], + input: { + flows: [], + values: [ + { + id: "a", + description: "Vector", + types: [ + "float2", + "float3", + "float4" + ] + } + ] + }, + output: { + flows: [], + values: [ + { + id: "value", + description: "Length", + types: [ + "float" + ] + } + ] + } + }, { type: "math/cross", description: "Cross Product",