您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ updatePos函数代码示例

51自学网 2021-06-03 09:14:13
  C++
这篇教程C++ updatePos函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中updatePos函数的典型用法代码示例。如果您正苦于以下问题:C++ updatePos函数的具体用法?C++ updatePos怎么用?C++ updatePos使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了updatePos函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: updatePos

void Display::update(){    for(auto &iter : tileChanges_)    {        m_map[iter.first]=iter.second;        /*if(isSeen_[iter.first]==true) no vision yet        {            mapSeen_[iter.first]=iter.second;            updatePos(iter.first);        }*/        updatePos(iter.first);    }    tileChanges_.clear();	for (auto &iter : m_map)	{		iter.second.update();	}    if(reloadAll_)    {        for(auto &iter : m_map)        {            updatePos(iter.first);            reloadAll_=false;        }    }}
开发者ID:ZestyTheWalrus,项目名称:Mine-Mania,代码行数:27,


示例2: qfu

bool EPGItem::setData( const vlc_epg_event_t *data ){    QDateTime newtime = QDateTime::fromTime_t( data->i_start );    QString newname = qfu( data->psz_name );    QString newdesc = qfu( data->psz_description );    QString newshortdesc = qfu( data->psz_short_description );    if ( m_start != newtime ||         m_name != newname ||         m_description != newdesc ||         m_shortDescription != newshortdesc ||         m_duration != data->i_duration )    {        m_start = newtime;        m_name = newname;        setToolTip( newname );        m_description = newdesc;        m_shortDescription = newshortdesc;        setDuration( data->i_duration );        setRating( data->i_rating );        m_descitems.clear();        for( int i=0; i<data->i_description_items; i++ )        {            m_descitems.append(QPair<QString, QString>(                                  QString(data->description_items[i].psz_key),                                  QString(data->description_items[i].psz_value)));        }        updatePos();        prepareGeometryChange();        return true;    }    return false;}
开发者ID:IAPark,项目名称:vlc,代码行数:33,


示例3: prepareGeometryChange

void ConnectorLine::sSetP2( QPoint point ){   prepareGeometryChange();   m_p2X = point.x();   m_p2Y = point.y();   updatePos();}
开发者ID:jdpillon,项目名称:simulide,代码行数:7,


示例4: setAspectRatioMode

void IGraphicsItem::restoreDefaultSize(){    setAspectRatioMode(Qt::KeepAspectRatio);    setSize(nativeSize());    update();    updatePos();}
开发者ID:keyanmca,项目名称:DesktopLiveManager,代码行数:7,


示例5: if

void IGraphicsItem::onWheelEvent(QGraphicsSceneWheelEvent *event){    if(!item_->isSelected()) return;    int d = event->delta();    int w_delta;    if(d >= 120) {        w_delta = 10;    } else if(d <= -120) {        w_delta = -10;    } else {        return;    }    QSize s = size();    int w, h;    if(aspectRatioMode() == Qt::KeepAspectRatio) {        QSize n = nativeSize();        w = s.width() + w_delta;        h = (w * n.height() + n.width()/2)/ n.width();    } else {        w = s.width() + w_delta;        h = (w * s.height() + s.width()/2)/ s.width();    }    setSize(QSize(w, h));    update();    updatePos();    setGrabbersPosition(item_->boundingRect());}
开发者ID:keyanmca,项目名称:DesktopLiveManager,代码行数:30,


示例6: updatePos

