コード例 #1
0
ファイル: chord.cpp プロジェクト: beentaken/UOW_INTISubang
void Chord::run(string file){
	read(file); // Read Command from file

	// For each command, perform the repective function
	for(vector<Command>::iterator c = cmd.begin(); c != cmd.end(); c++){
		if (c->command.compare("init") == 0) {
			init(c->peer);
		}
		if (c->command.compare("addpeer") == 0) {
			addPeer(c->peer);
			updateFinger();
		}
		if (c->command.compare("insert") == 0) {
			insert(c->peer, c->message);
		}
		if (c->command.compare("print") == 0) {
			print(c->peer);
		}
		if (c->command.compare("delete") == 0) {
			Delete(c->peer, c->message);
		}
		if (c->command.compare("removepeer") == 0) {
			removePeer(c->peer);
			updateFinger();
		}
	}
}
コード例 #2
0
ファイル: Tracker.cpp プロジェクト: ManusVR/Manus-OSVR
void ManusOSVR::Tracker::updateHand(GLOVE_HAND hand, GLOVE_SKELETAL model) {
	int channelOffset = (hand == GLOVE_LEFT) ? 0 : ChannelsPerHand;
	int channel = ThumbMeta;
	OSVR_OrientationState os;

	Manus2OSVR(model.palm.orientation, os);
	osvrDeviceTrackerSendOrientation(mDeviceToken, mTrackerInterface, &os, Palm + channelOffset);

	updateFinger(hand, model.thumb, ThumbMeta + channelOffset);
	updateFinger(hand, model.index,  IndexMeta  + channelOffset);
	updateFinger(hand, model.middle, MiddleMeta + channelOffset);
	updateFinger(hand, model.ring,   RingMeta   + channelOffset);
	updateFinger(hand, model.pinky,  PinkyMeta  + channelOffset);
}
コード例 #3
0
void MultiTouchManager::handleFingerUp(const SDL_Event &event)
{
    updateFinger(event, false);
}
コード例 #4
0
void MultiTouchManager::handleFingerDown(const SDL_Event &event)
{
    updateFinger(event, true);
    const SDL_TouchFingerEvent &touch = event.tfinger;
    checkDevice(touch.touchId, touch.fingerId);
}