当前位置: 首页>>代码示例>>C#>>正文


C# OVRCameraController类代码示例

本文整理汇总了C#中OVRCameraController的典型用法代码示例。如果您正苦于以下问题:C# OVRCameraController类的具体用法?C# OVRCameraController怎么用?C# OVRCameraController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OVRCameraController类属于命名空间,在下文中一共展示了OVRCameraController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AttachCorrectCameraModule

    public void AttachCorrectCameraModule()
    {
        GameObject cameraHolder = GameObject.FindWithTag("CameraHolder");
        // Cleanup up previous camera (if it exists)
        if( cameraHolder.transform.childCount > 0)
            Destroy(cameraHolder.transform.GetChild(0).gameObject, 0.0f);

        // Add correct camera module
        if(isOVR)
        {
            GameObject ovrModule = (GameObject)Instantiate(ovrCameraControllerModulePrefab, new Vector3(), Quaternion.identity);
            //ovrModule.transform.Rotate(new Vector3(0, -90, 0), Space.Self);
            ovrModule.transform.parent = cameraHolder.transform;
            ovrModule.transform.localPosition = new Vector3();
            ovrCameraController = (OVRCameraController)GameObject.FindWithTag("OVRCameraController").GetComponent("OVRCameraController");
            mainCameraGameObject =  GameObject.FindWithTag("MainCamera");

            GameObject[] tempCameraObjectArray =  GameObject.FindGameObjectsWithTag("MainCamera");
            mainCameraComponentList.Clear();
            for(int i = 0; i < tempCameraObjectArray.Length; i++)
                mainCameraComponentList.Add( (Camera)tempCameraObjectArray[i].GetComponent("Camera") );

        }
        else
        {
            GameObject normalCameraModule = (GameObject)Instantiate(mainCameraModulePrefab, new Vector3(), Quaternion.identity);
            //normalCameraModule.transform.Rotate(new Vector3(0, -90, 0), Space.Self);
            normalCameraModule.transform.parent = cameraHolder.transform;
            normalCameraModule.transform.localPosition = new Vector3();
            mainCameraGameObject =  GameObject.FindWithTag("MainCamera"); //GameObject.Find("Main Camera");
        }
    }
开发者ID:AjayTalati,项目名称:BCI_Experiments,代码行数:32,代码来源:PlayerScript.cs

示例2: Start

    void Start()
    {
        coatLeft = transform.Find("coatLeft");
        coatRight = transform.Find("coatRight");

        ovrController = transform.parent.parent.GetComponent<OVRCameraController>();
        isHiding = false;
        calledHiding = false;
        coatRight.localPosition = cRight = new Vector3(maxCoatRightX, 0f, 0f);
        coatLeft.localPosition = -cRight;
    }
开发者ID:JungleJinn,项目名称:exile-metalgearcloset,代码行数:11,代码来源:CoatHide.cs

示例3: SetOVRCameraController

	// SetOVRCameraController
	public void SetOVRCameraController(ref OVRCameraController cameraController)
	{
		CameraController = cameraController;
		CameraController.GetCamera(ref MainCam);
		
		if(CameraController.PortraitMode == true)
		{
			float tmp = DeadZoneX;
			DeadZoneX = DeadZoneY;
			DeadZoneY = tmp;
		}
	}
开发者ID:guozanhua,项目名称:kinect-oculus-demo,代码行数:13,代码来源:OVRCrosshair.cs

示例4: Awake

    void Awake()
    {
        // Find camera controller
        OVRCameraController[] camera_controllers;
        camera_controllers = gameObject.GetComponentsInChildren<OVRCameraController>();

        if (camera_controllers.Length == 0)
            Debug.LogWarning("ThreeDimGUI: No OVRCameraController attached.");
        else if (camera_controllers.Length > 1)
            Debug.LogWarning("ThreeDimGUI: More then 1 OVRCameraController attached.");
        else
            m_CameraController = camera_controllers[0];
    }
开发者ID:jceipek,项目名称:Equilibrium,代码行数:13,代码来源:ThreeDimGUI.cs

示例5: Awake

    void Awake()
    {
        ovrCameraController = GetComponentInChildren<OVRCameraController>();
        ovrCameraControllerTransform = ovrCameraController.transform;
        headController = GetComponent<HeadController>();
        handsController = GetComponent<HandsController>();
        feetController = GetComponent<FeetController>();
        motionController = GetComponent<MotionController>();
        swooshSound = ovrCameraControllerTransform.Find("SwooshSound").GetComponent<AudioSource>();

        materialTriggers = GameObject.FindObjectsOfType( typeof (TriggerSolidColor ) ) as TriggerSolidColor[];
        foreach ( CameraAnchor cameraAnchor in GameObject.FindObjectsOfType( typeof(CameraAnchor) ))
            characterCameraAnchorTransforms.Add( cameraAnchor.transform );
    }
