polygonjs-engine
Version:
node-based webgl 3D engine https://polygonjs.com
41 lines (34 loc) • 1.03 kB
text/typescript
import {Constructor} from '../../../../types/GlobalTypes';
import {BaseObjNodeType} from '../_Base';
const PARAM_NAME = 'layer';
import {ParamConfig} from '../../utils/params/ParamsConfig';
export function LayerParamConfig<TBase extends Constructor>(Base: TBase) {
return class Mixin extends Base {
layer = ParamConfig.INTEGER(0, {
range: [0, 31],
rangeLocked: [true, true],
});
};
}
export class LayersController {
constructor(private node: BaseObjNodeType) {}
// add_params() {
// this.node.add_param(ParamType.INTEGER, PARAM_NAME, 0, {
// range: [0, 31],
// rangeLocked: [true, true],
// });
// }
update() {
const object = this.node.object;
// const affected_objects = [object];
// if (object.cloned_cameras != null) {
// lodash_each(object.cloned_cameras, cloned_camera=> {
// affected_objects.push(cloned_camera);
// });
// }
// affected_objects.forEach((affected_object)=> {
object.layers.set(0);
object.layers.enable(this.node.params.integer(PARAM_NAME));
// });
}
}