corrected bug in nodes.cpp, line 129: bad modulo arithmetic.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3692 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-10-23 12:44:47 +00:00
parent 12428d766f
commit 4fb0b2145e

View File

@ -126,7 +126,7 @@ void Node::calculateForces(const double *map,int width,int height,int W,int H,fl
int X = std::min(W-1,std::max(0,(int)rint(x))) ;
int Y = std::min(H-1,std::max(0,(int)rint(y))) ;
float val = map[2*((i+X)%W + W*((j+Y)%H))] ;
float val = map[2*((i+X+W)%W + W*((j+Y+H)%H))] ;
dei += i * e[i+KS+(2*KS+1)*(j+KS)] * val ;
dej += j * e[i+KS+(2*KS+1)*(j+KS)] * val ;