public void GoToVertex(ViewPointMeshVertex target) { Debug.Log ("Setting vert to " + target.transform.position.ToString()); vert = target; targetPosition = target.transform.position; targetRotation = target.transform.rotation; }
public void GoToVertex(ViewPointMeshVertex target) { vert = target; targetPosition = target.transform.position; targetRotation = target.transform.rotation; targetDepthOfField = target.isCloseToObjects ? closeDepthOfField : farDepthOfField; }
public ViewPointMeshVertex ClosestMatch(ViewPointMeshVertex vert) { ViewPointMeshVertex bestBet = vert; /* camPositions are all relative to the transform of the mesh builder, * so do the opposite to the vertex that we are trying to find a close * match for */ Vector3 pos; if (meshBuilt) { pos = vert.transform.position - transform.position; float bestDistance = 10000f; float dis; for (int i = 0; i < levels; i++) { for (int j = 0; j < columns; j++) { dis = (camPositions[i,j] - pos).magnitude; if (dis < bestDistance) { bestDistance = dis; bestBet = builtMeshVertices[i,j]; } } } } else { pos = vert.transform.position; float bestDistance = 10000f; float dis; foreach (ViewPointMeshVertex v in GetComponentsInChildren<ViewPointMeshVertex>()) { dis = (v.transform.position - pos).magnitude; if (dis < bestDistance) { bestDistance = dis; bestBet = v; } } } return bestBet; }
public void EngageStoryMode() { normalModeVertex = controller.activeVertex; normalModeFOV = controller.cameraZoom.GetZoom(); foreach(InspectionPointController ipc in GameObject.FindObjectsOfType<InspectionPointController>()) ipc.Hide(); storyModeIndicator.SetActive (true); storyMode = StoryMode.STOPPED; activeWaypointIndex = -1; EnterNextWaypoint(); }
private void ChangeActiveViewPointMesh(int newMeshIndex, ViewPointMeshVertex startVertex) { if (newMeshIndex < 0 || newMeshIndex >= viewPointMeshes.Length) { Debug.Log("Invalid mesh index supplied: " + newMeshIndex); return; } ActivateViewPointMeshVertex (startVertex); currentViewPointMesh = newMeshIndex; }
private void ActivateViewPointMeshVertex(ViewPointMeshVertex vert) { foreach (GameObject cam in userCameras) { cam.GetComponent<ViewPointMeshCameraController>().GoToVertex(vert); } currentVertex = vert; }
public void SetVertexVariables(ViewPointMeshVertex target) { if (associatedLabels != null) target.associatedLabels = associatedLabels; if (associatedInspectionPoints != null) target.associatedInspectionPoints = associatedInspectionPoints; if (associatedLabelParent != null) target.associatedLabelParent = associatedLabelParent; target.informationContent = informationContent; target.isCloseToObjects = isCloseToObjects; target.lessZoomedBuilder = lessZoomedBuilder; target.entryByZoomFieldOfView = entryByZoomFieldOfView; target.moreZoomedBuilder = moreZoomedBuilder; target.exitByZoomFieldOfView = exitByZoomFieldOfView; }
private void ActivateVertexNow(ViewPointMeshVertex vert, bool openInfo) { OnBeforeChangeVertex(); activeVertex = vert; meshSystemCameraController.GoToVertex(activeVertex); if (openInfo) { if (activeVertex.informationContent != InformationContent.NONE) { ActivateInformationContent(activeVertex.informationContent); } } ActivateAssociatedLabels(); OnAfterChangeVertex(); }
/***************************** // PUBLIC GAME FUNCTIONS */ public void ActivateVertex(ViewPointMeshVertex vert, bool openInfo = true) { if (!updating) { vertexTargets.Enqueue (vert); vertexTargets.Enqueue (openInfo); } else { ActivateVertexNow(vert,openInfo); } }