12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- "use strict";
- define( [ "module", "vwf/view", "jquery", "jquery-ui" ], function( module, view, $ ) {
- let aframeTypes = new Set(["a-camera", "a-entity", "a-box", "a-sphere", "a-sky"]);
- return view.load( module, {
-
- initialize: function( options ) {
- var self = this;
- this.nodes = {};
-
- if ( typeof options == "object" ) {
-
- this.rootSelector = options[ "application-root" ];
- }
- else {
- this.rootSelector = options;
- }
-
-
-
- },
-
- createdNode: function( nodeID, childID, childExtendsID, childImplementsIDs,
- childSource, childType, childIndex, childName, callback /* ( ready ) */) {
-
-
-
- if ( this.state.scenes[ childID ] )
- {
- document.body.append(this.state.scenes[childID].threeScene);
-
- }
- if ( aframeTypes.has(childType)) {
- if(this.state.nodes[childID] && this.state.nodes[childID].threeObject instanceof AFRAME.AEntity) {
- this.nodes[childID] = {id:childID,extends:childExtendsID};
- let scene = this.state.scenes[this.state.nodes[childID].sceneID].threeScene;
- if (this.state.nodes[childID].parentID == this.state.nodes[childID].sceneID) {
- scene.appendChild(this.state.nodes[childID].threeObject);
- } else {
- this.state.nodes[nodeID].threeObject.appendChild(this.state.nodes[childID].threeObject);
- }
- }
- }
- },
- createdProperty: function( nodeId, propertyName, propertyValue ) {
- return this.satProperty( nodeId, propertyName, propertyValue );
- },
- initializedProperty: function (nodeId, propertyName, propertyValue) {
- return this.satProperty( nodeId, propertyName, propertyValue );
- },
- satProperty: function( nodeId, propertyName, propertyValue ) {
-
- },
- } );
- } );
|