TransformNode = function()

in seriously.js [4292:4381]


		TransformNode = function (hook, options) {
			var key,
				input,
				initialValue,
				defaultValue,
				defaults;

			this.matrix = new Float32Array(16);
			this.cumulativeMatrix = new Float32Array(16);

			this.ready = false;
			this.width = 1;
			this.height = 1;

			this.seriously = seriously;

			this.transformRef = seriousTransforms[hook];
			this.hook = hook;
			this.id = nodeId;
			nodeId++;

			this.options = options;
			this.sources = null;
			this.targets = [];
			this.inputElements = {};
			this.inputs = {};
			this.methods = {};
			this.listeners = {};

			this.texture = null;
			this.frameBuffer = null;
			this.uniforms = null;

			this.dirty = true;
			this.transformDirty = true;
			this.renderDirty = false;
			this.isDestroyed = false;
			this.transformed = false;

			this.plugin = extend({}, this.transformRef);
			if (this.transformRef.definition) {
				extend(this.plugin, this.transformRef.definition.call(this, options));
			}

			// set up inputs and methods
			for (key in this.plugin.inputs) {
				if (this.plugin.inputs.hasOwnProperty(key)) {
					input = this.plugin.inputs[key];

					if (input.method && typeof input.method === 'function') {
						this.methods[key] = input.method;
					} else if (typeof input.set === 'function' && typeof input.get === 'function') {
						this.inputs[key] = input;
					}
				}
			}
			validateInputSpecs(this.plugin);

			// set default value for all inputs (no defaults for methods)
			defaults = defaultInputs[hook];
			for (key in this.plugin.inputs) {
				if (this.plugin.inputs.hasOwnProperty(key)) {
					input = this.plugin.inputs[key];

					if (typeof input.set === 'function' && typeof input.get === 'function' &&
							typeof input.method !== 'function') {

						initialValue = input.get.call(this);
						defaultValue = input.defaultValue === undefined ? initialValue : input.defaultValue;
						defaultValue = input.validate.call(this, defaultValue, input, initialValue);
						if (defaults && defaults[key] !== undefined) {
							defaultValue = input.validate.call(this, defaults[key], input, input.defaultValue, defaultValue);
							defaults[key] = defaultValue;
						}
						if (defaultValue !== initialValue) {
							input.set.call(this, defaultValue);
						}
					}
				}
			}

			nodes.push(this);
			nodesById[this.id] = this;

			this.pub = new Transform(this);

			transforms.push(this);

			allTransformsByHook[hook].push(this);
		};