开发者ID:Tamulur,项目名称:AvatarExperiments,代码行数:14,代码来源:PossessionController.cs

示例6: Start

    public void Start()
    {
        CurrentState = PlayerState.Normal;
        _changingState = false;

        _manager = GameObject.FindGameObjectWithTag("GameManager").GetComponent<GameManager>();

        _terrainCollider = GameObject.FindGameObjectWithTag("Terrain").GetComponent<TerrainCollider>();
        _sunLight = GameObject.FindGameObjectWithTag("SunLight").GetComponent<Light>();
        _startIntensity = _sunLight.intensity;
        _ovrPlayerController = GetComponent<OVRPlayerController>();
        _ovrCameraController = GetComponentInChildren<OVRCameraController>();

        _audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponent<AudioManager>();
    }
开发者ID:WozStudios,项目名称:AVirtualWonderland,代码行数:15,代码来源:Player.cs

示例7: Start

    // Use this for initialization
    void Start()
    {
        movement = Vector3.zero;
        controller = gameObject.GetComponent<CharacterController>();

        OVRCameraController[] CameraControllers;
        CameraControllers = gameObject.GetComponentsInChildren<OVRCameraController>();

        if(CameraControllers.Length == 0)
            Debug.LogWarning("OVRPlayerController: No OVRCameraController attached.");
        else if (CameraControllers.Length > 1)
            Debug.LogWarning("OVRPlayerController: More then 1 OVRCameraController attached.");
        else
            CameraController = CameraControllers[0];
    }
开发者ID:Zerophase,项目名称:SplitAlphaBuild,代码行数:16,代码来源:Controller.cs

示例8: Awake

    // Awake
    void Awake()
    {
        CameraController = GetComponentInChildren(typeof(OVRCameraController)) as OVRCameraController;
          if(CameraController==null){
         Debug.LogWarning("Single Method Failed!");
          // Find camera controller
          OVRCameraController[] CameraControllers;
          CameraControllers = gameObject.GetComponentsInChildren<OVRCameraController>();

          if(CameraControllers.Length == 0)
         Debug.LogWarning("OVRMainMenu: No OVRCameraController attached.");
          else if (CameraControllers.Length > 1)
         Debug.LogWarning("OVRMainMenu: More then 1 OVRCameraController attached.");
          else
         CameraController = CameraControllers[0];
          }
    }
开发者ID:sohailmehra7,项目名称:Free-Gilly,代码行数:18,代码来源:HUDScript.cs

示例9: Awake

    // * * * * * * * * * * * * *
    // Awake
    public new virtual void Awake()
    {
        base.Awake ();

        // We use Controller to move player around
        Controller = gameObject.GetComponent<CharacterController> ();

        if (Controller == null)
            Debug.LogWarning ("OVRPlayerController: No CharacterController attached.");

        // We use OVRCameraController to set rotations to cameras,
        // and to be influenced by rotation
        OVRCameraController[] CameraControllers;
        CameraControllers = gameObject.GetComponentsInChildren<OVRCameraController> ();

        if (CameraControllers.Length == 0)
            Debug.LogWarning ("OVRPlayerController: No OVRCameraController attached.");
        else if (CameraControllers.Length > 1)
            Debug.LogWarning ("OVRPlayerController: More then 1 OVRCameraController attached.");
        else
            CameraController = CameraControllers [0];

        // Instantiate a Transform from the main game object (will be used to
        // direct the motion of the PlayerController, as well as used to rotate
        // a visible body attached to the controller)
        DirXform = null;
        Transform[] Xforms = gameObject.GetComponentsInChildren<Transform> ();

        for (int i = 0; i < Xforms.Length; i++) {
            if (Xforms [i].name == "ForwardDirection") {
                DirXform = Xforms [i];
                break;
            }
        }

        if (DirXform == null)
            Debug.LogWarning ("OVRPlayerController: ForwardDirection game object not found. Do not use.");
    }
开发者ID:jreidy,项目名称:CS248_Final_Project,代码行数:40,代码来源:NetworkOVRPlayerController.cs

示例10: Start

    // Use this for initialization
    void Start()
    {
        Time.timeScale=1;

        leftarrows = (Texture)Resources.Load("leftarrow");
        rightarrows = (Texture)Resources.Load("rightarrow");
        uparrows = (Texture)Resources.Load("uparrow");

        left.renderer.material.color = Color.yellow;
        right.renderer.material.color = Color.yellow;
        straight.renderer.material.color = Color.yellow;

        ovr = GameObject.Find("OVRCameraController").GetComponent<OVRCameraController>();
    }
开发者ID:rpalcode,项目名称:robot-intentions,代码行数:15,代码来源:scene5.cs