void updatePos(Node &node){	//std::cout << "call";	int xRes,yRes;	Directions dir = node.dir;	if(node.next != nullptr){		updatePos(*node.next);	}else{		xRes = node.x;		yRes = node.y;	}	switch(dir){	case UP:		node.y += 1;		break;	case DOWN:		node.y -= 1;		break;	case LEFT:		node.x -= 1;		break;	case RIGHT:		node.x += 1;		break;	}}
开发者ID:15kingben,项目名称:ChallengeProject,代码行数:25,


示例7: updatePos

void Character::update(){	// if close to target, snap to it and stop moving	if (m_move && fabs(m_angle - m_tAngle) <= fabs(m_speed))	{		m_angle = m_tAngle;		m_move = false;		updatePos();	}	else if (m_move)	{		m_angle += m_speed;		resetAngle();		updatePos();	}}
开发者ID:gdxn96,项目名称:swarm-wars,代码行数:16,


示例8: updatePos

/*	updates values needed from driver, pathfinder, etc. the are stored here, that we don't need to compute	them several times or pass tons of parameters.*/void MyCar::update(TrackDesc* track, tCarElt* car, tSituation *situation){	updatePos();	updateDir();	updateSpeedSqr();	updateSpeed();	/* update currentsegment and destination segment id's */	int searchrange = MAX((int) ceil(situation->deltaTime*speed+1.0) * 2, 4);	currentsegid = destsegid = pf->getCurrentSegment(car, searchrange);	double l = 0.0;	while (l < 2.0 * wheelbase) {		l = l + pf->getPathSeg(destsegid)->getLength();		destsegid = (destsegid + 1 + pf->getnPathSeg()) % pf->getnPathSeg();	}	currentseg = track->getSegmentPtr(currentsegid);	destseg = track->getSegmentPtr(destsegid);	currentpathseg = pf->getPathSeg(currentsegid);	updateDError();	int lookahead = (destsegid + (int) (MIN(LOOKAHEAD_MAX_ERROR,derror)*speed*LOOKAHEAD_FACTOR)) % pf->getnPathSeg();	destpathseg = pf->getPathSeg(lookahead);	mass = carmass + car->priv.fuel;	trtime += situation->deltaTime;	deltapitch = MAX(-track->getSegmentPtr(currentsegid)->getKgamma() - me->_pitch, 0.0);}
开发者ID:chagge,项目名称:gym_torcs,代码行数:32,


示例9: updatePos

nsUISpacer* nsUISpacer::setup(){	p_lt_local=p_lt;	p_lt_local.x+=space;	updatePos(stroke_width);	generateDraw();	return this;}
开发者ID:YosukeSawano,项目名称:nsUI_dev2,代码行数:7,


示例10: updatePos

void GanttWidget::collapsed(const QModelIndex &index){    GanttInfoNode * node = m_model->nodeForIndex(index);    node->setIsExpanded(false);    return updatePos(node);}
开发者ID:AstyCo,项目名称:mypro3,代码行数:7,


示例11: updatePos

bool CEnemy::update(float time_elapsed_ms,CNode * nodes){	if(!isDead())	{		//update position		updatePos(time_elapsed_ms);		//if at each waypoint		if(DistanceCheck())		{			setCurrNode(&nodes[getNodeIndex()+1]);			setNodeIndex(getNodeIndex()+1);			//special check for end waypoint			//if at the end waypoint			if(getNodeIndex() == ENDNODE)			{				if(!isDead())				{					setDead(true);				}				return true;				//life minuses here				//reset mob				//change to wavemanager later			//	enemyArray[i].spawn(currType,currLevel);			//	enemyArray[i].setNodeIndex(0);			//	enemyArray[i].setPos(NodeArray[0].getPos());			}		}	}	return false;}
开发者ID:fordoom,项目名称:Game_Engine_Assignment,代码行数:31,


示例12: updatePos

void DutyUnit::resetCounters(const unsigned long oldCc) {	if (nextPosUpdate == COUNTER_DISABLED)		return;		updatePos(oldCc);	nextPosUpdate -= COUNTER_MAX;	SoundUnit::resetCounters(oldCc);}
开发者ID:BlueSplash,项目名称:gba4ios,代码行数:8,


示例13: getLine

/*-----------------------------------------------------------------------------name        : finddescription : find integer and decimal tokens, keep track of line and columnparameters  : ofstream& in, char* text, int tokenreturn      : /exceptions  : /algorithm   : trivial-----------------------------------------------------------------------------*/void ConstantsFinder::find( ofstream& out, char* lexText, int lexToken ){  string lexStr;  lexStr += lexText;  if( ( lexToken == integer ) || ( lexToken == decimal ) ){    out << "constant: '" << lexStr << "' at line " << getLine() << ", col " << getCol() << endl;  }  updatePos( lexStr );}
开发者ID:w-A-L-L-e,项目名称:precompiler,代码行数:16,


示例14: updatePos

void DutyUnit::resetCounters(unsigned long const oldCc) {	if (nextPosUpdate_ == counter_disabled)		return;	updatePos(oldCc);	nextPosUpdate_ -= counter_max;	setCounter();}
开发者ID:CharlexH,项目名称:Provenance,代码行数:8,


示例15: fontMetrics

void BubbleChatBox::setText(const QString &text){    chatLabel->setHtml(text);    QString plainText = chatLabel->toPlainText();    if (plainText.isEmpty()) {        return;    }    QFontMetrics fontMetrics(chatLabel->font());    int imageCount = text.count("</img>");    int width = qAbs(fontMetrics.width(plainText)) + imageCount * ChatFaceWidth;    int lineCount = 1;    if (width > PixelsPerLine) {        lineCount = width / PixelsPerLine;        if (lineCount >= MaxLineCount) {            lineCount = MaxLineCount;        } else if (width % PixelsPerLine != 0) {            ++lineCount;        }        width = PixelsPerLine;    }    int boxWidth = width + fontMetrics.maxWidth();    if (boxWidth <= BoxMinWidth) {        boxWidth = BoxMinWidth;        chatLabel->setAlignment(Qt::AlignHCenter);    } else {        chatLabel->setAlignment(Qt::AlignLeft);    }    chatLabel->setTextWidth(boxWidth);    QRectF oldRect = rect;    int height = fontMetrics.lineSpacing() + fontMetrics.xHeight();    rect.setSize(QSize(boxWidth + BoxRightFrameWidth, height * lineCount + BoxFrameHeight));    chatLabel->setPos(QPointF(BoxLeftFrameWidth,        rect.center().y() - (height * lineCount) + (lineCount - 1) * (height / 2) - (imageCount > 0 ? 1 : 0)));    chatLabel->setBoundingRect(QRectF(0, 0, boxWidth, height * lineCount + (MaxLineCount - lineCount) * 1));    updatePos();    if (opacity() != 1) {        appearAndDisappear->setDirection(QAbstractAnimation::Forward);        appearAndDisappear->start();    }    if (oldRect.width() > rect.width()) {        QRectF sceneRect = mapRectToScene(oldRect);        scene()->update(sceneRect);    } else {        update();    }    timer.start(Config.BubbleChatBoxKeepSeconds * 1000 - AnimationDuration);}
开发者ID:SwordElucidator,项目名称:QSanguosha-For-Saimoe,代码行数:58,


示例16: updatePos

bool User::teleport(double x, double y, double z){  buffer << (sint8)PACKET_PLAYER_POSITION_AND_LOOK << x << y << (double)0.0 << z     << (float)0.f << (float)0.f << (sint8)0;  //Also update pos for other players  updatePos(x, y, z, 0);  return true;}
开发者ID:swallen,项目名称:mineserver,代码行数:9,


示例17: updatePos

void BWCombatLayer::update(float dt){    _fCombatTime += dt;    updatePos(dt);    BWUnitManager::shareBWUnitManager()->update(dt);    updateBg(dt);        updateCreateNpc(dt);}
开发者ID:bingwan,项目名称:PlaneClasses,代码行数:9,


示例18: updatePos

bool QTrackerDirectSyncResult::next(){    if (!cursor) {        // The cursor may have been unreferenced because the connection was deleted        // and now the user is calling next(), so set the row here        updatePos(QSparql::AfterLastRow);        return false;    }    GError * error = 0;    const gboolean active = tracker_sparql_cursor_next(cursor, 0, &error);    // if this is an ask query, get the result    if (isBool() && active && tracker_sparql_cursor_get_value_type(cursor, 0) == TRACKER_SPARQL_VALUE_TYPE_BOOLEAN) {        const gboolean value = tracker_sparql_cursor_get_boolean(cursor, 0);        setBoolValue(value != FALSE);    }    if (error) {        setLastError(QSparqlError(QString::fromUtf8(error->message),                       errorCodeToType(error->code),                       error->code));        g_error_free(error);        qWarning() << "QTrackerDirectSyncResult:" << lastError() << query();        g_object_unref(cursor);        cursor = 0;        return false;    }    if (!active) {        g_object_unref(cursor);        cursor = 0;        updatePos(QSparql::AfterLastRow);        return false;    }    const int oldPos = pos();    if (oldPos == QSparql::BeforeFirstRow)        updatePos(0);    else        updatePos(oldPos + 1);    return true;}
开发者ID:matthewvogt,项目名称:libqtsparql,代码行数:42,


示例19: updatePos

// *********************************************************************************************************void CDisplayerVisual::onPreActChanged(){	//H_AUTO(R2_CDisplayerVisual_onPreActChanged)	updatePos();	if (!isActiveInCurrentAct())	{		if (getActive())		{			setActive(false);		}	}}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:13,


示例20: updatePos

// Updates Text status (such as position)void WinnerText::update(){	// Update text position	updatePos();	// Update text color	updateColor();	// Recalculate verts if needed	if (dirty)		recalcVerts();}
开发者ID:Reikooters,项目名称:PongGameAndroid,代码行数:13,


示例21: height

    void TransparentScrollBarH::onResize(QResizeEvent* _e)    {        const auto x = Utils::scale_value(L::backgroundUpMargin_dip);        const auto y = _e->size().height() - height() - Utils::scale_value(L::backgroundRightMargin_dip);        const auto h = height();        const auto w = _e->size().width() - 2* Utils::scale_value(L::backgroundDownMargin_dip);        move(x, y);        resize(w, h);        updatePos();    }
开发者ID:mailru,项目名称:icqdesktop,代码行数:12,


示例22: setCarPtr

void OtherCar::init(TrackDesc* itrack, tCarElt* car, tSituation *situation){	track = itrack;	dt = situation->deltaTime;	setCarPtr(car);	currentsegid = track->getCurrentSegment(car);	initCGh();	updatePos();	updateDir();	updateSpeedSqr();	updateSpeed();}
开发者ID:chagge,项目名称:gym_torcs,代码行数:13,


示例23: isBoxHere

// 攻击状态 与 抢夺箱子状态要分离// 控制敌方的位置void Enemy::updateEnemyPos(float delta){	//AttackState::getInstance()->Execute(this);	auto isBox = isBoxHere();	if (!isBox) {		updateAvoidDrop();		updatePos();	}	else {		updateCloseToBox();	}}
开发者ID:dsdfc,项目名称:BulletFight,代码行数:16,


示例24: update

void CTimeOSD::update(int position, int duration){	if(!visible)		return;	int percent = 0;	if(duration > 100)		percent = (unsigned char) (position / (duration / 100));	if(m_mode == CTimeOSD::MODE_ASC)		update(position /* / 1000*/);	else		update((duration - position)/* / 1000 */);	updatePos(percent);}
开发者ID:FFTEAM,项目名称:evolux-spark-sh4,代码行数:14,


示例25: updatePos

void SeekSlider::processReleasedButton(){    if ( !isSliding && !isJumping ) return;    isSliding = false;    bool b_seekPending = seekLimitTimer->isActive();    seekLimitTimer->stop(); /* We're not sliding anymore: only last seek on release */    if ( isJumping )    {        isJumping = false;        return;    }    if( b_seekPending && isEnabled() )        updatePos();}
开发者ID:AsamQi,项目名称:vlc,代码行数:14,


示例26: updatePos

void Enemy::update(){	if (!m_atTargetNode)	{		updatePos();		//When close, jump to next node		if (fabs(length(m_pos - m_targetNode)) <= m_speed)		{			m_pos = m_targetNode;			m_atTargetNode = true;		}	}}
开发者ID:gdxn96,项目名称:swarm-wars,代码行数:14,


示例27: setMaskBits

void Item::processTick(const Move* move){   Parent::processTick(move);   //   if (mCollisionObject && !--mCollisionTimeout)      mCollisionObject = 0;   // Warp to catch up to server   if (delta.warpTicks > 0)   {      delta.warpTicks--;      // Set new pos.      MatrixF mat = mObjToWorld;      mat.getColumn(3,&delta.pos);      delta.pos += delta.warpOffset;      mat.setColumn(3,delta.pos);      Parent::setTransform(mat);      // Backstepping      delta.posVec.x = -delta.warpOffset.x;      delta.posVec.y = -delta.warpOffset.y;      delta.posVec.z = -delta.warpOffset.z;   }   else   {      if (isServerObject() && mAtRest && (mStatic == false && mDataBlock->sticky == false))      {         if (++mAtRestCounter > csmAtRestTimer)         {            mAtRest = false;            mAtRestCounter = 0;            setMaskBits(PositionMask);         }      }      if (!mStatic && !mAtRest && isHidden() == false)      {         updateVelocity(TickSec);         updateWorkingCollisionSet(isGhost() ? sClientCollisionMask : sServerCollisionMask, TickSec);         updatePos(isGhost() ? sClientCollisionMask : sServerCollisionMask, TickSec);      }      else      {         // Need to clear out last updatePos or warp interpolation         delta.posVec.set(0,0,0);      }   }}
开发者ID:Bloodknight,项目名称:GMK,代码行数:50,



注:本文中的updatePos函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ updatePositions函数代码示例
C++ updatePlot函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。