亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? aflock.cpp

?? FreeWRLduneInputDevice和FreeWRL一起可以讓用戶用帶有6DoF的輸入設(shè)備檢索3D VRML/X3D數(shù)據(jù)。它基于FreeWRL的"/tmp/inpdev"擴(kuò)展傳感器輸入接口和w
?? CPP
?? 第 1 頁 / 共 3 頁
字號(hào):
/*************** <auto-copyright.pl BEGIN do not edit this line> ************** * * VR Juggler is (C) Copyright 1998, 1999, 2000 by Iowa State University * * Original Authors: *   Allen Bierbaum, Christopher Just, *   Patrick Hartling, Kevin Meinert, *   Carolina Cruz-Neira, Albert Baker * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * ----------------------------------------------------------------- * File:          aFlock.cpp,v * Date modified: 2001/05/22 14:54:46 * Version:       1.41.6.2 * ----------------------------------------------------------------- * *************** <auto-copyright.pl END do not edit this line> ***************/// Author://	Kevin Meinert//      modified for white_dune by J. "MUFTI" Scheurich //      using things from HeadTracker/I3Stick API by J. Dean Brederson//      using things from stty.c by David MacKenzie <djm@gnu.ai.mit.edu> ////      the streaming mode of the orginal VRjuggler Ascention Flock of birds //      tracking class seams to be not a good idea for white_dune...// // Last Modified: Wed May 29 2002#include <config.h>#ifdef HAVE_AFLOCK#include <string.h>		#include <fcntl.h>         // for open#include <termios.h>#include <unistd.h>        // for sleep, and ioctl#include <stdlib.h>        // for system (to be deleted...)#ifdef __linux__# include <sys/ioctl.h>//# include <asm/termbits.h>//# include <sys/termios.h>#endif#include <sys/types.h>     // for open#include <sys/stat.h>      // for open#include <stdio.h>         // for fopen,fprintf#include <assert.h>        // for assert#if defined(__sun__) || defined(__hpux)#include <sys/file.h>#endif#include "Aflock.h"#ifdef HAVE_AFLOCK_DEBUG#define AFLOCK_ERROR_CHECK(port,bird,what) //#define AFLOCK_ERROR_CHECK(port,bird,what) aflock_error_check(port,what,bird)static void aflock_error_check(int port,int bird,char* what){     char geterror[3];    geterror[0]=bird+0xF0;    geterror[1]='O';    geterror[2]=0x0A;    if (write(port, geterror, 3) == -1)        fprintf(stderr, "Error sending geterror command while %s\n",what);    tcdrain(port);    char flockerror[1];    if (read(port, flockerror, 1) == -1)        fprintf(stderr, "Error getting errorcode command while %s\n",what);    else if (flockerror[0]!=0)        fprintf(stderr, "Errorcode: %d from bird %d while %s\n",                        flockerror[0],bird,what);}#else#define AFLOCK_ERROR_CHECK(port,bird,what)#endifconst int Aflock::MAXCHARSTRINGSIZE = 256;const int Aflock::mSleepFactor = 3;//: Configure Constructor// Give:                                                 <BR>//   port - such as "/dev/ttyd3"                         <BR>//   baud - such as 38400, 19200, 9600, 14400, etc...    <BR>//   sync - sync type.                                   <BR>//   block - blocking                                    <BR>//   numBrds - number of birds in flock,                 <BR>//   transmit - transmitter unit number,                 <BR>//   hemi - hemisphere to track from,                    <BR>//   filt - filtering type,                              <BR>//   report -                                            <BR>//   calfile - a calibration file, if "", then use none. <BR>//                                                       <BR>// Result: configures internal data members,//         doesn't actually talk to the FOB yet.Aflock::Aflock(const char* const port,		const int& baud,		const int& sync,		const int& block,		const int& numBrds,		const int& transmit,		const BIRD_HEMI& hemi,		const BIRD_FILT& filt,		const bool& sudden_lock,		const char& report,	  	const char* const calfile) :		  _reportRate(report),		  _hemisphere(hemi),		  _filter(filt),                  _sudden_output_change_lock(sudden_lock),		  _portId(-1),		  _baud(baud),		  _syncStyle(sync),		  _blocking(block),		  _numBirds(numBrds),		  _xmitterUnitNumber(transmit),		  _usingCorrectionTable(false),		  _active(false){  if (port != NULL)  	strncpy( _port, port, Aflock::MAXCHARSTRINGSIZE );  // fix the report rate if it makes no sense.  if ((_reportRate != 'Q') && (_reportRate != 'R') &&      (_reportRate != 'S') && (_reportRate != 'T'))  {     // illegal report rate, defaulting to "every other cycle" (R)     assert(false);     _reportRate = 'R';  }  if (calfile != NULL && calfile[0] != '\0')  {  	strncpy( _calibrationFileName, calfile, Aflock::MAXCHARSTRINGSIZE );  	this->initCorrectionTable(_calibrationFileName);  	_usingCorrectionTable = true;  }	  _samplePrepared=false;  _masterUseReceiver=false;}//: DestructorAflock::~Aflock(){    this->stop();}//: deliver number of active devices  int Aflock::getNumberDevices(void) const{    if (_masterUseReceiver)       return getNumBirds();    else        return getNumBirds()+1;}bool Aflock::deliverData(int birdaddr){    if (birdaddr==_xmitterUnitNumber)       if (_masterUseReceiver)          return(false);    return(true);}//: see if the flock is active or notconst bool& Aflock::isActive() const{    return _active;}//: set the port to use//  this will be a string in the form of the native OS descriptor <BR>//  ex: unix - "/dev/ttyd3", win32 - "COM3" <BR>//  NOTE: flock.isActive() must be false to use this functionvoid Aflock::setPort(const char* const serialPort){    if (_active)    {	fprintf(stderr,"Aflock: Cannot change the serial Port while active\n");	return;    }    if (serialPort != NULL)  	strncpy( _port, serialPort, Aflock::MAXCHARSTRINGSIZE );}//: get the port used//  this will be a string in the form of the native OS descriptor <BR>//  ex: unix - "/dev/ttyd3", win32 - "COM3"const char* Aflock::getPort() const{    return _port;}//: set the baud rate//  this is generally 38400, consult flock manual for other rates. <BR>//  NOTE: flock.isActive() must be false to use this functionvoid Aflock::setBaudRate(const int& baud){    if (_active)    {	AFLOCK_PRINT("Aflock: Cannot change the baud rate while active\n");	return;    } else {	_baud = baud;    }}//: call this to connect to the flock device.//  NOTE: flock.isActive() must be false to use this functionint Aflock::start(){    if (!_active)    {      AFLOCK_PRINT("Aflock: Getting ready....\n\n");      AFLOCK_PRINT("Aflock: Opening port\n");      Aflock::open_port( _port, _baud, _portId );      if (_portId == -1)      {         fprintf(stderr,"unable to open port\n");	 return 0;      }      // number of bytes per flock in groupmode:#ifdef USE_AFLOCK_QUATERNION      // 14 Byte for position/quaternion      // 1 Byte for what flock      #define NUMBER_OF_BYTES_PER_FLOCK 15#else      // 12 Byte for position/angles      // 1 Byte for what flock      #define NUMBER_OF_BYTES_PER_FLOCK 13#endif      _grouplength=_numBirds*NUMBER_OF_BYTES_PER_FLOCK;      _groupbuffer=new char[_grouplength];      AFLOCK_PRINT("Aflock: throw away dirt from port\n");      Aflock::destroyDirt();      if (_blocking==1)         AFLOCK_PRINT("Aflock: Setting blocking\n");      else if (_blocking==0)         AFLOCK_PRINT("Aflock: Setting non blocking\n");      Aflock::set_blocking( _portId, _blocking );      if (_syncStyle!=0)         AFLOCK_PRINT("Aflock: Setting sync\n");      Aflock::set_sync( _portId, _syncStyle );// Transmitter is at adress 1 (default)      AFLOCK_PRINT("Aflock: Setting transmitter\n");      Aflock::set_transmitter( _portId, _xmitterUnitNumber );#ifdef USE_AFLOCK_QUATERNION      AFLOCK_PRINT("Aflock: Setting pos_quaternion\n");      Aflock::set_pos_quat( _portId, _xmitterUnitNumber );#else      AFLOCK_PRINT("Aflock: Setting pos_angles\n");      Aflock::set_pos_angles( _portId, _xmitterUnitNumber );#endif      AFLOCK_PRINT("Aflock: Setting hemisphere\n");      Aflock::set_hemisphere( _portId, _hemisphere, _xmitterUnitNumber );      AFLOCK_PRINT("Aflock: Setting autoconfig\n");      Aflock::set_autoconfig( _portId );      if (_filter!=FILTER_DEFAULT)       {         AFLOCK_PRINT("Aflock: Setting filter\n");         Aflock::set_filter( _portId, _filter );      }            if (_sudden_output_change_lock)         AFLOCK_PRINT("Aflock: lock sudden output change\n");      else         AFLOCK_PRINT("Aflock: unlock sudden output change\n");        Aflock::set_sudden_output_change_lock(_portId,                                             _sudden_output_change_lock);      AFLOCK_PRINT("Aflock: Setting group\n");      Aflock::set_group( _portId );/// Currently not used (we are using point mode)//      AFLOCK_PRINT("Aflock: Setting pickBird\n");//      Aflock::pickBird( _xmitterUnitNumber,_portId );//      AFLOCK_PRINT("Aflock: Setting rep_and_stream\n");//      Aflock::set_rep_and_stream( _portId, _reportRate );      AFLOCK_PRINT("Aflock: ready to go..\n");      // flock is active.      _active = true;      // return success      return 1;    }         else       return 0; // already sampling}// call this repeatedly to request data from the birds// get the data later with flock.sample()// NOTE: flock.isActive() must be true to use this functionint Aflock::prepareSample(){     // can't ask for data when not active.     assert( _active == true );     if (_samplePrepared)        return 1;     // ask for data from master (1)      char getpoint[2];     getpoint[0]=0xF0+1;     getpoint[1]='B';     if (write(_portId, getpoint, 2) == -1) {        fprintf(stderr, "Error sending polling command while reading 6DOF\n");        tcdrain(_portId);        return 0;     }     tcdrain(_portId);     _samplePrepared=true;     return 1;}//: call this repeatedly to update the data from the birds.//  NOTE: flock.isActive() must be true to use this functionint Aflock::sample(){     // can't sample when not active.     assert( _active == true );     if (_samplePrepared==false)        if (prepareSample()!=0)           return 0;     /* get a data record from the Flock */     int numbytes;     int errorcounter=0;     int i=0;     do {        numbytes=read(_portId, _groupbuffer, _grouplength);        if (numbytes<=0)           {           usleep(10);           if (++errorcounter>MAX_READ_ERRORS)              {#ifdef HAVE_AFLOCK_DEBUG              fprintf(stderr,"Aflock: cant get the bytes from getpoint command:");              fprintf(stderr,"Aflock: got %d bytes of %d\n",i,_grouplength);#endif              _samplePrepared=false;              destroyDirt();              return 0;              }           if (numbytes<0)              numbytes=0;           }        } while ((i+=numbytes)<_grouplength);     _samplePrepared=false;     int j=0;     // for [1..n] birds, get their reading:     for (int i=1; i <= getNumberDevices() && i <= MAX_SENSORS; i++)	{        // do not read values from _groupbuffer for Transmitter        if (!deliverData(i))	   continue;	// you can never go above the maximum number of sensors.	assert( j <= MAX_SENSORS );        int begin=NUMBER_OF_BYTES_PER_FLOCK*j;        char* buff=_groupbuffer;        int flock=buff[begin+NUMBER_OF_BYTES_PER_FLOCK-1];        if (flock > MAX_SENSORS)           {           fprintf(stderr,"Aflock: Invalid number of flock data in group: %d\n",                   flock);           return 0;           }        // Position        xPos(flock) = rawToFloat(buff[1+begin],buff[0+begin])   * POSITION_RANGE;        yPos(flock) = rawToFloat(buff[3+begin],buff[2+begin])   * POSITION_RANGE;        zPos(flock) = rawToFloat(buff[5+begin],buff[4+begin])   * POSITION_RANGE;        // Orientation#ifdef USE_AFLOCK_QUATERNION// check        wQuat(flock) = rawToQuat(buff[7+begin],buff[6+begin]);        xQuat(flock) = rawToQuat(buff[9+begin],buff[8+begin]);        yQuat(flock) = rawToQuat(buff[11+begin],buff[10+begin]);        zQuat(flock) = rawToQuat(buff[12+begin],buff[13+begin]);#else          zRot(flock) = rawToFloat(buff[7+begin],buff[6+begin])   * ANGLE_RANGE;        yRot(flock) = rawToFloat(buff[9+begin],buff[8+begin])   * ANGLE_RANGE;        xRot(flock) = rawToFloat(buff[11+begin],buff[10+begin]) * ANGLE_RANGE;#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女高潮久久久| 亚洲欧洲美洲综合色网| 国产伦精品一区二区三区免费| 日韩三级精品电影久久久| 日本精品一级二级| 日本成人在线网站| 国产喷白浆一区二区三区| 91久久精品一区二区三| 国产麻豆精品theporn| 麻豆国产欧美一区二区三区| 一个色在线综合| 亚洲精选免费视频| 中文字幕在线不卡视频| 精品日产卡一卡二卡麻豆| 欧美午夜影院一区| 欧美性受xxxx| 色999日韩国产欧美一区二区| av在线不卡网| 成人黄色大片在线观看| 99在线精品一区二区三区| 国产精品羞羞答答xxdd| 国产激情91久久精品导航 | 久久99九九99精品| 日本美女一区二区三区视频| 日韩成人一级大片| 九九在线精品视频| 国产一区 二区| 国产福利视频一区二区三区| 国产精品一二三四五| 成人午夜伦理影院| 91麻豆123| 欧美精品一二三| 久久蜜桃av一区精品变态类天堂| 久久久午夜电影| 中文字幕国产一区| 亚洲国产精品久久艾草纯爱| 日本午夜一本久久久综合| 日本美女一区二区| 国产乱理伦片在线观看夜一区| 国产99精品国产| 久久精品一级爱片| 国产精品午夜久久| 一区二区三区波多野结衣在线观看| 亚洲综合一区二区| 国产一区二区三区av电影| 亚洲综合一二三区| 捆绑变态av一区二区三区| 韩国成人福利片在线播放| 国产suv精品一区二区6| 91麻豆国产在线观看| 日韩欧美在线网站| 自拍视频在线观看一区二区| 日韩av电影免费观看高清完整版| 国产91精品入口| 欧美日韩另类一区| 亚洲欧美日韩一区| 国产盗摄一区二区| 日韩精品最新网址| 天天影视网天天综合色在线播放| 奇米影视一区二区三区小说| 免费观看日韩av| 欧美性大战久久久久久久| 欧美极品美女视频| 日本欧美久久久久免费播放网| 成人免费视频视频| 国产精品网站在线观看| 亚洲电影激情视频网站| 91免费小视频| 欧美激情一区二区三区在线| 九九久久精品视频| 日韩精品在线一区二区| 欧美韩日一区二区三区四区| 国产精品资源在线看| 日韩欧美一级在线播放| 美女视频免费一区| 欧美mv日韩mv| 成人免费视频免费观看| 欧美国产综合色视频| 99国产精品国产精品毛片| 中文字幕一区二区不卡| 成人午夜又粗又硬又大| 午夜日韩在线观看| 欧美电视剧在线看免费| 国产高清不卡二三区| 中文子幕无线码一区tr| 日本久久一区二区| 男女男精品视频| 国产欧美一二三区| 91久久精品一区二区三区| 日韩av中文字幕一区二区三区| 日韩欧美成人激情| 成人精品鲁一区一区二区| 亚洲国产一区在线观看| 2020国产精品自拍| 92国产精品观看| 日韩精品一区第一页| 国产拍揄自揄精品视频麻豆| 欧美性感一类影片在线播放| 国产福利一区在线| 日产精品久久久久久久性色| 日韩码欧中文字| 久久久精品综合| 7777精品伊人久久久大香线蕉的 | 一区二区三区四区国产精品| 日韩三级精品电影久久久| kk眼镜猥琐国模调教系列一区二区| 一区二区高清视频在线观看| 欧美极品美女视频| 日韩一级片网址| 欧美日韩国产首页| 色哟哟在线观看一区二区三区| 日韩影院免费视频| 午夜不卡在线视频| 亚洲免费观看在线观看| 国产精品国产a级| 欧美国产一区在线| 国产午夜精品一区二区三区视频| 日韩午夜激情电影| 亚洲天堂av一区| 中文字幕精品—区二区四季| 久久久久久久久蜜桃| 欧美电影精品一区二区| 精品美女一区二区| 日韩精品中文字幕一区| 精品噜噜噜噜久久久久久久久试看| 欧美精品乱人伦久久久久久| 欧美日韩国产电影| 日韩欧美一级二级| 国产色产综合产在线视频| 中文字幕不卡三区| 中文字幕欧美一| 综合电影一区二区三区 | 国产成人自拍在线| 国产黄色精品网站| 欧洲国内综合视频| 欧美大片国产精品| 久久久不卡网国产精品一区| 欧美国产视频在线| 亚洲一区二区三区四区在线观看| 亚洲高清久久久| 三级精品在线观看| 国产精品亚洲专一区二区三区| 免费人成在线不卡| 色诱亚洲精品久久久久久| 欧美一卡2卡3卡4卡| 日韩久久一区二区| 久草精品在线观看| www.欧美色图| 91精品国产综合久久福利| 中文字幕免费在线观看视频一区| 亚洲成av人在线观看| 国产成人小视频| 国产精品私人影院| 午夜婷婷国产麻豆精品| 成人av网站免费观看| 欧美电视剧在线观看完整版| 亚洲精品免费看| 国产精品一区二区三区99| 欧美丰满一区二区免费视频| 亚洲免费高清视频在线| 成人精品视频网站| 久久精品亚洲一区二区三区浴池| 亚洲欧美偷拍三级| 成人一区二区三区在线观看| 26uuu国产一区二区三区| 日韩电影免费在线| 9191国产精品| 日韩avvvv在线播放| 91麻豆精品国产91久久久久| 午夜精品久久久| 欧美日韩卡一卡二| 亚洲一区在线看| 99国产精品久久久久久久久久| 中文在线资源观看网站视频免费不卡 | 欧美三片在线视频观看| 亚洲激情六月丁香| 91高清视频免费看| 日本视频一区二区三区| 欧美va亚洲va香蕉在线| 精东粉嫩av免费一区二区三区| 欧美videos大乳护士334| 黄色日韩网站视频| 中文字幕一区日韩精品欧美| 在线免费不卡电影| 日韩激情一区二区| 精品人在线二区三区| av欧美精品.com| 日韩和欧美的一区| 中国色在线观看另类| 欧美人妇做爰xxxⅹ性高电影| 日韩精品三区四区| 欧美激情一区二区三区| 欧美日韩亚洲综合一区二区三区| 激情深爱一区二区| 亚洲黄色片在线观看| 91麻豆精品国产自产在线观看一区 | 亚洲天堂福利av| 91精品国产福利在线观看| 国产不卡一区视频| 午夜a成v人精品|