Removing build warning about out-of-order initialization in class ctor.

This commit is contained in:
Andrew Meadows 2014-01-29 14:43:01 -08:00
parent b2d60ec1f8
commit 570b872eda
2 changed files with 7 additions and 2 deletions

View file

@ -73,8 +73,8 @@ Avatar::Avatar() :
_mouseRayOrigin(0.0f, 0.0f, 0.0f),
_mouseRayDirection(0.0f, 0.0f, 0.0f),
_moving(false),
_collisionFlags(0),
_owningAvatarMixer(),
_collisionFlags(0),
_initialized(false)
{
// we may have been created in the network thread, but we live in the main thread

View file

@ -757,8 +757,13 @@ void MyAvatar::updateAvatarCollisions(float deltaTime) {
// Reset detector for nearest avatar
_distanceToNearestAvatar = std::numeric_limits<float>::max();
float myRadius = (0.5f + COLLISION_RADIUS_SCALE) * getHeight();
foreach (const AvatarSharedPointer& avatarPointer, Application::getInstance()->getAvatarManager().getAvatarHash()) {
const AvatarHash& avatars = Application::getInstance()->getAvatarManager().getAvatarHash();
foreach (const AvatarSharedPointer& avatarPointer, avatars) {
Avatar* avatar = static_cast<Avatar*>(avatarPointer.data());
if (static_cast<Avatar*>(this) == avatar) {
// don't collide with ourselves
continue;
}
float distance = glm::length(_position - avatar->_position);
if (_distanceToNearestAvatar > distance) {
_distanceToNearestAvatar = distance;