Exemplo n.º 1
0
    private AirVRStereoCameraRig CreateAirVRCameraRig(AirVRStereoCameraRig customizedRigPrefab)
    {
        int onAirVRPort = 9090;
        AirVRServerInitParams initParam = GameObject.FindObjectOfType<AirVRServerInitParams>();
        if (initParam)
            onAirVRPort = initParam.port;

        if (!customizedRigPrefab)
        {
            rig = FindObjectOfType<AirVRStereoCameraRig>();

            if(!rig)
                rig = CircleVR.DontDestroyInstantiate("AirVRCameraRig" , Vector3.zero , Quaternion.identity).AddComponent<AirVRStereoCameraRig>();
        }
        else
            rig = CircleVR.DontDestroyInstantiate(customizedRigPrefab.gameObject , Vector3.zero , Quaternion.identity).GetComponent<AirVRStereoCameraRig>();

        rig.trackingModel = AirVRStereoCameraRig.TrackingModel.ExternalTracker;

        if (!customizedRigPrefab)
        {
            rig.centerEyeAnchor.gameObject.AddComponent<AudioListener>();
            rig.centerEyeAnchor.gameObject.AddComponent<AirVRServerAudioOutputRouter>();
        }

        Debug.Log("[CircleVR Client] onAirVR Port : " + onAirVRPort.ToString());

        AirVRCameraRigManager.managerOnCurrentScene.Delegate = this;

        return rig;
    }
Exemplo n.º 2
0
    public void Init()
    {
        Camera = CircleVR.DontDestroyInstantiate("CameraManager", Vector3.zero, Quaternion.identity).AddComponent <CircleVRCameraManager>();
        Camera.Init();

        CircleVRTrackingSystem.onCreateTracker += onCreateTracker;

        Debug.Log("[CircleVR Display] Initialized");
    }
Exemplo n.º 3
0
    private CircleVRHead CreateHead(Transform origin, string trackerID)
    {
        GameObject prefab = Resources.Load <GameObject>("head");

        CircleVRHead head = CircleVR.DontDestroyInstantiate(prefab, prefab.transform.localPosition, prefab.transform.localRotation).GetComponent <CircleVRHead>();

        head.Init(trackerID, origin);

        return(head);
    }
Exemplo n.º 4
0
    private static void HostSetup(Configuration config)
    {
        Debug.Log("[TrackingSystem] Host Setup");

        if (OpenVR.System != null)
        {
            CircleVR.DontDestroyInstantiate("SteamVRTrackingDataFeeder", Vector3.zero, Quaternion.identity).AddComponent <CircleVRSteamVRTrackingDataFeeder>();
            return;
        }

        CircleVR.DontDestroyInstantiate("TrackingSimulator", Vector3.zero, Quaternion.identity).AddComponent <CircleVRTrackingSimulator>().Init(config);
    }
Exemplo n.º 5
0
    public static Transform CreateTracker(string ID)
    {
        Transform trackerTransform = CircleVR.DontDestroyInstantiate(ID, Vector3.zero, Quaternion.identity).transform;

        trackers.Add(ID, trackerTransform);

        CreateCenterAnchor(trackerTransform);

        Origin = Origin;

        if (onCreateTracker != null)
        {
            onCreateTracker(ID, trackerTransform);
        }


        Debug.Log("[CircleVR Tracking System] Create Tracker : " + ID);
        Debug.Log("[CircleVR Tracking System] Tracker Count : " + trackers.Count.ToString());

        return(trackerTransform);
    }
Exemplo n.º 6
0
 private void SetupContentServer(Configuration config)
 {
     CircleVR.DontDestroyInstantiate("ContentServer", Vector3.zero, Quaternion.identity).AddComponent <CircleVRContentServer>().Init(config);
 }
Exemplo n.º 7
0
 private static void ClientSetup()
 {
     CircleVR.DontDestroyInstantiate("ClientTrackingDataFeeder", Vector3.zero, Quaternion.identity).AddComponent <CircleVRClientTrackingDataFeeder>();
     Debug.Log("[TrackingSystem] Client Setup");
 }
Exemplo n.º 8
0
 public static void InitBarrier(float barrierRadius, bool showBarrier)
 {
     barrier = CircleVR.DontDestroyInstantiate("Barrier", Vector3.zero, Quaternion.identity).AddComponent <CircleVRBarrier>();
     barrier.Init(barrierRadius, Object.FindObjectOfType <CircleVR>().barrierMaterial, showBarrier);
 }
Exemplo n.º 9
0
 private void SetupContentClient()
 {
     CircleVR.DontDestroyInstantiate("ContentClient", Vector3.zero, Quaternion.identity).AddComponent<CircleVRContentClient>();
 }