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
551551 }
552552
553553 void Application::keyPressEvent(QKeyEvent* event) {
554+
554555 if (activeWindow() == _window) {
555556 if (_chatEntryOn) {
556557 if (_chatEntry.keyPressEvent(event)) {
@@ -566,6 +567,11 @@ void Application::keyPressEvent(QKeyEvent* event) { · 9 unmodified lines
566567 }
567568 return;
568569 }
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+ }
569575
570576 bool shifted = event->modifiers().testFlag(Qt::ShiftModifier);
571577 switch (event->key()) {
@@ -765,7 +771,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 193 unmodified lines
765771 case Qt::Key_6:
766772 case Qt::Key_7:
767773 case Qt::Key_8:
768− _swatch.handleEvent(event->key(), _eyedropperMode->isChecked());
774+ _swatch.handleEvent(event->key(), _eyedropperMode->isChecked());
769775 break;
770776 default:
771777 event->ignore();
@@ -776,6 +782,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 4 unmodified lines
776782
777783 void Application::keyReleaseEvent(QKeyEvent* event) {
778784 if (activeWindow() == _window) {
785+
779786 if (_chatEntryOn) {
780787 _myAvatar.setKeyState(NO_KEY_DOWN);
781788 return;
@@ -2652,9 +2659,17 @@ void Application::displaySide(Camera& whichCamera) { · 1870 unmodified lines
26522659 float sphereRadius = 0.25f;
26532660 glColor3f(1,0,0);
26542661 glPushMatrix();
2655− glutSolidSphere(sphereRadius, 15, 15);
2662+ glutSolidSphere(sphereRadius, 15, 15);
26562663 glPopMatrix();
26572664
2665+/*
2666+glPushMatrix();
2667+glColor3f(1, 0, 1);
2668+glTranslatef(0.0f, 0.0f, 5.0f);
2669+_particleSystem.render();
2670+glPopMatrix();
2671+*/
2672+
26582673 //draw a grid ground plane....
26592674 if (_renderGroundPlaneOn->isChecked()) {
26602675 renderGroundPlaneGrid(EDGE_SIZE_GROUND_PLANE, _audio.getCollisionSoundMagnitude());
@@ -2715,13 +2730,25 @@ void Application::displaySide(Camera& whichCamera) { · 54 unmodified lines
27152730 renderLookatIndicator(_lookatOtherPosition, whichCamera);
27162731 }
27172732 }
2718−
2733+
27192734 if (TESTING_PARTICLE_SYSTEM) {
27202735 if (_particleSystemInitialized) {
2721− _particleSystem.render();
2736+
2737+
2738+
2739+/*
2740+glPushMatrix();
2741+glColor3f(1, 0, 1);
2742+glTranslatef(0.0f, 0.0f, 5.0f);
2743+_particleSystem.render();
2744+glPopMatrix();
2745+*/
2746+
2747+_particleSystem.render();
27222748 }
27232749 }
2724−
2750+
2751+
27252752 // Render the world box
27262753 if (!_lookingInMirror->isChecked() && _renderStatsOn->isChecked()) { render_world_box(); }
27272754
@@ -3658,8 +3685,9 @@ void Application::updateParticleSystem(float deltaTime) { · 930 unmodified lines
36583685 const float EMIT_RATE_IN_SECONDS = 10000.0;
36593686 // create a stable test emitter and spit out a bunch of particles
36603687 _coolDemoParticleEmitter = _particleSystem.addEmitter();
3661−
3688+
36623689 if (_coolDemoParticleEmitter != -1) {
3690+
36633691 _particleSystem.setShowingEmitter(_coolDemoParticleEmitter, true);
36643692 glm::vec3 particleEmitterPosition = glm::vec3(5.0f, 1.0f, 5.0f);
36653693
@@ -3673,7 +3701,7 @@ void Application::updateParticleSystem(float deltaTime) { · 7 unmodified lines
36733701 _particleSystemInitialized = true;
36743702 } else {
36753703 // update the particle system
3676−
3704+
36773705 static bool emitting = true;
36783706 static float t = 0.0f;
36793707 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