protected override void OnRecievedSimulationResults(INTERACTION_SHAPE_INSTANCE_RESULTS results) {
      base.OnRecievedSimulationResults(results);

      if ((results.resultFlags & ShapeInstanceResultFlags.Velocities) != 0) {
        checkCallback(InteractionCallback.RecieveVelocityResults);
      }
    }
Ejemplo n.º 2
0
        protected override void OnRecievedSimulationResults(INTERACTION_SHAPE_INSTANCE_RESULTS results)
        {
            base.OnRecievedSimulationResults(results);

            // Velocities can propagate even when not able to contact the hand.
            if (_contactMode != ContactMode.GRASPED && (results.resultFlags & ShapeInstanceResultFlags.Velocities) != 0)
            {
                Assert.IsFalse(_isKinematic);
                _rigidbody.velocity        = results.linearVelocity.ToVector3();
                _rigidbody.angularVelocity = results.angularVelocity.ToVector3();
                _recievedVelocityUpdate    = true;
            }

            if ((results.resultFlags & ShapeInstanceResultFlags.MaxHand) != 0)
            {
                _minHandDistance = results.minHandDistance;
            }

            updateContactMode();
        }
Ejemplo n.º 3
0
        protected virtual void dispatchSimulationResults()
        {
            InteractionC.GetShapeInstanceResults(ref _scene, _resultList);

            for (int i = 0; i < _resultList.Count; ++i)
            {
                INTERACTION_SHAPE_INSTANCE_RESULTS result = _resultList[i];

                //Behaviour might have already been unregistered during an earlier callback for this simulation step
                IInteractionBehaviour interactionBehaviour;
                if (_instanceHandleToBehaviour.TryGetValue(result.handle, out interactionBehaviour))
                {
                    try {
                        // ShapeInstanceResultFlags.None may be returned if requested when hands are not touching.
                        interactionBehaviour.NotifyRecievedSimulationResults(result);
                    } catch (Exception e) {
                        _activityManager.NotifyMisbehaving(interactionBehaviour);
                        Debug.LogException(e);
                    }
                }
            }
        }
 /// <summary>
 /// Called when simulation results are available for this object.
 /// </summary>
 protected virtual void OnRecievedSimulationResults(INTERACTION_SHAPE_INSTANCE_RESULTS results)
 {
     _baseCallGuard.NotifyBaseCalled("OnRecievedSimulationResults");
 }
 public override sealed void NotifyRecievedSimulationResults(INTERACTION_SHAPE_INSTANCE_RESULTS results)
 {
     _baseCallGuard.Begin("OnRecievedSimulationResults");
     OnRecievedSimulationResults(results);
     _baseCallGuard.AssertBaseCalled();
 }
Ejemplo n.º 6
0
    protected override void OnRecievedSimulationResults(INTERACTION_SHAPE_INSTANCE_RESULTS results) {
      base.OnRecievedSimulationResults(results);

      // Velocities can propagate even when not able to contact the hand.
      if (_contactMode != ContactMode.GRASPED && (results.resultFlags & ShapeInstanceResultFlags.Velocities) != 0) {
        Assert.IsFalse(_isKinematic);
        _rigidbody.velocity = results.linearVelocity.ToVector3();
        _rigidbody.angularVelocity = results.angularVelocity.ToVector3();
        _recievedVelocityUpdate = true;
      }

      if ((results.resultFlags & ShapeInstanceResultFlags.MaxHand) != 0) {
        _minHandDistance = results.minHandDistance;
      }

      updateContactMode();
    }
Ejemplo n.º 7
0
 /// <summary>
 /// Called by InteractionManager when simulation results are available for this object.
 /// </summary>
 public abstract void NotifyRecievedSimulationResults(INTERACTION_SHAPE_INSTANCE_RESULTS results);
 /// <summary>
 /// Called by InteractionManager when simulation results are available for this object.
 /// </summary>
 public abstract void NotifyRecievedSimulationResults(INTERACTION_SHAPE_INSTANCE_RESULTS results);