History

added keyboard mode switching for rave glove effects

Jeffrey Ventrella committed 13 years ago

Commit 9890cf71 parent 1d5bf206 files · +118 −51Browse files

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

Unified · Split

interface/src/Application.cpp+35−7
@@ -551,6 +551,7 @@ void Application::sendVoxelServerAddScene() { · 550 unmodified lines
551}551}
552 552
553void Application::keyPressEvent(QKeyEvent* event) {553void Application::keyPressEvent(QKeyEvent* event) {
554
554 if (activeWindow() == _window) {555 if (activeWindow() == _window) {
555 if (_chatEntryOn) {556 if (_chatEntryOn) {
556 if (_chatEntry.keyPressEvent(event)) {557 if (_chatEntry.keyPressEvent(event)) {
@@ -566,6 +567,11 @@ void Application::keyPressEvent(QKeyEvent* event) { · 9 unmodified lines
566 }567 }
567 return;568 return;
568 }569 }
570
571 //this is for switching between modes for the leap rave glove test
572 if (_simulateLeapHand->isChecked() || _testRaveGlove->isChecked()) {
573 _myAvatar.getHand().setRaveGloveEffectsMode((QKeyEvent*)event);
574 }
569 575
570 bool shifted = event->modifiers().testFlag(Qt::ShiftModifier);576 bool shifted = event->modifiers().testFlag(Qt::ShiftModifier);
571 switch (event->key()) {577 switch (event->key()) {
@@ -765,7 +771,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 193 unmodified lines
765 case Qt::Key_6:771 case Qt::Key_6:
766 case Qt::Key_7:772 case Qt::Key_7:
767 case Qt::Key_8:773 case Qt::Key_8:
768 _swatch.handleEvent(event->key(), _eyedropperMode->isChecked());774 _swatch.handleEvent(event->key(), _eyedropperMode->isChecked());
769 break;775 break;
770 default:776 default:
771 event->ignore();777 event->ignore();
@@ -776,6 +782,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 4 unmodified lines
776 782
777void Application::keyReleaseEvent(QKeyEvent* event) {783void Application::keyReleaseEvent(QKeyEvent* event) {
778 if (activeWindow() == _window) {784 if (activeWindow() == _window) {
785
779 if (_chatEntryOn) {786 if (_chatEntryOn) {
780 _myAvatar.setKeyState(NO_KEY_DOWN);787 _myAvatar.setKeyState(NO_KEY_DOWN);
781 return;788 return;
@@ -2652,9 +2659,17 @@ void Application::displaySide(Camera& whichCamera) { · 1870 unmodified lines
2652 float sphereRadius = 0.25f;2659 float sphereRadius = 0.25f;
2653 glColor3f(1,0,0);2660 glColor3f(1,0,0);
2654 glPushMatrix();2661 glPushMatrix();
2655 glutSolidSphere(sphereRadius, 15, 15);2662 glutSolidSphere(sphereRadius, 15, 15);
2656 glPopMatrix();2663 glPopMatrix();
2657 2664
2665/*
2666glPushMatrix();
2667glColor3f(1, 0, 1);
2668glTranslatef(0.0f, 0.0f, 5.0f);
2669_particleSystem.render();
2670glPopMatrix();
2671*/
2672
2658 //draw a grid ground plane....2673 //draw a grid ground plane....
2659 if (_renderGroundPlaneOn->isChecked()) {2674 if (_renderGroundPlaneOn->isChecked()) {
2660 renderGroundPlaneGrid(EDGE_SIZE_GROUND_PLANE, _audio.getCollisionSoundMagnitude());2675 renderGroundPlaneGrid(EDGE_SIZE_GROUND_PLANE, _audio.getCollisionSoundMagnitude());
@@ -2715,13 +2730,25 @@ void Application::displaySide(Camera& whichCamera) { · 54 unmodified lines
2715 renderLookatIndicator(_lookatOtherPosition, whichCamera);2730 renderLookatIndicator(_lookatOtherPosition, whichCamera);
2716 }2731 }
2717 }2732 }
2718 2733
2719 if (TESTING_PARTICLE_SYSTEM) {2734 if (TESTING_PARTICLE_SYSTEM) {
2720 if (_particleSystemInitialized) {2735 if (_particleSystemInitialized) {
2721 _particleSystem.render(); 2736
2737
2738
2739/*
2740glPushMatrix();
2741glColor3f(1, 0, 1);
2742glTranslatef(0.0f, 0.0f, 5.0f);
2743_particleSystem.render();
2744glPopMatrix();
2745*/
2746
2747_particleSystem.render();
2722 }2748 }
2723 }2749 }
2724 2750
2751
2725 // Render the world box2752 // Render the world box
2726 if (!_lookingInMirror->isChecked() && _renderStatsOn->isChecked()) { render_world_box(); }2753 if (!_lookingInMirror->isChecked() && _renderStatsOn->isChecked()) { render_world_box(); }
2727 2754
@@ -3658,8 +3685,9 @@ void Application::updateParticleSystem(float deltaTime) { · 930 unmodified lines
3658 const float EMIT_RATE_IN_SECONDS = 10000.0;3685 const float EMIT_RATE_IN_SECONDS = 10000.0;
3659 // create a stable test emitter and spit out a bunch of particles3686 // create a stable test emitter and spit out a bunch of particles
3660 _coolDemoParticleEmitter = _particleSystem.addEmitter();3687 _coolDemoParticleEmitter = _particleSystem.addEmitter();
3661 3688
3662 if (_coolDemoParticleEmitter != -1) {3689 if (_coolDemoParticleEmitter != -1) {
3690
3663 _particleSystem.setShowingEmitter(_coolDemoParticleEmitter, true);3691 _particleSystem.setShowingEmitter(_coolDemoParticleEmitter, true);
3664 glm::vec3 particleEmitterPosition = glm::vec3(5.0f, 1.0f, 5.0f); 3692 glm::vec3 particleEmitterPosition = glm::vec3(5.0f, 1.0f, 5.0f);
3665 3693
@@ -3673,7 +3701,7 @@ void Application::updateParticleSystem(float deltaTime) { · 7 unmodified lines
3673 _particleSystemInitialized = true; 3701 _particleSystemInitialized = true;
3674 } else {3702 } else {
3675 // update the particle system3703 // update the particle system
3676 3704
3677 static bool emitting = true;3705 static bool emitting = true;
3678 static float t = 0.0f;3706 static float t = 0.0f;
3679 t += deltaTime;3707 t += deltaTime;

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