public HeuristicGrabClassifier(InteractionHand intHand,
                                       float fingerStickiness = 0F,
                                       float thumbStickiness  = 0.04F,
                                       float maxCurl          = 0.65F,
                                       float minCurl          = -0.1F,
                                       float fingerRadius     = 0.012F,
                                       float thumbRadius      = 0.017F,
                                       float grabCooldown     = 0.2F,
                                       float maxCurlVel       = 0.0F,
                                       float maxGrabDistance  = 0.05F,
                                       int layerMask          = 0,
                                       QueryTriggerInteraction queryTriggers = QueryTriggerInteraction.UseGlobal)
        {
            interactionHand    = intHand;
            _defaultGrabParams = new GrabClassifierHeuristics.ClassifierParameters(
                fingerStickiness, thumbStickiness, maxCurl, minCurl, fingerRadius,
                thumbRadius, grabCooldown, maxCurlVel, maxGrabDistance,
                layerMask == 0 ? interactionHand.manager.GetInteractionLayerMask() : layerMask,
                queryTriggers);
            _scaledGrabParams = new GrabClassifierHeuristics.ClassifierParameters(
                fingerStickiness, thumbStickiness, maxCurl, minCurl, fingerRadius,
                thumbRadius, grabCooldown, maxCurlVel, maxGrabDistance,
                layerMask == 0 ? interactionHand.manager.GetInteractionLayerMask() : layerMask,
                queryTriggers);

            for (int i = 0; i < _collidingCandidates.Length; i++)
            {
                _collidingCandidates[i] = new Collider[5];
            }
        }
Beispiel #2
0
 public HeuristicGrabClassifier(InteractionManager manager, float fingerStickiness = 0f, float thumbStickiness = 0.04f, float maxCurl = 0.65f, float minCurl = -0.1f, float fingerRadius = 0.012f, float thumbRadius = 0.017f, float grabCooldown = 0.2f, float maxCurlVel = 0.0f, float maxGrabDistance = 0.05f, int layerMask = 0, QueryTriggerInteraction queryTriggers = QueryTriggerInteraction.UseGlobal)
 {
     _manager          = manager;
     defaultGrabParams = new GrabClassifierHeuristics.ClassifierParameters(fingerStickiness, thumbStickiness, maxCurl, minCurl, fingerRadius, thumbRadius, grabCooldown, maxCurlVel, maxGrabDistance, layerMask == 0 ? (1 << manager.InteractionLayer | 1 << manager.InteractionNoClipLayer) : layerMask, queryTriggers);
     scaledGrabParams  = new GrabClassifierHeuristics.ClassifierParameters(fingerStickiness, thumbStickiness, maxCurl, minCurl, fingerRadius, thumbRadius, grabCooldown, maxCurlVel, maxGrabDistance, layerMask == 0 ? (1 << manager.InteractionLayer | 1 << manager.InteractionNoClipLayer) : layerMask, queryTriggers);
     for (int i = 0; i < 6; i++)
     {
         collidingCandidates[i] = new Collider[5];
     }
 }