History

re-work AvatarData to handle body position and rotation

Stephen Birarda committed 13 years ago

Commit a5a93441 parent ed3f3089 files · +162 −241Browse files

Showing the changes to interface/src/main.cpp (1 of 9 files). Show all

Unified · Split

interface/src/main.cpp+7−7
@@ -222,7 +222,7 @@ void displayStats(void) · 221 unmodified lines
222 char legend2[] = "* - toggle stars, & - toggle paint mode, '-' - send erase all, '%' - send add scene";222 char legend2[] = "* - toggle stars, & - toggle paint mode, '-' - send erase all, '%' - send add scene";
223 drawtext(10, statsVerticalOffset + 32, 0.10f, 0, 1.0, 0, legend2);223 drawtext(10, statsVerticalOffset + 32, 0.10f, 0, 1.0, 0, legend2);
224 224
225 glm::vec3 avatarPos = myAvatar.getPos();225 glm::vec3 avatarPos = myAvatar.getBodyPosition();
226 226
227 char stats[200];227 char stats[200];
228 sprintf(stats, "FPS = %3.0f Pkts/s = %d Bytes/s = %d Head(x,y,z)= %4.2f, %4.2f, %4.2f ", 228 sprintf(stats, "FPS = %3.0f Pkts/s = %d Bytes/s = %d Head(x,y,z)= %4.2f, %4.2f, %4.2f ",
@@ -308,7 +308,7 @@ void init(void) · 79 unmodified lines
308 if (noiseOn) { 308 if (noiseOn) {
309 myAvatar.setNoise(noise);309 myAvatar.setNoise(noise);
310 }310 }
311 myAvatar.setPos(start_location );311 myAvatar.setBodyPosition(start_location);
312 myCamera.setPosition( start_location );312 myCamera.setPosition( start_location );
313 313
314 314
@@ -350,7 +350,7 @@ void reset_sensors() · 35 unmodified lines
350 350
351 yaw = renderYawRate = 0; 351 yaw = renderYawRate = 0;
352 pitch = renderPitch = renderPitchRate = 0;352 pitch = renderPitch = renderPitchRate = 0;
353 myAvatar.setPos(start_location);353 myAvatar.setBodyPosition(start_location);
354 headMouseX = WIDTH/2;354 headMouseX = WIDTH/2;
355 headMouseY = HEIGHT/2;355 headMouseY = HEIGHT/2;
356 356
@@ -461,7 +461,7 @@ void simulateHead(float frametime) · 104 unmodified lines
461 // If I'm in paint mode, send a voxel out to VOXEL server agents.461 // If I'm in paint mode, send a voxel out to VOXEL server agents.
462 if (::paintOn) {462 if (::paintOn) {
463 463
464 glm::vec3 avatarPos = myAvatar.getPos();464 glm::vec3 avatarPos = myAvatar.getBodyPosition();
465 465
466 // For some reason, we don't want to flip X and Z here.466 // For some reason, we don't want to flip X and Z here.
467 ::paintingVoxel.x = avatarPos.x/10.0; 467 ::paintingVoxel.x = avatarPos.x/10.0;
@@ -687,7 +687,7 @@ void display(void) · 219 unmodified lines
687 //--------------------------------------------------------687 //--------------------------------------------------------
688 // camera settings688 // camera settings
689 //-------------------------------------------------------- 689 //--------------------------------------------------------
690 myCamera.setTargetPosition( myAvatar.getPos() ); 690 myCamera.setTargetPosition( myAvatar.getBodyPosition() );
691 691
692 if ( displayHead ) {692 if ( displayHead ) {
693 //-----------------------------------------------693 //-----------------------------------------------
@@ -799,7 +799,7 @@ void display(void) · 105 unmodified lines
799 if (agent->getLinkedData() != NULL) {799 if (agent->getLinkedData() != NULL) {
800 Head *agentHead = (Head *)agent->getLinkedData();800 Head *agentHead = (Head *)agent->getLinkedData();
801 glPushMatrix();801 glPushMatrix();
802 glm::vec3 pos = agentHead->getPos();802 glm::vec3 pos = agentHead->getBodyPosition();
803 glTranslatef(-pos.x, -pos.y, -pos.z);803 glTranslatef(-pos.x, -pos.y, -pos.z);
804 agentHead->render(0, 0);804 agentHead->render(0, 0);
805 glPopMatrix();805 glPopMatrix();
@@ -1083,7 +1083,7 @@ void shiftPaintingColor() · 277 unmodified lines
1083}1083}
1084 1084
1085void setupPaintingVoxel() {1085void setupPaintingVoxel() {
1086 glm::vec3 avatarPos = myAvatar.getPos();1086 glm::vec3 avatarPos = myAvatar.getBodyPosition();
1087 1087
1088 ::paintingVoxel.x = avatarPos.z/-10.0; // voxel space x is negative z head space1088 ::paintingVoxel.x = avatarPos.z/-10.0; // voxel space x is negative z head space
1089 ::paintingVoxel.y = avatarPos.y/-10.0; // voxel space y is negative y head space1089 ::paintingVoxel.y = avatarPos.y/-10.0; // voxel space y is negative y head space