示例11: Start

    /// <summary>
    /// Start this instance.
    /// </summary>
    void Start()
    {
        // Get the OVRCameraController
        CameraController = GetComponent<OVRCameraController>();

        if(CameraController == null)
            Debug.LogWarning("WARNING: OVRCameraController not found!");

        // Without this, we will be drawing 1 frame behind
        camera.depth = Mathf.Max (CameraLeft.depth, CameraRight.depth) + 1;

        // Don't want the camera to render anything..
        camera.cullingMask = 0;
        camera.eventMask = 0;
        camera.useOcclusionCulling = false;
        camera.backgroundColor = Color.black;
        camera.clearFlags = (!CameraController.UseCameraTexture) ? CameraClearFlags.Nothing :
            CameraClearFlags.SolidColor; // TBD: This may be a performance loss on mobile.
        camera.renderingPath = RenderingPath.Forward;
        camera.orthographic = true;
    }
开发者ID:xianyinchen,项目名称:Demos,代码行数:24,代码来源:OVRDistortionCamera.cs

示例12: SetOVRCameraController

 /// <summary>
 /// Sets the OVR camera controller.
 /// </summary>
 /// <param name="cameraController">Camera controller.</param>
 public void SetOVRCameraController(ref OVRCameraController cameraController)
 {
     CameraController = cameraController;
     CameraController.GetCamera(ref MainCam);
 }
开发者ID:xianyinchen,项目名称:Demos,代码行数:9,代码来源:OVRCrosshair.cs

示例13: Start

    // Start
    new void Start()
    {
        base.Start ();

        // Get the OVRCameraController
        CameraController = gameObject.transform.parent.GetComponent<OVRCameraController>();

        if(CameraController == null)
            Debug.LogWarning("WARNING: OVRCameraController not found!");

        // NOTE: MSAA TEXTURES NOT AVAILABLE YET
        // Set CameraTextureScale (increases the size of the texture we are rendering into
        // for a better pixel match when post processing the image through lens distortion)
        #if MSAA_ENABLED
        CameraTextureScale = OVRDevice.DistortionScale();
        #endif
        // If CameraTextureScale is not 1.0f, create a new texture and assign to target texture
        // Otherwise, fall back to normal camera rendering
        if((CameraTexture == null) && (CameraTextureScale > 1.0f))
        {
            int w = (int)(Screen.width / 2.0f * CameraTextureScale);
            int h = (int)(Screen.height * CameraTextureScale);
            CameraTexture = new RenderTexture(  w, h, 24); // 24 bit colorspace

            // NOTE: MSAA TEXTURES NOT AVAILABLE YET
            // This value should be the default for MSAA textures
            // CameraTexture.antiAliasing = 4;
            // Set it within the project
        #if MSAA_ENABLED
            CameraTexture.antiAliasing = QualitySettings.antiAliasing;
        #endif
        }
    }
开发者ID:johhov,项目名称:DeviceJam,代码行数:34,代码来源:OVRCamera.cs

示例14: Awake

    // * * * * * * * * * * * * *
    // Awake
    public new virtual void Awake()
    {
        base.Awake();

        // Don't let the Physics Engine rotate this physics object so it doesn't fall over when running
        rigidbody.freezeRotation = true;

        collider.material.dynamicFriction = 0;
        collider.material.dynamicFriction2 = 0;
        collider.material.staticFriction = 0;
        collider.material.staticFriction2 = 0;
        collider.material.frictionCombine = PhysicMaterialCombine.Minimum;

        // We use OVRCameraController to set rotations to cameras,
        // and to be influenced by rotation
        OVRCameraController[] CameraControllers;
        CameraControllers = gameObject.GetComponentsInChildren<OVRCameraController>();

        if(CameraControllers.Length == 0)
            Debug.LogWarning("OVRPlayerController: No OVRCameraController attached.");
        else if (CameraControllers.Length > 1)
            Debug.LogWarning("OVRPlayerController: More then 1 OVRCameraController attached.");
        else
            CameraController = CameraControllers[0];

        // Instantiate a Transform from the main game object (will be used to
        // direct the motion of the PlayerController, as well as used to rotate
        // a visible body attached to the controller)
        DirXform = null;
        Transform[] Xforms = gameObject.GetComponentsInChildren<Transform>();

        for(int i = 0; i < Xforms.Length; i++)
        {
            if(Xforms[i].name == "ForwardDirection")
            {
                DirXform = Xforms[i];
                break;
            }
        }

        if(DirXform == null)
            Debug.LogWarning("OVRPlayerController: ForwardDirection game object not found. Do not use.");
    }
开发者ID:ninacpark,项目名称:EtherealRobot,代码行数:45,代码来源:NoFrictionPC.cs

示例15: Start

 void Start()
 {
     controller = GetComponent<OVRCameraController>();
 }
开发者ID:BigRobCoder,项目名称:VirtualWorldLink,代码行数:4,代码来源:VWLEntrance.cs


注:本文中的OVRCameraController类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。