123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- define(["module", "vwf/view", "vwf/view/arjs/signals/signals", "vwf/view/arjs/aframe-ar"], function(module, view, signals, arjs) {
- return view.load(module, {
- initialize: function() {
- window.signals = signals;
- self = this;
- this.viewDriver = vwf.views["vwf/view/aframe"];
-
- },
- createdNode: function (nodeID, childID, childExtendsID, childImplementsIDs,
- childSource, childType, childIndex, childName, callback /* ( ready ) */) {
-
-
-
-
-
-
- },
- initializedNode: function (nodeID, childID) {
-
-
- var node = self.viewDriver.state.nodes[childID];
- if (!node) {
- return;
- }
- if (self.viewDriver.state.scenes[childID]) {
- let scene = self.viewDriver.state.scenes[childID];
- scene.setAttribute('embedded', {});
- scene.setAttribute('arjs', {trackingMethod: "best", sourceType: "webcam", debugUIEnabled: "false"});
- }
- if (self.viewDriver.state.nodes[childID].extendsID == "http://vwf.example.com/aframe/acamera.vwf") {
-
- if(node.type == 'ar'){
- console.log(childID);
- vwf_view.kernel.callMethod(childID, "setCameraToActive", [vwf.moniker_]);
- }
- }
- },
- firedEvent: function (nodeID, eventName, eventParameters) {
-
-
-
-
-
-
-
-
- },
-
- calledMethod: function( nodeID, methodName, methodParameters, methodValue ) {
-
- var node = self.viewDriver.state.nodes[nodeID];
- if (!node) {
- return;
- }
- if (methodName == "createAvatarBody") {
- let avatarName = 'avatar-' + self.kernel.moniker();
- if (nodeID == avatarName) {
- vwf_view.kernel.callMethod(nodeID, "showHideAvatar", [false]);
- }
- }
-
- }
- })
- });
|