History

Merge remote-tracking branch 'upstream/master'

Jeffrey Ventrella committed 13 years ago

Commit caead242 parents ca2840f d92f5b811 files · +267 −64Browse files

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

Unified · Split

interface/src/main.cpp+18−1
@@ -85,6 +85,7 @@ · 84 unmodified lines
85using namespace std;85using namespace std;
86 86
87void reshape(int width, int height); // will be defined below87void reshape(int width, int height); // will be defined below
88void loadViewFrustum(ViewFrustum& viewFrustum); // will be defined below
88 89
89 90
90pthread_t networkReceiveThread;91pthread_t networkReceiveThread;
@@ -522,6 +523,22 @@ void updateAvatar(float frametime) · 431 unmodified lines
522 myAvatar.setAverageLoudness(averageLoudness);523 myAvatar.setAverageLoudness(averageLoudness);
523 #endif524 #endif
524 525
526 // Update Avatar with latest camera and view frustum data...
527 // NOTE: we get this from the view frustum, to make it simpler, since the
528 // loadViewFrumstum() method will get the correct details from the camera
529 // We could optimize this to not actually load the viewFrustum, since we don't
530 // actually need to calculate the view frustum planes to send these details
531 // to the server.
532 loadViewFrustum(::viewFrustum);
533 myAvatar.setCameraPosition(::viewFrustum.getPosition());
534 myAvatar.setCameraDirection(::viewFrustum.getDirection());
535 myAvatar.setCameraUp(::viewFrustum.getUp());
536 myAvatar.setCameraRight(::viewFrustum.getRight());
537 myAvatar.setCameraFov(::viewFrustum.getFieldOfView());
538 myAvatar.setCameraAspectRatio(::viewFrustum.getAspectRatio());
539 myAvatar.setCameraNearClip(::viewFrustum.getNearClip());
540 myAvatar.setCameraFarClip(::viewFrustum.getFarClip());
541
525 // Send my stream of head/hand data to the avatar mixer and voxel server542 // Send my stream of head/hand data to the avatar mixer and voxel server
526 unsigned char broadcastString[200];543 unsigned char broadcastString[200];
527 *broadcastString = PACKET_HEADER_HEAD_DATA;544 *broadcastString = PACKET_HEADER_HEAD_DATA;
@@ -559,7 +576,7 @@ void updateAvatar(float frametime) · 31 unmodified lines
559}576}
560 577
561/////////////////////////////////////////////////////////////////////////////////////578/////////////////////////////////////////////////////////////////////////////////////
562// renderViewFrustum()579// loadViewFrustum()
563//580//
564// Description: this will load the view frustum bounds for EITHER the head581// Description: this will load the view frustum bounds for EITHER the head
565// or the "myCamera". 582// or the "myCamera".