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
8585 using namespace std;
8686
8787 void reshape(int width, int height); // will be defined below
88+void loadViewFrustum(ViewFrustum& viewFrustum); // will be defined below
8889
8990
9091 pthread_t networkReceiveThread;
@@ -522,6 +523,22 @@ void updateAvatar(float frametime) · 431 unmodified lines
522523 myAvatar.setAverageLoudness(averageLoudness);
523524 #endif
524525
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+
525542 // Send my stream of head/hand data to the avatar mixer and voxel server
526543 unsigned char broadcastString[200];
527544 *broadcastString = PACKET_HEADER_HEAD_DATA;
@@ -559,7 +576,7 @@ void updateAvatar(float frametime) · 31 unmodified lines
559576 }
560577
561578 /////////////////////////////////////////////////////////////////////////////////////
562−// renderViewFrustum()
579+// loadViewFrustum()
563580 //
564581 // Description: this will load the view frustum bounds for EITHER the head
565582 // or the "myCamera".