Scene.IComponent
The runtime shape of a scene component instance, as returned by {@link INode.addComponent} or yielded by {@link INode.componentIterator}.
TypeScript users: see {@link IComponentFactory} to define a component.
function Box() {
this.inputs = {
visible: false,
};
this.onInit = function() {
var THREE = this.context.three;
var geometry = new THREE.BoxGeometry(1, 1, 1);
this.material = new THREE.MeshBasicMaterial();
var mesh = new THREE.Mesh( geometry, this.material );
this.outputs.objectRoot = mesh;
};
this.onEvent = function(type, data) {
}
this.onInputsUpdated = function(previous) {
};
this.onTick = function(tickDelta) {
}
this.onDestroy = function() {
this.material.dispose();
};
}
function BoxFactory() {
return new Box();
}
// Registering the component with the sdk
sdk.Scene.register('box', BoxFactory);
Properties
outputs
outputs: ComponentProperties & PredefinedOutputs
Declared outputs, plus SDK-reserved outputs