From bd553ef061a9ea0d1b1c3898c43805e20bf634b4 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 6 Jun 2013 16:01:36 -0700 Subject: [PATCH] repair indentation and NULL comparisons in Avatar class --- interface/src/Avatar.cpp | 62 +++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/interface/src/Avatar.cpp b/interface/src/Avatar.cpp index c0be97aebb..26ffb812fc 100644 --- a/interface/src/Avatar.cpp +++ b/interface/src/Avatar.cpp @@ -62,37 +62,35 @@ float chatMessageScale = 0.0015; float chatMessageHeight = 0.20; Avatar::Avatar(Agent* owningAgent) : -AvatarData(owningAgent), -_initialized(false), -_head(this), -_ballSpringsInitialized(false), -_TEST_bigSphereRadius(0.5f), -_TEST_bigSpherePosition(5.0f, _TEST_bigSphereRadius, 5.0f), -_mousePressed(false), -_bodyPitchDelta(0.0f), -_bodyYawDelta(0.0f), -_bodyRollDelta(0.0f), -_movedHandOffset(0.0f, 0.0f, 0.0f), -_mode(AVATAR_MODE_STANDING), -_cameraPosition(0.0f, 0.0f, 0.0f), -_handHoldingPosition(0.0f, 0.0f, 0.0f), -_velocity(0.0f, 0.0f, 0.0f), -_thrust(0.0f, 0.0f, 0.0f), -_speed(0.0f), -_maxArmLength(0.0f), -_pelvisStandingHeight(0.0f), -_pelvisFloatingHeight(0.0f), -_distanceToNearestAvatar(std::numeric_limits::max()), -_gravity(0.0f, -1.0f, 0.0f), -_worldUpDirection(DEFAULT_UP_DIRECTION), -_mouseRayOrigin(0.0f, 0.0f, 0.0f), -_mouseRayDirection(0.0f, 0.0f, 0.0f), -_interactingOther(NULL), -_isMouseTurningRight(false), -_voxels(this) - + AvatarData(owningAgent), + _initialized(false), + _head(this), + _ballSpringsInitialized(false), + _TEST_bigSphereRadius(0.5f), + _TEST_bigSpherePosition(5.0f, _TEST_bigSphereRadius, 5.0f), + _mousePressed(false), + _bodyPitchDelta(0.0f), + _bodyYawDelta(0.0f), + _bodyRollDelta(0.0f), + _movedHandOffset(0.0f, 0.0f, 0.0f), + _mode(AVATAR_MODE_STANDING), + _cameraPosition(0.0f, 0.0f, 0.0f), + _handHoldingPosition(0.0f, 0.0f, 0.0f), + _velocity(0.0f, 0.0f, 0.0f), + _thrust(0.0f, 0.0f, 0.0f), + _speed(0.0f), + _maxArmLength(0.0f), + _pelvisStandingHeight(0.0f), + _pelvisFloatingHeight(0.0f), + _distanceToNearestAvatar(std::numeric_limits::max()), + _gravity(0.0f, -1.0f, 0.0f), + _worldUpDirection(DEFAULT_UP_DIRECTION), + _mouseRayOrigin(0.0f, 0.0f, 0.0f), + _mouseRayDirection(0.0f, 0.0f, 0.0f), + _interactingOther(NULL), + _isMouseTurningRight(false), + _voxels(this) { - // give the pointer to our head to inherited _headData variable from AvatarData _headData = &_head; @@ -659,7 +657,7 @@ void Avatar::updateHandMovementAndTouching(float deltaTime) { //loop through all the other avatars for potential interactions... AgentList* agentList = AgentList::getInstance(); for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) { - if (agent->getLinkedData() != NULL && agent->getType() == AGENT_TYPE_AVATAR) { + if (agent->getLinkedData() && agent->getType() == AGENT_TYPE_AVATAR) { Avatar *otherAvatar = (Avatar *)agent->getLinkedData(); // test whether shoulders are close enough to allow for reaching to touch hands @@ -828,7 +826,7 @@ void Avatar::updateAvatarCollisions(float deltaTime) { // loop through all the other avatars for potential interactions... AgentList* agentList = AgentList::getInstance(); for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) { - if (agent->getLinkedData() != NULL && agent->getType() == AGENT_TYPE_AVATAR) { + if (agent->getLinkedData() && agent->getType() == AGENT_TYPE_AVATAR) { Avatar *otherAvatar = (Avatar *)agent->getLinkedData(); // check if the bounding spheres of the two avatars are colliding