History

Merge remote-tracking branch 'upstream/master'

Jeffrey Ventrella committed 13 years ago

Commit 40213df2 parents 5c7fd0f 83c8ac616 files · +624 −204Browse files

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

Unified · Split

interface/src/main.cpp+14−16
@@ -204,8 +204,7 @@ bool justStarted = true; · 203 unmodified lines
204204
205205
206206 // Every second, check the frame rates and other stuff
207−void Timer(int extra)
208−{
207+void Timer(int extra) {
209208 gettimeofday(&timerEnd, NULL);
210209 FPS = (float)frameCount / ((float)diffclock(&timerStart, &timerEnd) / 1000.f);
211210 packetsPerSecond = (float)packetCount / ((float)diffclock(&timerStart, &timerEnd) / 1000.f);
@@ -223,8 +222,7 @@ void Timer(int extra) · 11 unmodified lines
223222 }
224223 }
225224
226−void displayStats(void)
227−{
225+void displayStats(void) {
228226 int statsVerticalOffset = 50;
229227 if (::menuOn == 0) {
230228 statsVerticalOffset = 8;
@@ -265,6 +263,7 @@ void displayStats(void) · 34 unmodified lines
265263
266264 Agent *avatarMixer = AgentList::getInstance()->soloAgentOfType(AGENT_TYPE_AVATAR_MIXER);
267265 char avatarMixerStats[200];
266+
268267 if (avatarMixer) {
269268 sprintf(avatarMixerStats, "Avatar Mixer: %.f kbps, %.f pps",
270269 roundf(avatarMixer->getAverageKilobitsPerSecond()),
@@ -272,6 +271,7 @@ void displayStats(void) · 1 unmodified line
272271 } else {
273272 sprintf(avatarMixerStats, "No Avatar Mixer");
274273 }
274+
275275 drawtext(10, statsVerticalOffset + 330, 0.10f, 0, 1.0, 0, avatarMixerStats);
276276
277277 if (::perfStatsOn) {
@@ -289,8 +289,7 @@ void displayStats(void) · 11 unmodified lines
289289 }
290290 }
291291
292−void initDisplay(void)
293−{
292+void initDisplay(void) {
294293 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
295294 glEnable(GL_BLEND);
296295 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -302,8 +301,7 @@ void initDisplay(void) · 5 unmodified lines
302301 if (fullscreen) glutFullScreen();
303302 }
304303
305−void init(void)
306−{
304+void init(void) {
307305 voxels.init();
308306 voxels.setViewerAvatar(&myAvatar);
309307 voxels.setCamera(&myCamera);
@@ -356,8 +354,7 @@ void terminate () { · 46 unmodified lines
356354 exit(EXIT_SUCCESS);
357355 }
358356
359−void reset_sensors()
360−{
357+void reset_sensors() {
361358
362359 myAvatar.setPosition(start_location);
363360 headMouseX = WIDTH/2;
@@ -373,16 +370,13 @@ void reset_sensors() · 9 unmodified lines
373370 //
374371 // Using gyro data, update both view frustum and avatar head position
375372 //
376−void updateAvatar(float frametime)
377−{
373+void updateAvatar(float frametime) {
378374 float gyroPitchRate = serialPort.getRelativeValue(HEAD_PITCH_RATE);
379375 float gyroYawRate = serialPort.getRelativeValue(HEAD_YAW_RATE );
380376
381377 myAvatar.UpdateGyros(frametime, &serialPort, &gravity);
382378
383− //
384379 // Update gyro-based mouse (X,Y on screen)
385− //
386380 const float MIN_MOUSE_RATE = 30.0;
387381 const float MOUSE_SENSITIVITY = 0.1f;
388382 if (powf(gyroYawRate*gyroYawRate +
@@ -397,7 +391,7 @@ void updateAvatar(float frametime) · 8 unmodified lines
397391 headMouseY = min(headMouseY, HEIGHT);
398392
399393 // Update head and body pitch and yaw based on measured gyro rates
400− if (::gyroLook) {
394+ if (::gyroLook) {
401395 // Yaw
402396 const float MIN_YAW_RATE = 50;
403397 const float YAW_SENSITIVITY = 1.0;
@@ -1686,6 +1680,10 @@ void idle(void) { · 1282 unmodified lines
16861680 handControl.stop();
16871681 }
16881682
1683+ if (serialPort.active && USING_INVENSENSE_MPU9150) {
1684+ serialPort.readData();
1685+ }
1686+
16891687 // Sample hardware, update view frustum if needed, Lsend avatar data to mixer/agents
16901688 updateAvatar(deltaTime);
16911689
@@ -1712,7 +1710,7 @@ void idle(void) { · 20 unmodified lines
17121710 }
17131711
17141712 // Read serial data
1715− if (serialPort.active) {
1713+ if (serialPort.active && !USING_INVENSENSE_MPU9150) {
17161714 serialPort.readData();
17171715 }
17181716 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t