void step(float dt){ // update glove pinch detection based on current marker positions left.step(dt); right.step(dt); // do glove interaction doInteraction(dt); }
void Interaction::interact(Mover* actor, Mover* acted) { bool actorOK = evaluateActorCondition(actor); bool actedOK = evaluateActedCondition(acted); bool distanceOK = evaluateDistanceCondition(acted); if(actorOK && actedOK && distanceOK) { doInteraction(actor, acted); } }
int main( int argc, char **argv ) { if( argc < 2 ) { printf( "usage: %s <keyfile>\n", argv[0] ); exit( 1 ); } if( initKeys(argv[1]) ) { printf( "Error in reading in key file, aborting.\n" ); exit(1); } //printkeys(); doInteraction(); return 0; }
void coNavInteraction::update() { vruiButtons *button = vruiRendererInterface::the()->getButtons(); runningState = StateNotRunning; if (state == Idle) { if (button->wasPressed(1<<type)) { if (activate()) { runningState = StateStarted; startInteraction(); } } } else if (state == Active || state == Paused || state == ActiveNotify) //else if (state == Active) { if (button->getStatus() & (1<<type)) { if (state == Paused) { runningState = StateStopped; } else { runningState = StateRunning; doInteraction(); } } else { runningState = StateStopped; stopInteraction(); state = Idle; } } }