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
222222 char legend2[] = "* - toggle stars, & - toggle paint mode, '-' - send erase all, '%' - send add scene";
223223 drawtext(10, statsVerticalOffset + 32, 0.10f, 0, 1.0, 0, legend2);
224224
225− glm::vec3 avatarPos = myAvatar.getPos();
225+ glm::vec3 avatarPos = myAvatar.getBodyPosition();
226226
227227 char stats[200];
228228 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
308308 if (noiseOn) {
309309 myAvatar.setNoise(noise);
310310 }
311− myAvatar.setPos(start_location );
311+ myAvatar.setBodyPosition(start_location);
312312 myCamera.setPosition( start_location );
313313
314314
@@ -350,7 +350,7 @@ void reset_sensors() · 35 unmodified lines
350350
351351 yaw = renderYawRate = 0;
352352 pitch = renderPitch = renderPitchRate = 0;
353− myAvatar.setPos(start_location);
353+ myAvatar.setBodyPosition(start_location);
354354 headMouseX = WIDTH/2;
355355 headMouseY = HEIGHT/2;
356356
@@ -461,7 +461,7 @@ void simulateHead(float frametime) · 104 unmodified lines
461461 // If I'm in paint mode, send a voxel out to VOXEL server agents.
462462 if (::paintOn) {
463463
464− glm::vec3 avatarPos = myAvatar.getPos();
464+ glm::vec3 avatarPos = myAvatar.getBodyPosition();
465465
466466 // For some reason, we don't want to flip X and Z here.
467467 ::paintingVoxel.x = avatarPos.x/10.0;
@@ -687,7 +687,7 @@ void display(void) · 219 unmodified lines
687687 //--------------------------------------------------------
688688 // camera settings
689689 //--------------------------------------------------------
690− myCamera.setTargetPosition( myAvatar.getPos() );
690+ myCamera.setTargetPosition( myAvatar.getBodyPosition() );
691691
692692 if ( displayHead ) {
693693 //-----------------------------------------------
@@ -799,7 +799,7 @@ void display(void) · 105 unmodified lines
799799 if (agent->getLinkedData() != NULL) {
800800 Head *agentHead = (Head *)agent->getLinkedData();
801801 glPushMatrix();
802− glm::vec3 pos = agentHead->getPos();
802+ glm::vec3 pos = agentHead->getBodyPosition();
803803 glTranslatef(-pos.x, -pos.y, -pos.z);
804804 agentHead->render(0, 0);
805805 glPopMatrix();
@@ -1083,7 +1083,7 @@ void shiftPaintingColor() · 277 unmodified lines
10831083 }
10841084
10851085 void setupPaintingVoxel() {
1086− glm::vec3 avatarPos = myAvatar.getPos();
1086+ glm::vec3 avatarPos = myAvatar.getBodyPosition();
10871087
10881088 ::paintingVoxel.x = avatarPos.z/-10.0; // voxel space x is negative z head space
10891089 ::paintingVoxel.y = avatarPos.y/-10.0; // voxel space y is negative y head space