示例#1
0
        public static CameraPreset Create(Vector3 position, Quaternion rotation)
        {
            var go = UnityHelper.CreatePrimitive(PrimitiveType.Sphere);

            go.transform.localScale *= 0.1f * VR.Settings.IPDScale;
            var preset = go.AddComponent <CameraPreset>();

            return(preset);
        }
示例#2
0
        public static CameraPreset Create(Transform anchor, Vector3 offset, float scale)
        {
            var go = UnityHelper.CreatePrimitive(PrimitiveType.Sphere);

            go.transform.localScale *= 0.1f * scale * VR.Settings.IPDScale;
            var preset = go.AddComponent <AnchoredCameraPreset>();

            preset.Anchor = anchor;
            preset.Offset = offset;
            return(preset);
        }
示例#3
0
        public static ImpersonationCameraPreset Create(IActor actor)
        {
            var go = UnityHelper.CreatePrimitive(PrimitiveType.Sphere);

            go.transform.localScale *= 0.1f * VR.Settings.IPDScale;
            var preset = go.AddComponent <ImpersonationCameraPreset>();

            preset.Actor         = actor;
            preset._eyeTransform = actor.Eyes;

            return(preset);
        }
示例#4
0
        protected override void OnAwake()
        {
            base.OnAwake();

            _zAxis = UnityHelper.CreatePrimitive(PrimitiveType.Cube);
            _yAxis = UnityHelper.CreatePrimitive(PrimitiveType.Cube);

            _zAxis.transform.SetParent(transform, false);
            _yAxis.transform.SetParent(transform, false);

            _zAxis.transform.localScale    = new Vector3(0.001f, 0.001f, 0.1f);
            _yAxis.transform.localScale    = new Vector3(0.001f, 0.1f, 0.001f);
            _yAxis.transform.localPosition = new Vector3(0.0f, 0.05f, 0.00f);
            _zAxis.transform.localPosition = new Vector3(0.0f, 0.00f, 0.05f);

            _zAxis.GetComponent <MeshRenderer>().material       = new Material(VR.Context.Materials.Unlit);
            _yAxis.GetComponent <MeshRenderer>().material       = new Material(VR.Context.Materials.Unlit);
            _zAxis.GetComponent <MeshRenderer>().material.color = Color.blue;
            _yAxis.GetComponent <MeshRenderer>().material.color = Color.green;
        }