diff --git a/src/BasicBehaveEngine/BasicBehaveEngine.ts b/src/BasicBehaveEngine/BasicBehaveEngine.ts index e23b6ac..ae35115 100644 --- a/src/BasicBehaveEngine/BasicBehaveEngine.ts +++ b/src/BasicBehaveEngine/BasicBehaveEngine.ts @@ -56,6 +56,7 @@ import {Random} from "./nodes/experimental/Random"; import {Dot} from "./nodes/math/vector/Dot"; import {Rotate2D} from "./nodes/math/vector/Rotate2D"; import {Rotate3D} from "./nodes/math/vector/Rotate3D"; +import {VectorLength} from "./nodes/math/vector/VectorLength"; import {IsInfNode} from "./nodes/math/special/IsInfNode"; import {IsNaNNode} from "./nodes/math/special/IsNaNNode"; import {LessThanOrEqualTo} from "./nodes/math/comparison/LessThanOrEqualTo"; @@ -390,6 +391,7 @@ export class BasicBehaveEngine implements IBehaveEngine { this.registerBehaveEngineNode("math/dot", Dot); this.registerBehaveEngineNode("math/rotate2d", Rotate2D); this.registerBehaveEngineNode("math/rotate3d", Rotate3D); + this.registerBehaveEngineNode("math/length", VectorLength); this.registerBehaveEngineNode("math/isinf", IsInfNode); this.registerBehaveEngineNode("math/isnan", IsNaNNode); this.registerBehaveEngineNode("math/select", Select); diff --git a/src/authoring/AuthoringNodeSpecs.ts b/src/authoring/AuthoringNodeSpecs.ts index 0468bab..bb6ec09 100644 --- a/src/authoring/AuthoringNodeSpecs.ts +++ b/src/authoring/AuthoringNodeSpecs.ts @@ -3901,6 +3901,35 @@ export const vectorNodes: IAuthoringNode[] = [ ] } }, + { + type: "math/length", + description: "Vector Length", + configuration: [], + input: { + flows: [], + values: [ + { + id: "a", + description: "Vector", + types: [ + "float2", "float3", "float4" + ] + } + ] + }, + output: { + flows: [], + values: [ + { + id: "value", + description: "Length of vector", + types: [ + "float" + ] + } + ] + } + }, { type: "math/rotate2D", description: "Vector Rotation",