protected Visualization createVisualization(Dataset dataset, Transform parent) { GameObject go = new GameObject(); //string folderName = new DirectoryInfo(rootFolder).Name; Visualization v = go.AddComponent <Visualization>(); go.name = dataset.csvMetadataFile.name; go.transform.parent = parent; AutographerParser parser = go.AddComponent <AutographerParser>(); //parser.allowInterp = this.GetComponent<AutographerParser>().allowInterp; //parser.imageResolution = this.GetComponent<AutographerParser>().imageResolution; v.projectName = dataset.csvMetadataFile.name; v.csvMetadataFile = dataset.csvMetadataFile; v.imageDirectory = dataset.imageDirectory; v.imageExtension = dataset.imageExtension; //v.tb = this; v.targetMetadataParser = v.GetComponent <MetadataParser>(); //v.pather = this.pather; //v.DoubleSidedMesh = this.DoubleSidedMesh; //v.quadTemplate = this.quadTemplate; v.quadTemplates = dataset.quadTemplates; v.tvisLayout = this.tvisLayout; v.usePhotos = this.usePhotos; //v.transform.parent = this.sceneParent; return(v); }
private IEnumerator CenterIsland() { Vector3 _tempPosition = _visualizationPosition; while (Vector3.Distance(_tempPosition, _targetPosition) > 0.01f) { float currentTime = (Time.deltaTime / 0.25f); _tempPosition = Vector3.Lerp(_tempPosition, _targetPosition, currentTime); _visualization.transform.localPosition = _tempPosition; yield return(null); } _visualization.transform.localPosition = _targetPosition; float tempScale = 1.0f; while ((_targetScale - tempScale) > 0.01f) { float currentTime = (Time.deltaTime / 1.0f); tempScale = Mathf.Lerp(tempScale, _targetScale, 0.1f); SetScaleRelativeToCenter(tempScale); yield return(null); } SetScaleRelativeToCenter(_targetScale); _visualization.GetComponent <ObjectStateSynchronizer>().SyncActive = true; }
public override bool Process() { // Create Visualization Visualization.GetComponent <GenericVisualization>().CreateVisualization(); // Enable Interaction Script SetOutputData(GetRawInputData()); // Visualization does not change data return(true); }
public override IEnumerator Perform(SpeechInteractionEventArgs eventArgs) { UpdateHighlights(eventArgs); _visualization = UIManager.Instance.Visualization; _visualization.GetComponent <ObjectStateSynchronizer>().SyncActive = false; _visualizationPosition = _visualization.transform.localPosition; _visualizationScale = _visualization.transform.localScale; _startScale = _visualizationScale.x; _targetScale = 0.01f; yield return(ReturnToDefaultScale()); }
private IEnumerator ReturnToDefaultScale() { float tempScale = _startScale; float scalingFactor = tempScale / _startScale; while ((tempScale - _targetScale) > 0.0001f) { float currentTime = (Time.deltaTime / 1.0f); tempScale = Mathf.Lerp(tempScale, _targetScale, 0.1f); scalingFactor = tempScale / _startScale; SetScaleRelativeToCenter(scalingFactor); yield return(null); } scalingFactor = _targetScale / _startScale; _visualization.GetComponent <ObjectStateSynchronizer>().SyncActive = true; SetScaleRelativeToCenter(scalingFactor); yield break; }
public IEnumerator Perform(Interactable focused) { UpdateHighlights(focused); _visualization = UIManager.Instance.Visualization; _visualization.GetComponent <ObjectStateSynchronizer>().SyncActive = false; _contentPane = UIManager.Instance.ContentPane; _visualizationPosition = _visualization.transform.localPosition; _visualizationScale = _visualization.transform.localScale; _paneBounds = GameObject.Find("Water").GetComponent <MeshRenderer>().bounds; _focusedBounds = GetInteractableBounds(_focused); _maxPaneExtent = Mathf.Max(_paneBounds.extents.x, _paneBounds.extents.z); _maxFocusedExtent = Mathf.Max(_focusedBounds.extents.x, _focusedBounds.extents.z); _targetScale = (_maxPaneExtent / _maxFocusedExtent) * 0.8f; _focusedPosition = _contentPane.transform.InverseTransformPoint(_focusedBounds.center); _focusedPosition = new Vector3(_focusedPosition.x, 0, _focusedPosition.z); _targetPosition = _visualizationPosition - _focusedPosition; yield return(CenterIsland()); }