UNPKG

@polygonjs/polygonjs

Version:

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

25 lines (24 loc) 580 B
"use strict"; const PARAM_NAME = "layer"; import { ParamConfig } from "../../utils/params/ParamsConfig"; export function LayerParamConfig(Base) { return class Mixin extends Base { constructor() { super(...arguments); this.layer = ParamConfig.INTEGER(0, { range: [0, 31], rangeLocked: [true, true] }); } }; } export class LayersController { constructor(node) { this.node = node; } update() { const object = this.node.object; object.layers.set(0); object.layers.enable(this.node.params.integer(PARAM_NAME)); } }