Пример #1
0
 public override cVector3 force(cCritter pcritter)
 {
     if (_pnode == null)
     {
         return(new cVector3(0.0f, 0.0f, 0.0f));
     }
     if (pcritter.distanceTo(_pnode) < _rodlength)
     {
         pcritter.moveTo(_pnode.Position +
                         _pnode.directionTo(pcritter) * _rodlength, true);            /* The TRUE arg means
                                                                                       * to allow the motion cause a change in pcritter's _tangent, _normal, etc. */
         return(new cVector3(0.0f, 0.0f, 0.0f));
     }
     return(_pnode.Position - pcritter.Position * _intensity);
 }