UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

39 lines (38 loc) 1.75 kB
"use strict"; import { TypedJsNode } from "./_Base"; import { NodeParamsConfig } from "../utils/params/ParamsConfig"; import { JsConnectionPoint, JsConnectionPointType, JS_CONNECTION_POINT_IN_NODE_DEF } from "../utils/io/connections/Js"; import { inputObject3D } from "./_BaseObject3D"; import { Poly } from "../../Poly"; import { JsType } from "../../poly/registers/nodes/types/Js"; const CONNECTION_OPTIONS = JS_CONNECTION_POINT_IN_NODE_DEF; class AnimationMixerJsParamsConfig extends NodeParamsConfig { } const ParamsConfig = new AnimationMixerJsParamsConfig(); export class AnimationMixerJsNode extends TypedJsNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; } static type() { return JsType.ANIMATION_MIXER; } initializeNode() { this.io.inputs.setNamedInputConnectionPoints([ // new ActorConnectionPoint(TRIGGER_CONNECTION_NAME, ActorConnectionPointType.TRIGGER, CONNECTION_OPTIONS), new JsConnectionPoint(JsConnectionPointType.OBJECT_3D, JsConnectionPointType.OBJECT_3D, CONNECTION_OPTIONS) ]); this.io.outputs.setNamedOutputConnectionPoints([ new JsConnectionPoint(JsConnectionPointType.ANIMATION_MIXER, JsConnectionPointType.ANIMATION_MIXER) ]); } setLines(shadersCollectionController) { const object3D = inputObject3D(this, shadersCollectionController); const varName = this.jsVarName(JsConnectionPointType.ANIMATION_MIXER); const func = Poly.namedFunctionsRegister.getFunction("getAnimationMixer", this, shadersCollectionController); shadersCollectionController.addBodyOrComputed(this, [ { dataType: JsConnectionPointType.VECTOR3, varName, value: func.asString(object3D) } ]); } } AnimationMixerJsNode.OUTPUT_NAME = "val";