Ejemplo n.º 1
0
        protected virtual void Update()
        {
            // Calculate delta
            if (requires == null || requires.gameObject.activeInHierarchy == true || Input.GetMouseButton(1) == true)
            {
                if (Application.isPlaying == true)
                {
                    var delta = P3dInputManager.GetAverageDeltaScaled();

                    pitch -= delta.y * pitchSensitivity;
                    yaw   += delta.x * yawSensitivity;
                }
            }

            pitch = Mathf.Clamp(pitch, pitchMin, pitchMax);

            // Smoothly dampen values
            var factor = P3dHelper.DampenFactor(dampening, Time.deltaTime);

            currentPitch = Mathf.Lerp(currentPitch, pitch, factor);
            currentYaw   = Mathf.Lerp(currentYaw, yaw, factor);

            // Apply new rotation
            transform.localRotation = Quaternion.Euler(currentPitch, currentYaw, 0.0f);
        }
Ejemplo n.º 2
0
        protected virtual void Update()
        {
            if (IsSimulation == true)
            {
                LeftTrigger  = P3dInputManager.IsPressed(simulatedLeftTrigger);
                LeftGrip     = P3dInputManager.IsPressed(simulatedLeftGrip);
                RightTrigger = P3dInputManager.IsPressed(simulatedRightTrigger);
                RightGrip    = P3dInputManager.IsPressed(simulatedRightGrip);
            }

            //if (P3dInputManager.IsPressed(recenterKey) == true)
            //{
            //	Recenter();
            //}
        }
Ejemplo n.º 3
0
        private bool Pressing()
        {
            var fingers = P3dInputManager.GetFingers();

            for (var i = 0; i < fingers.Count; i++)
            {
                var finger = fingers[i];

                if (finger.Index >= 0 || finger.Index == -1)                 // Touch or left click
                {
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 4
0
        protected virtual void Update()
        {
            if (target != null)
            {
                if (P3dInputManager.IsPressed(key) == true)
                {
                    if (storeStates == true && target.enabled == false)
                    {
                        P3dStateManager.StoreAllStates();
                    }

                    target.enabled = true;
                }
                else
                {
                    target.enabled = false;
                }
            }
        }
Ejemplo n.º 5
0
        protected virtual void Update()
        {
            if (IsSimulation == true)
            {
                LeftTrigger  = P3dInputManager.IsPressed(simulatedLeftTrigger);
                LeftGrip     = P3dInputManager.IsPressed(simulatedLeftGrip);
                RightTrigger = P3dInputManager.IsPressed(simulatedRightTrigger);
                RightGrip    = P3dInputManager.IsPressed(simulatedRightGrip);

                if (P3dInputManager.PointOverGui(P3dInputManager.MousePosition) == true)
                {
                    LeftTrigger  = false;
                    LeftGrip     = false;
                    RightTrigger = false;
                    RightGrip    = false;
                }
            }

            //if (P3dInputManager.IsPressed(recenterKey) == true)
            //{
            //	Recenter();
            //}
        }