34 const float const_factor = 1;
35 float magsqr = un->
GetVelocity().MagnitudeSquared();
36 float newmagsqr = (un->
GetVelocity()-othervelocity).MagnitudeSquared();
37 float speedsquared = const_factor*const_factor*(magsqr > newmagsqr ? newmagsqr : magsqr);
43 if (un->
rSize() <= 0.)
57 return unitColliders.
Get( hash_key );
95 printf(
"such collide types as %d not allowed", lc->
type );
103 printf(
"such collide types as %d not allowed", lc->
type );
113 printf(
"such collide types as %d not allowed", tmp.
type );
128 const unsigned int A = 9301;
129 const unsigned int C = 49297;
130 const unsigned int M = 233280;
131 static unsigned int seed = 3259235;
133 return seed < (M/100);
151 if (targetToCollideWith)
152 this->
Collide( targetToCollideWith, firer, superunit );
153 }
else if (curlength) {
161 if ( tmploc == cm->
end() )
163 tmore = superloc = tmploc;
168 double r1 = x0.i+v.i;
169 double minlook = r0 < r1 ? r0 : r1;
170 double maxlook = r0 < r1 ? r1 : r0;
171 bool targcheck =
false;
175 if ( superloc != cm->
begin()
180 while ( (*tless)->getKey() >= minlook ) {
182 bool breakit =
false;
183 if ( tless != cm->
begin() )
187 if ( (*curcheck)->radius > 0 ) {
189 Unit *tmp = (**curcheck).ref.unit;
190 this->
Collide( tmp, firer, superunit );
191 targcheck = (targcheck || tmp == targetToCollideWith);
200 while (tmore != cm->
end() && (*tmore)->
getKey() <= maxlook) {
201 if ( (*tmore)->radius > 0 ) {
202 Unit *un = (*tmore)->ref.unit;
204 this->
Collide( un, firer, superunit );
205 targcheck = (targcheck || un == targetToCollideWith);
209 if (targetToCollideWith && !targcheck)
210 this->
Collide( targetToCollideWith, firer, superunit );