void main() { showWaveDeviceCaps(); generateWave(0); openWaveDevice(0); playWaveSingleTime(); disposeWave(); closeWaveDevice(); return; }
void BOSApp::updateScaleParametersWithKinect() { //detect higher Z depth : Toggle BOS const ofPixels &depthPixels = objectDetector->depthPixels(); int tableMaskLine = KINECT_Y - 200; int closestY = -1; int closestX = KINECT_X / 2; // Get cloest Y for (int y = tableMaskLine; y >= 0; y--) { for (int x = 0; x < KINECT_X; x++) { if (depthPixels[x + (y * KINECT_X)] > 0) { closestY = y; closestX = x; break; } } if (closestY > -1) { break; } } // Detect Z<200??? Is depth pixels correct here? for (int y = 0; y < KINECT_Y; y++) { for (int x = 0; x < KINECT_X; x++) { if (depthPixels[x + (y * KINECT_X)] < 200) { if (bosEnabled) { bosEnabled=false; } else { // delay somehow for 1 second bosEnabled=true; generateWave(); } } } } if (bosEnabled) { if (closestY > -1) { float normalized = 1.0 * (tableMaskLine - closestY) / tableMaskLine; scaler = 5 * normalized; } else { scaler = 1.0; } // Angle Arrow to Body Position } }
void GameObjectManager::update(IObservable *observerable) { if (m_pEngine->m_gameState != MyProjectMain::PLAYING) return; /* Delete the first buffer */ delete[] m_waveObjectsBuffer1; /* Swap the wave pointers */ m_waveObjectsBuffer1 = m_waveObjectsBuffer2; m_numWaveObjectsBuffer1 = m_numWaveObjectsBuffer2; m_waveObjectsBuffer2 = new GameObject*[m_maxObjects]; /* Generate a new wave for the second buffer */ generateWave(); }
int main(int argc, char *argv[]) { screen(width,height); screentitle("PlayWave"); settextfont("FreeMono.ttf",45); setonkey(keyfnc); run_async(sndPlayer,NULL); while(1) { fillrect(0,0,width,height,0); drawtext( "Press Something",0 ,0,0xf0ffff00); if(keystate==1){ inchz(); } else if(keystate == -1){ dechz(); } generateWave(); drawwav(); drawtext(keymsg_buf ,0,45,0xf0ffff00); flushscreen(); } return 0; }
void GameObjectManager::generateWave() { generateWave(m_waveObjectsBuffer2, m_numWaveObjectsBuffer2); }