예제 #1
0
 public float GetDistance2()
 {
     if (_target0 != null && _target1 != null)
     {
         return(ViVector3.Distance2(_target0.Value, _target1.Value));
     }
     else
     {
         return(0.0f);
     }
 }
예제 #2
0
 public bool IsIn()
 {
     if (_target0 != null && _target1 != null)
     {
         return(ViVector3.Distance2(_target0.Value, _target1.Value) < _range2);
     }
     else
     {
         return(false);
     }
 }
예제 #3
0
 //
 private void _Update()
 {
     ViDebuger.AssertError(_target0 != null && _target1 != null);
     if (ViVector3.Distance2(_target0.Value, _target1.Value) < _range2)
     {
         _node.Detach();
         if (_delegate != null)
         {
             _delegate();
         }
     }
 }
예제 #4
0
 private void _UpdateInside()
 {
     ViDebuger.AssertError(_target0 != null && _target1 != null);
     if (ViVector3.Distance2(_target0.Value, _target1.Value) > _range2)
     {
         _listWaitingOutor.PushBack(_node);
         if (_delegateOut != null)
         {
             _delegateOut();
         }
     }
 }
예제 #5
0
    public static State GetState(ViDistNotifierInterface notifier)
    {
        if (notifier._target0 == null || notifier._target1 == null)
        {
            return(State.NONE);
        }
        float distance2 = ViVector3.Distance2(notifier._target0.Value, notifier._target1.Value);

        if (distance2 < notifier._range2)
        {
            return(State.INSIDE);
        }
        else
        {
            return(State.OUTSIDE);
        }
    }
예제 #6
0
    public void AttachUpdate(Callback deleIn, Callback deleOut)
    {
        if (_target0 == null || _target1 == null)
        {
            return;
        }
        _node.Data   = this;
        _delegateIn  = deleIn;
        _delegateOut = deleOut;
        float distance2 = ViVector3.Distance2(_target0.Value, _target1.Value);

        if (distance2 < _range2)
        {
            _listInner.PushBack(_node);
        }
        else
        {
            _listOutor.PushBack(_node);
        }
    }
예제 #7
0
 public bool IsIn(ref ViVector3 pos)
 {
     return(_range2 >= ViVector3.Distance2(_rootPos, pos));
 }