From 7aae85833b7b648bce3c38241dd5c306d407e663 Mon Sep 17 00:00:00 2001 From: TonyPeng Date: Wed, 16 Jul 2014 10:08:49 -0700 Subject: [PATCH] Take out getter for avatar's hash key. --- examples/avatarLocalLight.js | 17 ++++++++--------- interface/src/avatar/AvatarManager.cpp | 8 -------- interface/src/avatar/AvatarManager.h | 1 - 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/examples/avatarLocalLight.js b/examples/avatarLocalLight.js index 025196e0b0..5768388b45 100644 --- a/examples/avatarLocalLight.js +++ b/examples/avatarLocalLight.js @@ -17,6 +17,7 @@ var currentSelection = 0; var currentNumLights = 1; var maxNumLights = 2; var currentNumAvatars = 0; +var changeDelta = 0.1; function keyPressEvent(event) { @@ -39,7 +40,7 @@ function keyPressEvent(event) { print("light selection = " + currentSelection); } else if (event.text == "5" ) { - localLightColors[currentSelection].x += 0.01; + localLightColors[currentSelection].x += changeDelta; if ( localLightColors[currentSelection].x > 1.0) { localLightColors[currentSelection].x = 0.0; } @@ -48,7 +49,7 @@ function keyPressEvent(event) { print("CHANGE RED light " + currentSelection + " color (" + localLightColors[currentSelection].x + ", " + localLightColors[currentSelection].y + ", " + localLightColors[currentSelection].z + " )" ); } else if (event.text == "6" ) { - localLightColors[currentSelection].y += 0.01; + localLightColors[currentSelection].y += changeDelta; if ( localLightColors[currentSelection].y > 1.0) { localLightColors[currentSelection].y = 0.0; } @@ -57,7 +58,7 @@ function keyPressEvent(event) { print("CHANGE GREEN light " + currentSelection + " color (" + localLightColors[currentSelection].x + ", " + localLightColors[currentSelection].y + ", " + localLightColors[currentSelection].z + " )" ); } else if (event.text == "7" ) { - localLightColors[currentSelection].z += 0.01; + localLightColors[currentSelection].z += changeDelta; if ( localLightColors[currentSelection].z > 1.0) { localLightColors[currentSelection].z = 0.0; } @@ -66,7 +67,7 @@ function keyPressEvent(event) { print("CHANGE BLUE light " + currentSelection + " color (" + localLightColors[currentSelection].x + ", " + localLightColors[currentSelection].y + ", " + localLightColors[currentSelection].z + " )" ); } else if (event.text == "8" ) { - localLightDirections[currentSelection].x += 0.01; + localLightDirections[currentSelection].x += changeDelta; if (localLightDirections[currentSelection].x > 1.0) { localLightDirections[currentSelection].x = -1.0; } @@ -75,7 +76,7 @@ function keyPressEvent(event) { print("PLUS X light " + currentSelection + " direction (" + localLightDirections[currentSelection].x + ", " + localLightDirections[currentSelection].y + ", " + localLightDirections[currentSelection].z + " )" ); } else if (event.text == "9" ) { - localLightDirections[currentSelection].x -= 0.01; + localLightDirections[currentSelection].x -= changeDelta; if (localLightDirections[currentSelection].x < -1.0) { localLightDirections[currentSelection].x = 1.0; } @@ -84,7 +85,7 @@ function keyPressEvent(event) { print("MINUS X light " + currentSelection + " direction (" + localLightDirections[currentSelection].x + ", " + localLightDirections[currentSelection].y + ", " + localLightDirections[currentSelection].z + " )" ); } else if (event.text == "0" ) { - localLightDirections[currentSelection].y += 0.01; + localLightDirections[currentSelection].y += changeDelta; if (localLightDirections[currentSelection].y > 1.0) { localLightDirections[currentSelection].y = -1.0; } @@ -93,7 +94,7 @@ function keyPressEvent(event) { print("PLUS Y light " + currentSelection + " direction (" + localLightDirections[currentSelection].x + ", " + localLightDirections[currentSelection].y + ", " + localLightDirections[currentSelection].z + " )" ); } else if (event.text == "-" ) { - localLightDirections[currentSelection].y -= 0.01; + localLightDirections[currentSelection].y -= changeDelta; if (localLightDirections[currentSelection].y < -1.0) { localLightDirections[currentSelection].y = 1.0; } @@ -143,8 +144,6 @@ function updateLocalLights() if (numAvatars != currentNumAvatars) { for (var i = 0; i < numAvatars; i++) { - var id = AvatarManager.getAvatarHashKey(i); - var numLights = AvatarManager.getNumLightsInAvatar(i); // check if new avatar has lights diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index 128735a24e..c172df5de6 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -214,11 +214,3 @@ int AvatarManager::getNumLightsInAvatar(int avatarIndex) { int AvatarManager::getNumAvatars() { return _avatarHash.count(); } - -QString AvatarManager::getAvatarHashKey(int index) { - QString id = ((_avatarHash.keys())[index]).toString(); - std::string idString = id.toStdString(); - return id; -} - - diff --git a/interface/src/avatar/AvatarManager.h b/interface/src/avatar/AvatarManager.h index d4b404e3d5..e6f058c0ab 100644 --- a/interface/src/avatar/AvatarManager.h +++ b/interface/src/avatar/AvatarManager.h @@ -44,7 +44,6 @@ public slots: void addAvatarLocalLight(int avatarIndex); int getNumLightsInAvatar(int avatarIndex); int getNumAvatars(); - QString getAvatarHashKey(int index); private: AvatarManager(const AvatarManager& other);