Fixed player avoidance code.

Speedup network message handling.
This commit is contained in:
joint 2019-08-12 14:16:28 +03:00 committed by jeefo
commit 9947e41549
26 changed files with 2398 additions and 2294 deletions

View file

@ -160,8 +160,8 @@ public:
}
static const Vector &null () {
static const auto s_zero = Vector (0.0f, 0.0f, 0.0f);
return s_zero;
static const Vector &s_null {};
return s_null;
}
void clear () {
@ -224,6 +224,27 @@ public:
upward->z = cosines[roll] * cosines[pitch];
}
}
const Vector &forward () {
static Vector s_fwd {};
buildVectors (&s_fwd, nullptr, nullptr);
return s_fwd;
}
const Vector &upward () {
static Vector s_up {};
buildVectors (nullptr, nullptr, &s_up);
return s_up;
}
const Vector &right () {
static Vector s_right {};
buildVectors (nullptr, &s_right, nullptr);
return s_right;
}
};
// expose global null vector