From 556f11a0c07d06306ae5cdc5069ddd446c56bdd6 Mon Sep 17 00:00:00 2001 From: Jeffrey Ventrella Date: Thu, 11 Apr 2013 15:32:35 -0700 Subject: [PATCH] added test 'other' avatar for proxemixs testing --- interface/src/Head.cpp | 278 +++++++++++++++++++++++++---------------- interface/src/Head.h | 11 ++ interface/src/main.cpp | 12 +- 3 files changed, 188 insertions(+), 113 deletions(-) diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index cdfd19483c..cc7d0dd8cc 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -86,9 +86,12 @@ Head::Head() noise = 0; handBeingMoved = false; + previousHandBeingMoved = false; movedHandOffset = glm::vec3( 0.0, 0.0, 0.0 ); - - sphere = NULL; + + sphere = NULL; + + usingSprings = false; springForce = 6.0f; springToBodyTightness = 4.0f; @@ -103,6 +106,12 @@ Head::Head() std::cout << "error " << error << ": " << lodepng_error_text(error) << std::endl; } } + + for (int o=0; ogetPos().x, hand->getPos().y, hand->getPos().z); //previous to Ventrella change @@ -1170,6 +1237,7 @@ void Head::parseData(void *data, int size) ( (char *)data, "H%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f", &Pitch, &Yaw, &Roll, + //&avatar.yaw, &avatar.pitch, &avatar.roll, &position.x, &position.y, &position.z, &loudness, &averageLoudness, &avatar.bone[ AVATAR_BONE_RIGHT_HAND ].position.x, diff --git a/interface/src/Head.h b/interface/src/Head.h index 3268383439..7c9f4b91aa 100644 --- a/interface/src/Head.h +++ b/interface/src/Head.h @@ -30,6 +30,8 @@ enum eyeContactTargets {LEFT_EYE, RIGHT_EYE, MOUTH}; #define ROT_RIGHT 7 #define MAX_DRIVE_KEYS 8 +#define NUM_OTHER_AVATARS 5 + /* enum AvatarJoints { @@ -237,7 +239,15 @@ class Head : public AgentData { //glm::vec3 velocity; //glm::vec3 thrust; + float closeEnoughToInteract; + int closestOtherAvatar; + glm::vec3 DEBUG_otherAvatarListPosition [ NUM_OTHER_AVATARS ]; + float DEBUG_otherAvatarListTimer [ NUM_OTHER_AVATARS ]; + + bool usingSprings; + bool handBeingMoved; + bool previousHandBeingMoved; glm::vec3 movedHandOffset; //glm::vec3 movedHandPosition; @@ -255,6 +265,7 @@ class Head : public AgentData { void initializeAvatar(); void updateAvatarSkeleton(); + void initializeAvatarSprings(); void updateAvatarSprings( float deltaTime ); void calculateBoneLengths(); diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 50dda5a84e..62415a667c 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -827,10 +827,8 @@ void display(void) if (displayField) field.render(); // Render avatars of other agents - for(std::vector::iterator agent = agentList.getAgents().begin(); agent != agentList.getAgents().end(); agent++) - { - if (agent->getLinkedData() != NULL) - { + for(std::vector::iterator agent = agentList.getAgents().begin(); agent != agentList.getAgents().end(); agent++) { + if (agent->getLinkedData() != NULL) { Head *agentHead = (Head *)agent->getLinkedData(); glPushMatrix(); glm::vec3 pos = agentHead->getPos(); @@ -870,8 +868,7 @@ void display(void) if (audioScope.getState()) audioScope.render(); #endif - if (displayHeadMouse && !displayHead && statsOn) - { + if (displayHeadMouse && !displayHead && statsOn) { // Display small target box at center or head mouse target that can also be used to measure LOD glColor3f(1.0, 1.0, 1.0); glDisable(GL_LINE_SMOOTH); @@ -1026,8 +1023,7 @@ void shiftPaintingColor() ::paintingVoxel.blue = (::dominantColor==2)?randIntInRange(200,255):randIntInRange(40,100); } -void setupPaintingVoxel() -{ +void setupPaintingVoxel() { glm::vec3 avatarPos = myAvatar.getPos(); ::paintingVoxel.x = avatarPos.z/-10.0; // voxel space x is negative z head space