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

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

?? entity.cc

?? 一個機(jī)器人平臺
?? CC
?? 第 1 頁 / 共 3 頁
字號:
}///////////////////////////////////////////////////////////////////////////// Shutdown routinevoid CEntity::Shutdown(){  //PRINT_DEBUG( "entity shutting down" );    // recursively shutdown our children  CHILDLOOP( ch ) ch->Shutdown();  if( m_world->enable_gui )    GuiEntityShutdown( this );    return;}///////////////////////////////////////////////////////////////////////////// Update the entity's representationvoid CEntity::Update( double sim_time ){  //PRINT_DEBUG( "UPDATE" );  // recursively update our children  CHILDLOOP( ch ) ch->Update( sim_time );      GuiEntityUpdate( this );}///////////////////////////////////////////////////////////////////////////// Render the entity into the worldvoid CEntity::Map(double px, double py, double pth){  // get the pose in local coords  this->GlobalToLocal( px, py, pth );  // add our center of rotation offsets  px += origin_x;  py += origin_y;   // convert back to global coords  this->LocalToGlobal( px, py, pth );  this->map_px = px;  this->map_py = py;  this->map_pth = pth;  MapEx(map_px, map_py, map_pth, true);}///////////////////////////////////////////////////////////////////////////// Remove the entity from the worldvoid CEntity::UnMap(){  MapEx(this->map_px, this->map_py, this->map_pth, false);}///////////////////////////////////////////////////////////////////////////// Remap ourself if we have movedvoid CEntity::ReMap(double px, double py, double pth){  // if we haven't moved, do nothing  if (fabs(px - this->map_px) < 1 / m_world->ppm &&      fabs(py - this->map_py) < 1 / m_world->ppm &&      pth == this->map_pth)    return;    // otherwise erase the old render and draw a new one  UnMap();  Map(px, py, pth);}///////////////////////////////////////////////////////////////////////////// Primitive rendering functionvoid CEntity::MapEx(double px, double py, double pth, bool render){  switch (this->shape)    {    case ShapeRect:      m_world->SetRectangle(px, py, pth, 			    this->size_x, this->size_y, this, render);      break;    case ShapeCircle:      m_world->SetCircle(px, py, this->size_x / 2, this, render);      break;    case ShapeNone:      break;    }}///////////////////////////////////////////////////////////////////////////// Check to see if the given pose will yield a collision with obstacles.// Returns a pointer to the first entity we are in collision with, and stores// the location of the hit in hitx,hity// Returns NULL if not collisions.// This function is useful for writing position devices.CEntity *CEntity::TestCollision(double px, double py, double pth){  double qx = px + this->origin_x * cos(pth) - this->origin_y * sin(pth);  double qy = py + this->origin_y * sin(pth) + this->origin_y * cos(pth);  double qth = pth;  double sx = this->size_x;  double sy = this->size_y;  switch( this->shape )   {    case ShapeRect:    {      CRectangleIterator rit( qx, qy, qth, sx, sy, m_world->ppm, m_world->matrix );      CEntity* ent;      while( (ent = rit.GetNextEntity()) )      {        if( ent != this && ent->obstacle_return && !IsDescendent(ent) )	    return ent;      }      return NULL;    }    case ShapeCircle:    {      CCircleIterator rit( px, py, sx / 2, m_world->ppm, m_world->matrix );      CEntity* ent;      while( (ent = rit.GetNextEntity()) )      {        if( ent != this && ent->obstacle_return && !IsDescendent(ent))	    return ent;      }      return NULL;    }  case ShapeNone:    break;  }  return NULL;}///////////////////////////////////////////////////////////////////////////// same as the above method, but stores the hit location in hitx, hityCEntity *CEntity::TestCollision(double px, double py, double pth, 				double &hitx, double &hity ){  double qx = px + this->origin_x * cos(pth) - this->origin_y * sin(pth);  double qy = py + this->origin_y * sin(pth) + this->origin_y * cos(pth);  double qth = pth;  double sx = this->size_x;  double sy = this->size_y;  switch( this->shape )   {    case ShapeRect:    {      CRectangleIterator rit( qx, qy, qth, sx, sy, m_world->ppm, m_world->matrix );      CEntity* ent;      while( (ent = rit.GetNextEntity()) )      {        if( ent != this && ent->obstacle_return && !IsDescendent(ent))        {          rit.GetPos( hitx, hity );          return ent;        }      }      return NULL;    }    case ShapeCircle:    {      CCircleIterator rit( px, py, sx / 2, m_world->ppm, m_world->matrix );      CEntity* ent;      while( (ent = rit.GetNextEntity()) )      {        if( ent != this && ent->obstacle_return && !IsDescendent(ent))        {          rit.GetPos( hitx, hity );          return ent;        }      }      return NULL;    }  case ShapeNone: // handle the null case      break;  }  return NULL;}///////////////////////////////////////////////////////////////////////////// Convert local to global coordsvoid CEntity::LocalToGlobal(double &px, double &py, double &pth){  // Get the pose of our origin wrt global cs  double ox, oy, oth;  GetGlobalPose(ox, oy, oth);  // Compute pose based on the parent's pose  double sx = ox + px * cos(oth) - py * sin(oth);  double sy = oy + px * sin(oth) + py * cos(oth);  double sth = oth + pth;  px = sx;  py = sy;  pth = sth;}///////////////////////////////////////////////////////////////////////////// Convert global to local coords//void CEntity::GlobalToLocal(double &px, double &py, double &pth){  // Get the pose of our origin wrt global cs  double ox, oy, oth;  GetGlobalPose(ox, oy, oth);  // Compute pose based on the parent's pose  double sx =  (px - ox) * cos(oth) + (py - oy) * sin(oth);  double sy = -(px - ox) * sin(oth) + (py - oy) * cos(oth);  double sth = pth - oth;  px = sx;  py = sy;  pth = sth;}///////////////////////////////////////////////////////////////////////////// Set the entitys pose in the parent csvoid CEntity::SetPose(double px, double py, double pth){  // if the new position is different, call SetProperty to make the change.  // the -1 indicates that this change is dirty on all connections    if( this->local_px != px )     SetProperty( -1, PropPoseX, &px, sizeof(px) );    if( this->local_py != py )     SetProperty( -1, PropPoseY, &py, sizeof(py) );    if( this->local_pth != pth )     SetProperty( -1, PropPoseTh, &pth, sizeof(pth) );  }///////////////////////////////////////////////////////////////////////////// Get the entitys pose in the parent csvoid CEntity::GetPose(double &px, double &py, double &pth){  px = this->local_px;  py = this->local_py;  pth = this->local_pth;}///////////////////////////////////////////////////////////////////////////// Set the entitys pose in the global csvoid CEntity::SetGlobalPose(double px, double py, double pth){  // Get the pose of our parent in the global cs  double ox = 0;  double oy = 0;  double oth = 0;    if (m_parent_entity) m_parent_entity->GetGlobalPose(ox, oy, oth);    // Compute our pose in the local cs  double new_x  =  (px - ox) * cos(oth) + (py - oy) * sin(oth);  double new_y  = -(px - ox) * sin(oth) + (py - oy) * cos(oth);  double new_th = pth - oth;    SetPose( new_x, new_y, new_th );}///////////////////////////////////////////////////////////////////////////// Get the entitys pose in the global csvoid CEntity::GetGlobalPose(double &px, double &py, double &pth){  // Get the pose of our parent in the global cs  double ox = 0;  double oy = 0;  double oth = 0;  if (m_parent_entity)    m_parent_entity->GetGlobalPose(ox, oy, oth);      // Compute our pose in the global cs  px = ox + this->local_px * cos(oth) - this->local_py * sin(oth);  py = oy + this->local_px * sin(oth) + this->local_py * cos(oth);  pth = oth + this->local_pth;}////////////////////////////////////////////////////////////////////////////// Set the entitys velocity in the global csvoid CEntity::SetGlobalVel(double vx, double vy, double vth){  this->vx = vx;  this->vy = vy;  this->vth = vth;}////////////////////////////////////////////////////////////////////////////// Get the entitys velocity in the global csvoid CEntity::GetGlobalVel(double &vx, double &vy, double &vth){  vx = this->vx;  vy = this->vy;  vth = this->vth;}////////////////////////////////////////////////////////////////////////////// See if the given entity is one of our descendentsbool CEntity::IsDescendent(CEntity *entity){  while (entity)  {    entity = entity->m_parent_entity;    if (entity == this)      return true;  }  return false;}void CEntity::SetDirty( int con, char v ){  for( int i=0; i< ENTITY_LAST_PROPERTY; i++ )    SetDirty( con, (EntityProperty)i, v );}void CEntity::SetDirty( EntityProperty prop, char v ){  for( int i=0; i<MAX_POSE_CONNECTIONS; i++ )    SetDirty( i, prop, v );};void CEntity::SetDirty( int con, EntityProperty prop, char v ){  m_dirty[con][prop] = v;};void CEntity::SetDirty( char v ){  memset( m_dirty, v, 	  sizeof(char) * MAX_POSE_CONNECTIONS * ENTITY_LAST_PROPERTY );};///////////////////////////////////////////////////////////////////////////// change the parent void CEntity::SetParent(CEntity* new_parent) {   m_parent_entity = new_parent; };int CEntity::SetProperty( int con, EntityProperty property, 			  void* value, size_t len ){  assert( value );  assert( len > 0 );  assert( (int)len < MAX_PROPERTY_DATA_LEN );  bool refresh_figure = false;  bool move_figure = false;    switch( property )  {    case PropParent:      // TODO - fix this      // get a pointer to the (*value)'th entity - that's our new parent      //this->m_parent_entity = m_world->GetEntity( *(int*)value );           break;    case PropSizeX:      memcpy( &size_x, (double*)value, sizeof(size_x) );      // force the device to re-render itself      refresh_figure = true;      break;    case PropSizeY:      memcpy( &size_y, (double*)value, sizeof(size_y) );      // force the device to re-render itself      refresh_figure = true;      break;    case PropPoseX:      memcpy( &local_px, (double*)value, sizeof(local_px) );      move_figure = true;      break;    case PropPoseY:      memcpy( &local_py, (double*)value, sizeof(local_py) );      move_figure = true;      break;    case PropPoseTh:      // normalize theta      local_pth = atan2( sin(*(double*)value), cos(*(double*)value));      //memcpy( &local_pth, (double*)value, sizeof(local_pth) );      move_figure = true;      break;    case PropOriginX:      memcpy( &origin_x, (double*)value, sizeof(origin_x) );      refresh_figure = true;      break;    case PropOriginY:      memcpy( &origin_y, (double*)value, sizeof(origin_y) );      refresh_figure = true;      break;    case PropName:      strcpy( name, (char*)value );      // force the device to re-render itself      refresh_figure = true;      break;    case PropColor:      memcpy( &color, (StageColor*)value, sizeof(color) );      // force the device to re-render itself      refresh_figure = true;      break;    case PropShape:      memcpy( &shape, (StageShape*)value, sizeof(shape) );      // force the device to re-render itself      refresh_figure = true;      break;    case PropLaserReturn:      memcpy( &laser_return, (LaserReturn*)value, sizeof(laser_return) );      break;    case PropIdarReturn:      memcpy( &idar_return, (IDARReturn*)value, sizeof(idar_return) );      break;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品影院在线观看| 亚洲精选视频在线| 国产精一区二区三区| 久久久三级国产网站| 粉嫩aⅴ一区二区三区四区五区| 精品久久久久av影院| 国模套图日韩精品一区二区| 国产精品你懂的在线欣赏| 99久久久国产精品免费蜜臀| 亚洲国产精品一区二区久久| 欧美一区二区成人| 国产麻豆精品在线| 亚洲视频在线一区二区| 欧美日韩精品久久久| 久久精品国产精品青草| 中文字幕成人网| 欧美综合一区二区| 久久99深爱久久99精品| 中文字幕一区二区在线播放| 欧洲人成人精品| 国产一区二区三区黄视频| 亚洲人吸女人奶水| 日韩一区二区高清| 成人18精品视频| 日韩综合小视频| 久久青草欧美一区二区三区| 色乱码一区二区三区88| 人人爽香蕉精品| 一区在线观看免费| 日韩一区二区在线看| 99热99精品| 六月婷婷色综合| 亚洲乱码日产精品bd| 久久综合色之久久综合| 色悠悠亚洲一区二区| 国产一区 二区| 亚洲成av人片一区二区三区| 国产日韩欧美麻豆| 3atv在线一区二区三区| 91麻豆福利精品推荐| 国模套图日韩精品一区二区 | 精品国产麻豆免费人成网站| 99久久99久久精品免费观看| 麻豆高清免费国产一区| 艳妇臀荡乳欲伦亚洲一区| 国产日产亚洲精品系列| 欧美一区二区三区性视频| 色欧美片视频在线观看在线视频| 国产一区啦啦啦在线观看| 亚洲尤物在线视频观看| 欧美国产成人精品| 精品国产第一区二区三区观看体验| 欧美在线不卡视频| 91网页版在线| eeuss鲁一区二区三区| 国产精品69久久久久水密桃| 免费高清在线一区| 五月天网站亚洲| 一区二区三区免费看视频| 亚洲国产精品99久久久久久久久| 日韩精品资源二区在线| 538在线一区二区精品国产| 日本大香伊一区二区三区| 99久久99久久精品免费观看| 国产福利不卡视频| 国产精品一区二区男女羞羞无遮挡 | 国产精品亚洲一区二区三区妖精| 日本vs亚洲vs韩国一区三区| 午夜欧美电影在线观看| 亚洲成人精品一区| 亚洲一二三区在线观看| 亚洲高清在线视频| 亚洲bt欧美bt精品777| 偷拍与自拍一区| 日韩高清在线一区| 老汉av免费一区二区三区 | 精品入口麻豆88视频| 日韩欧美一级特黄在线播放| 欧美一区中文字幕| 日韩精品专区在线影院观看| 精品三级在线看| 国产日韩精品一区二区浪潮av | 亚洲综合网站在线观看| 一级女性全黄久久生活片免费| 亚洲精品五月天| 亚洲成av人片一区二区三区| 日韩福利电影在线| 日本成人中文字幕在线视频| 久久国产精品99精品国产| 国产一区二区三区精品视频| 成人做爰69片免费看网站| 91免费看`日韩一区二区| 欧美日免费三级在线| 91精品久久久久久蜜臀| 久久免费美女视频| 中文字幕综合网| 天天色天天爱天天射综合| 蜜臀av国产精品久久久久| 国产成人啪午夜精品网站男同| 99综合电影在线视频| 欧美性猛交xxxxxx富婆| 日韩欧美123| 中文字幕一区av| 亚洲午夜精品17c| 国内偷窥港台综合视频在线播放| 成人福利视频在线看| 欧美日韩在线播放三区四区| 日韩一区二区视频在线观看| 国产女人18水真多18精品一级做| 亚洲一区二区三区中文字幕| 国产在线播放一区| 一道本成人在线| 2欧美一区二区三区在线观看视频| 亚洲欧美中日韩| 秋霞电影网一区二区| aaa欧美大片| 精品国产电影一区二区| 亚洲乱码日产精品bd| 激情五月婷婷综合网| 在线这里只有精品| 国产亚洲一区二区三区| 亚洲成人激情综合网| 成人精品一区二区三区四区| 欧美一区三区四区| 国产精品久久久久四虎| 日本最新不卡在线| 91福利在线观看| 久久精品在线免费观看| 五月天久久比比资源色| 99在线精品免费| 久久免费看少妇高潮| 日韩精品一卡二卡三卡四卡无卡| 91原创在线视频| 久久精品日韩一区二区三区| 日韩高清在线不卡| 欧美在线观看视频一区二区| 中文字幕免费观看一区| 黄一区二区三区| 欧美老肥妇做.爰bbww视频| 国产精品成人一区二区艾草| 韩国精品一区二区| 欧美一卡2卡3卡4卡| 亚洲国产你懂的| 色综合久久88色综合天天 | www.亚洲精品| 国产亚洲人成网站| 精品亚洲国内自在自线福利| 这里是久久伊人| 午夜精品一区二区三区三上悠亚| 色婷婷综合中文久久一本| 日韩一区欧美一区| 国产激情91久久精品导航| 日韩一区二区在线看| 丝瓜av网站精品一区二区| 91福利精品视频| 亚洲精品欧美专区| 在线观看一区日韩| 一区二区三区成人| 日本高清成人免费播放| 亚洲美女一区二区三区| 日本乱人伦aⅴ精品| 亚洲欧美日韩精品久久久久| 色综合天天视频在线观看| 亚洲与欧洲av电影| 欧美午夜精品电影| 偷窥少妇高潮呻吟av久久免费| 欧美丰满少妇xxxbbb| 日韩精品一级二级| 精品三级av在线| 国产精品一区二区不卡| 中文字幕乱码久久午夜不卡| 成人国产电影网| 一区二区欧美精品| 5566中文字幕一区二区电影| 美女精品自拍一二三四| 久久午夜色播影院免费高清| 国产乱妇无码大片在线观看| 欧美国产精品v| 色婷婷综合中文久久一本| 亚洲成人av福利| 欧美大片顶级少妇| 从欧美一区二区三区| 亚洲欧美另类久久久精品2019| 欧美三级日本三级少妇99| 喷白浆一区二区| 中文字幕乱码日本亚洲一区二区 | 色婷婷国产精品| 婷婷综合久久一区二区三区| 久久亚洲一级片| 91免费国产视频网站| 亚洲大片免费看| 337p粉嫩大胆色噜噜噜噜亚洲| www.亚洲精品| 日韩成人午夜精品| 久久精品一区二区三区不卡| 99久久免费视频.com| 日韩福利电影在线观看| 国产女人18毛片水真多成人如厕| 欧美午夜不卡在线观看免费| 精久久久久久久久久久|