Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// The input ports of the Javascript node, name of input and type
// ExampleInput:'number',
// Available types are 'number', 'string', 'boolean', 'color' and 'signal',
scriptLoaded: "string",
// The output ports of the Javascript node, name of output and type
// ExampleOutput:'string',
// All signal inputs need their own function with the corresponding name that
// will be run when a signal is received on the input.
mySignal:function(inputs,outputs) {
if (!inputs.scriptLoaded) {
// ...
var node = document.querySelector('[title="test"]');
'<a-asset-item id="tray-start-obj" src="./tray_start.obj"></a-asset-item>'+
'<a-asset-item id="tray-start-mtl" src="./tray_start.mtl"></a-asset-item>'+
'<a-asset-item id="slope2-obj" src="./slope2.obj"></a-asset-item>'+
'<a-asset-item id="slope2-mtl" src="./slope2.mtl"></a-asset-item>'+
'<a-asset-item id="tray-goal-obj" src="./tray_goal.obj"></a-asset-item>'+
'<a-asset-item id="tray-goal-mtl" src="./tray_goal.mtl"></a-asset-item>'+
'<a-scene physics="debug:false;" background="color: #FAFAFA">'+
'<a-camera position="1 3 7"></a-camera>'+
'<a-sphere dynamic-body position="-3.9 6 0.1" scale="0.5 0.5 0.5"></a-sphere>'+
'<a-obj-model static-body scale="1 1 1" src="#tray-start-obj" mtl="#tray-start-mtl"></a-obj-model>'+
'<a-obj-model static-body scale="1 1 1" src="#slope2-obj" mtl="#slope2-mtl"></a-obj-model>'+
'<a-obj-model static-body scale="1 1 1" src="#tray-goal-obj" mtl="#tray-goal-mtl"></a-obj-model>'+
// This function will be called when any of the inputs have changed
change:function(inputs,outputs) {
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment