/** * _ ___ Another * / |/ (_)______ __ _____ * / / / __(_- item.atp_id==id) if(!agentSprite) return this.currentAgentObj = this.agentFromJSON('previewedAgent', agentSprite.asp_3d) this.pivot = this.makePivotAtGeomCenter(this.currentAgentObj, this.scene) this.cameraAutoFrame(this.pivot, this.camera, 1.5) // After creating the pivot, so axes do not unbalance the center, // and after cameraFraming so axes we frame on the object, no matter the axes this.currentAgentObj.add(new THREE.AxesHelper(2)) } set animation(value){ this._animation = value if(value) this._animate() } get animation(){ return(this._animation) } _animate = () => { // to avoid having to bind(this) in requestAnimationFrame, because one bound fn per frame = continuous GC load requestAnimationFrame(this._animate) if(this.pivot && this.animation){ this.pivot.rotation.x += 0.005 this.pivot.rotation.y += 0.01 } this.renderer.render(this.scene, this.camera) } } // Make this module available to common JS if(!app.LoadedModules) app.LoadedModules = {} app.LoadedModules.AgentPreview = AgentPreview