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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? aflock.cpp

?? FreeWRLduneInputDevice和FreeWRL一起可以讓用戶用帶有6DoF的輸入設備檢索3D VRML/X3D數據。它基于FreeWRL的"/tmp/inpdev"擴展傳感器輸入接口和w
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
/*************** <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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产一区| 99久久精品一区| 久草中文综合在线| 韩国三级中文字幕hd久久精品| 日韩精品欧美精品| 免费看日韩精品| 成人蜜臀av电影| 欧洲精品一区二区三区在线观看| 欧美午夜精品久久久久久孕妇 | 色婷婷综合久久久久中文一区二区| 国产成人精品免费网站| 从欧美一区二区三区| 91电影在线观看| 久久网站热最新地址| 日韩一区在线免费观看| 亚洲成人av资源| 国产激情偷乱视频一区二区三区| 成人丝袜高跟foot| 7777精品伊人久久久大香线蕉经典版下载 | 成人免费毛片a| 在线播放中文字幕一区| 日本一区二区动态图| 天天亚洲美女在线视频| av一区二区不卡| 精品播放一区二区| 美腿丝袜在线亚洲一区| 色婷婷综合五月| 国产精品传媒视频| 国产suv精品一区二区三区| 欧美一级一区二区| 亚洲午夜久久久久久久久电影网| 成人aaaa免费全部观看| 精品国产乱码久久久久久久| 日韩电影一区二区三区| 欧美三级日本三级少妇99| 亚洲欧美另类小说| 91片在线免费观看| 自拍偷拍亚洲激情| 99久久伊人久久99| 亚洲国产精品ⅴa在线观看| 国产一区视频在线看| 2024国产精品| 国产成人三级在线观看| 国产精品污网站| 99riav一区二区三区| 亚洲天堂成人网| 欧美精品第一页| 国产精品91一区二区| 国产精品无圣光一区二区| 99久久精品免费看| 性欧美疯狂xxxxbbbb| 欧美一区二区美女| 国产超碰在线一区| 亚洲毛片av在线| 精品av久久707| 91一区二区在线观看| 一区二区成人在线视频| 日韩小视频在线观看专区| 国产麻豆一精品一av一免费 | 99精品国产一区二区三区不卡| 日韩久久一区二区| 日韩久久久久久| 91黄色免费版| www.性欧美| 精品无人区卡一卡二卡三乱码免费卡| 中文字幕免费在线观看视频一区| 欧美无人高清视频在线观看| 粉嫩蜜臀av国产精品网站| 婷婷成人综合网| 亚洲第一成年网| 亚洲欧美日本在线| 欧美极品aⅴ影院| 久久色.com| 精品国产91洋老外米糕| 欧美精品1区2区| 在线观看日韩精品| av电影一区二区| 99re热视频精品| 波多野结衣的一区二区三区| 国产69精品久久99不卡| 国产精品一区二区三区乱码| 久久99国产精品免费网站| 亚洲国产日韩综合久久精品| 国产亚洲精品超碰| 日韩一区二区在线观看视频 | 色哟哟欧美精品| 国产精品66部| 国产乱码精品一区二区三区av| 亚洲一区二区三区四区在线免费观看 | 亚洲h精品动漫在线观看| 国产精品久久久久aaaa樱花| 久久久久久久国产精品影院| 日韩午夜小视频| 91精品国产麻豆国产自产在线| 欧美日韩一区二区电影| 91碰在线视频| 色偷偷久久一区二区三区| 91九色02白丝porn| 在线观看亚洲成人| 5月丁香婷婷综合| 日本一区二区综合亚洲| 日韩一级视频免费观看在线| 久88久久88久久久| 亚洲国产欧美在线| 欧美一区三区二区| 色综合久久九月婷婷色综合| 成人免费视频国产在线观看| 蜜臀av一区二区在线免费观看| 五月天一区二区| 国产精品1024| 日韩国产一区二| 国产mv日韩mv欧美| 色综合中文字幕| 日韩亚洲电影在线| 自拍偷拍欧美精品| 蜜臀久久久99精品久久久久久| 久久国产精品色| 91免费版pro下载短视频| 日本高清成人免费播放| 一本色道久久综合亚洲精品按摩| 奇米色777欧美一区二区| 国产成人精品免费看| 欧美日韩一二三区| 日韩毛片一二三区| 精品亚洲免费视频| 成人性色生活片| 国产亚洲欧洲997久久综合 | 精品日韩成人av| 亚洲女同ⅹxx女同tv| 国产精品乡下勾搭老头1| 日韩午夜电影av| 日韩国产精品久久久| 色综合久久六月婷婷中文字幕| 久久久国产综合精品女国产盗摄| 亚洲第一av色| 欧美日韩黄色影视| 亚洲激情图片一区| eeuss国产一区二区三区| 久久久久久久久一| 国产精品亚洲午夜一区二区三区| 欧美无砖专区一中文字| 亚洲成人av一区二区| 欧美视频一区在线观看| 亚洲第一狼人社区| 精品视频色一区| 性做久久久久久免费观看| 精品国产乱码久久久久久影片| 免费在线视频一区| 久久五月婷婷丁香社区| 波多野结衣在线aⅴ中文字幕不卡| 在线观看国产精品网站| 日本一区二区动态图| 欧美日韩一级大片网址| 久久国产夜色精品鲁鲁99| 2020国产成人综合网| 国产成人丝袜美腿| 一区二区成人在线观看| 国产日韩欧美麻豆| 91啦中文在线观看| 久久99久久精品| 亚洲一区二区三区爽爽爽爽爽| 欧美一区二区精品在线| 欧美性三三影院| 国产成人av电影在线播放| 亚洲.国产.中文慕字在线| 欧美一级黄色大片| 日本丶国产丶欧美色综合| 午夜精品久久久久久久99水蜜桃| www激情久久| 日韩午夜在线观看视频| 91久久免费观看| 成人av在线影院| 国产精品99久久久久久久vr| 无码av中文一区二区三区桃花岛| 日韩精品在线看片z| 在线精品视频一区二区| 成人高清伦理免费影院在线观看| 麻豆精品在线看| 久久国产精品第一页| 三级久久三级久久久| 亚洲午夜激情网页| 国产精品素人视频| 中文字幕一区二区三区视频| 久久九九久精品国产免费直播| 3751色影院一区二区三区| 欧美午夜精品一区二区蜜桃| 成人教育av在线| 欧美日韩高清一区二区三区| 欧美午夜寂寞影院| 欧美亚洲一区二区在线| 欧美人妖巨大在线| 3d动漫精品啪啪1区2区免费 | 亚洲精品ww久久久久久p站| 亚洲视频一区二区在线观看| 亚洲免费观看高清在线观看| 亚洲一区二区三区精品在线| 激情综合五月婷婷| av不卡免费电影| 欧美精品乱码久久久久久按摩| 69av一区二区三区|