Ejemplo n.º 1
0
        protected override void OnTriggerStay(Collider collider)
        {
            base.OnTriggerStay(collider);

            if (currentInteractingVelocityEstimator != null)
            {
                Vector3 currentVelocity = currentInteractingVelocityEstimator.GetVelocityEstimate();

                // Check each axis for the velocity limit
                if (xAxisSpeedLimit != 0)
                {
                    if (Mathf.Abs(currentVelocity.x) > xAxisSpeedLimit)
                    {
                        OnObjectFinishedInteractionArea(new InteractionAreaEventArgs());
                    }
                }

                if (yAxisSpeedLimit != 0)
                {
                    if (Mathf.Abs(currentVelocity.y) > yAxisSpeedLimit)
                    {
                        OnObjectFinishedInteractionArea(new InteractionAreaEventArgs());
                    }
                }

                if (zAxisSpeedLimit != 0)
                {
                    if (Mathf.Abs(currentVelocity.z) > zAxisSpeedLimit)
                    {
                        OnObjectFinishedInteractionArea(new InteractionAreaEventArgs());
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private IEnumerator GetVelocity()
 {
     while (gettingVelocity)
     {
         velocityMagnitudes.Add(velocityEst.GetVelocityEstimate().magnitude);
         yield return(null);
     }
 }
Ejemplo n.º 3
0
    private void Update()
    {
        leftHandSpeed  = leftEstimator.GetVelocityEstimate().magnitude;
        rightHandSpeed = rightEstimator.GetVelocityEstimate().magnitude;

        if (leftHandSpeed >= requiredSpeed && rightHandSpeed >= requiredSpeed)
        {
            canShake = true;
        }
    }