• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetPos函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Action

bool Shot_net::Action(Game_Manager* gm_)
{
	if(valid)
	{
		if(gm_)
		{
			for(list<Unit*>::iterator it = gm_->unit_list.begin();it != gm_->unit_list.end();it++)
			{
				if((*it)->isLive() && !(*it)->isNonTarget()  && (*it)->GetTeam() != GetTeam() && (*it)->isCollution())
				{
					if((*it)->collution(GetPos(), 5.0f))
					{
						(*it)->SetNet(net_time);
						(*it)->StateApply("그물",net_time);
						valid = false;
					}
				}
			}
		}


		if(collution(3))
		{
			valid = false;
		}
		else
			Move();


		distance -= const_speed;
		if(distance<0)
			valid = false;
	}


	if(!valid)
	{
		return true;
	}
	return false;
}
开发者ID:seobyeongky,项目名称:gunscape,代码行数:41,代码来源:shot_net.cpp


示例2: GetAngleToTarget

float Bazooka::Shot(Game_Manager* gm_, Unit* User_, int team_, const coord_def& start_, const coord_def& pos_, float focus_)
{
	float angle_ = GetAngleToTarget(start_, pos_);
	if(UseBullet(1))
	{
		for(int i = 0;i<bunch;i++)
		{
			float focus2_ = rand_float(-focus_, focus_, "Bazooka::Shot focus");
			float speed2_ = shot_speed*GetShotSpeedApply();
			float damage_ =  damage*GetDamegeApply()*(User_?User_->GetAtkApply():1.0f);
			gm_->shot_list.push_back(new Shot_missile(&tex_missile, User_, damage_, GetPower(), GetMaxPower(), range, team_, start_, angle_+focus2_, speed2_, guided_range, guided_power, GetDistance()));
		}
		if (gm_->isPlayerCanHear(GetPos()))
		{
			PlaySE(se_rocket, false);
		}
		gm_->Noise(team_,start_,GetNoise() * User_->GetSilencer());
		return burst_speed*(1.0f/(GetBurstSpeedApply()*(User_?User_->GetAtkSpdApply():1.0f)));
	}
	return -1;
}
开发者ID:seobyeongky,项目名称:gunscape,代码行数:21,代码来源:bazooka.cpp


示例3: menu_DrawQuad

void TopMenuItem::Render(const Camera& curCamera)
{
	menu_DrawQuad(0.f, 0.f, m_w, m_h, 1.f);
	float x =  kHSpace; 
	float y = m_h - kVSpace;

	for(int i = 0, c = GetChildren().size(); i < c; ++i)	
	{
		auto child = GetChildren()[i];
		float titlew,titleh;
		child->GetTitleDims(titlew, titleh);
		const Color* col = (GetPos() == i) ? &kTextSelColor : &kTextColor;
		if(child->HasFlag(MENUSTATE_Active)) col = &kTextActiveColor;
		child->DrawTitle(x, y, *col);
		x += 2.f * kHSpace + titlew;
	}

	for(auto child: GetChildren())
		if(child->HasFlag(MENUSTATE_Active))
			child->Render(curCamera);
}
开发者ID:RhineW,项目名称:hypertexture,代码行数:21,代码来源:menu.cpp


示例4: GetPos

bool FuelCell::Load(File*)
{
  Vec3f p = GetPos();
  float s = 5.0f; // TODO CONFIG

  m_aabb.Set(p.x - s, p.x + s, p.y - s, p.y + s, p.z - s, p.z + s); 
  FuelNode* sm = new FuelNode;
  sm->SetAABB(m_aabb);

  SetSceneNode(sm);

  Billboard* bb = new Billboard;
  Texture* tex = (Texture*)TheResourceManager::Instance()->GetRes("flare.png");
  bb->SetTexture(tex);
  bb->SetSize(30.0f); // TODO CONFIG
  bb->SetAABB(m_aabb);

  sm->AddChild(bb);

  return true;
}
开发者ID:jason-amju,项目名称:amjulib,代码行数:21,代码来源:FuelCell.cpp


示例5: GetPos

GoalMapTarget::~GoalMapTarget()
{

	sint32 index;

	if (what_goal != GOAL_TYPE_WANDER)
		{

			GetPos(*m_pos);
			m_ai->m_planner->the_strategic_map->
				SetAreaGoal(*m_pos, what_goal, NULL);
		}
	else
		{

			index = m_ai->m_wanderGoalTargets->Find(this);
			Assert(index >= 0);
			if (index >= 0)
				m_ai->m_wanderGoalTargets->DelIndexFlat(index);
		}
}
开发者ID:jleclanche,项目名称:darkdust-ctp2,代码行数:21,代码来源:GoalMapTarget.cpp


示例6: GetPos

bool COggFile::Sync(HANDLE hBreak)
{
	__int64 start = GetPos();

	DWORD dw;
	for(__int64 i = 0, j = hBreak ? GetLength() - start : 65536;
		i < j && S_OK == ByteRead((BYTE*)&dw, sizeof(dw)) 
			&& ((i&0xffff) || !hBreak || WaitForSingleObject(hBreak, 0) != WAIT_OBJECT_0); 
		i++, Seek(start + i))
	{
		if(dw == 'SggO')
		{
			Seek(start + i);
			return(true);
		}
	}

	Seek(start);

	return(false);
}
开发者ID:Strongc,项目名称:playasa,代码行数:21,代码来源:OggFile.cpp


示例7: GetVe1SceneGraph

void Player::OnLocationEntry()
{
  Ve1ObjectChar::OnLocationEntry();

  SceneNode* root = GetVe1SceneGraph()->GetRootNode(SceneGraph::AMJU_OPAQUE);
  if (root)
  {
    root->AddChild(m_arrow.GetPtr());
    SetArrowVis(false);
  }

  m_nameTag = new PlayerNameNode(this);
  if (m_sceneNode)
  {
    if (m_nameTag)
    {
      m_sceneNode->AddChild(m_nameTag.GetPtr());
    }

    if (m_effect)
    {
      m_sceneNode->AddChild(m_effect.GetPtr());
    }
  }

  // TODO Portal should have a heading which you should face when you appear at the destination
  m_isMoving = false; 
  SetVel(Vec3f(0, 0, 0)); // TODO walk out of doorway ?

  // TODO Set m_newPos ??

  // Set appearance
  SetLoggedIn(IsLoggedIn());

  // If we are carrying something, change its location too
  if (m_carrying)
  {
    TheObjectUpdater::Instance()->SendChangeLocationReq(m_carrying->GetId(), GetPos(), GetLocation()); 
  }
}
开发者ID:jason-amju,项目名称:amjulib,代码行数:40,代码来源:Player.cpp


示例8: AfxGetCurrentSettings

void CVolumeCtrl::IncreaseVolume()
{
	AppSettings& s = AfxGetCurrentSettings();
	if(GetPos() > 99 && !s.fAudioNormalize){
		SetPosInternal(GetPos() + 1);
		/*
		DWORD plVolume;
				int WaveOutVol = 100;
		// 		if(MMSYSERR_NOERROR == waveOutGetVolume(0, (DWORD*)plVolume) ){
		// 			WaveOutVol = (HIWORD(plVolume) + LOWORD(plVolume)) * 100 / 2 / 0xFFFF;
		// 		}
				if( WaveOutVol > 90){
					int iBVol = (int)(50.0f*log10(s.AudioBoost));
					iBVol = min(iBVol + 8, 100);
					s.AudioBoost = pow(10.0f, (float)iBVol/50);
					if( s.AudioBoost > 100)
						s.AudioBoost = 100;
				}else{
					//increaseWaveOut
					
					//plVolume = (min( (HIWORD(plVolume) + 0x0FFF), 0xFFFF) << 16) |  min( (LOWORD(plVolume) + 0x0FFF), 0xFFFF) ;
					//waveOutSetVolume(0, plVolume);
					
				}*/
		
	}else{
		if (GetPos() > 95 ){
			SetPosInternal(100);
		}else if (GetPos() > 25 ){
			SetPosInternal(GetPos() + GetPageSize());
		}else if (GetPos() > 15 ){
			SetPosInternal(GetPos() + 3);
		}else{
			SetPosInternal(GetPos() + 1);
		}
	}
}
开发者ID:Strongc,项目名称:playasa,代码行数:37,代码来源:VolumeCtrl.cpp


示例9: DrawGraphInCamera

void UnitBase::DrawUnit( bool is_walk , bool is_attack)
{
    DrawGraphInCamera( 
    	Vector2(
    		( GetPos().x - mImageSize.x / 2 ),
			( GetPos().y - GetHeight() - mImageSize.y )
		),
		mImageSize,
		mAnimIndex + (is_walk ? 2 : 0) + (is_attack ? 4 : 0),
		mImageType,
		TRUE,
		( mDir.x < 0.0f ) );

	//HP
    DrawBox(
    	static_cast<int>( mPos.x + gCamera2D().GetDrawOffset().x - 25),
    	static_cast<int>( mPos.y + gCamera2D().GetDrawOffset().y ),
    	static_cast<int>( mPos.x + gCamera2D().GetDrawOffset().x + 25 ),
    	static_cast<int>( mPos.y + gCamera2D().GetDrawOffset().y + 4 ),
    	GetColor(255,0,0) , TRUE);
    DrawBox(
    	static_cast<int>( mPos.x + gCamera2D().GetDrawOffset().x - 25),
    	static_cast<int>( mPos.y + gCamera2D().GetDrawOffset().y ),
    	static_cast<int>( mPos.x + gCamera2D().GetDrawOffset().x - 25 + (50 * mHP / mHPMax) ),
    	static_cast<int>( mPos.y + gCamera2D().GetDrawOffset().y + 4 ),
    	GetColor(0,255,0) , TRUE);

	if( IsVisibleCollision() ){
		// コリジョン
		DrawBox(
			static_cast<int>( GetPos().x - GetSize().x / 2 + gCamera2D().GetDrawOffset().x ),
			static_cast<int>( GetPos().y - GetSize().y / 2 + gCamera2D().GetDrawOffset().y ),
			static_cast<int>( GetPos().x + GetSize().x / 2 + gCamera2D().GetDrawOffset().x ),
			static_cast<int>( GetPos().y + GetSize().y / 2 + gCamera2D().GetDrawOffset().y ),
			ColorOf(255,0,0),
			FALSE
		);
	}
	
	if( IsDamaged() ){
		SetFontSize(32);
	    DrawFormatString(
	    	static_cast<int>( mPos.x + gCamera2D().GetDrawOffset().x + 32),
	    	static_cast<int>( mPos.y + gCamera2D().GetDrawOffset().y + ( - 150 + mDamageFrame  ) / 2 ),
	    	GetColor(255,255,0) , "%d", mDamage );
	}
}
开发者ID:weimingtom,项目名称:betasystem,代码行数:47,代码来源:UnitBase.cpp


示例10: GetSize

void MY_UI::Controls::Resizable::Resizing(cWidgetBase* widget){
	unsigned int t = widget->GetId();	
	Utilities::Point size = GetSize();
	Utilities::Point pos = GetPos();

	int deltax = New_MousePosx - Old_MousePosx;
	int deltay = New_MousePosy - Old_MousePosy;
	switch(t){	
	case(Utilities::Tr_to_Bl):// this is top right to bottom left
		if(widget == Internal_Resizable.BottomLeft){// this means the bottom control is being draggged!!!
			SetPos(pos.x+ deltax, pos.y);
			SetSize(size.x - deltax, size.y + deltay);
		} else {
			SetPos(pos.x, pos.y + deltay);
			SetSize(size.x + deltax, size.y - deltay);// otherwise, its the top right .. which doesnt need a new pos
		}
		break;		
	case(Utilities::U_to_D):// this is top to bottom 
		if(widget == Internal_Resizable.Top){// this means the top control is being draggged!!!
			SetPos(pos.x, pos.y + deltay);
			SetSize(size.x, size.y - deltay);
		} else SetSize(size.x, size.y + deltay);// otherwise, its the bottom .. which doesnt need a new pos
			
		break;	
	case(Utilities::Tl_to_Br):// this is top left to bottom right
		if(widget == Internal_Resizable.TopLeft){// this means the top left control is being draggged!!!
			SetPos(pos.x + deltax, pos.y + deltay);
			SetSize(size.x - deltax, size.y - deltay);
		} else SetSize(size.x + deltax, size.y + deltay);// otherwise, its the bottom right.. which doesnt need a new pos
			
		break;
	case(Utilities::L_to_R):// this is left to right
		if(widget == Internal_Resizable.Left){// this means the left control is being draggged!!!
			SetPos(pos.x + deltax, pos.y);
			SetSize(size.x - deltax, size.y);
		} else SetSize(size.x + deltax, size.y);// otherwise, its the bottom .. which doesnt need a new pos
		break;
	};
}
开发者ID:LazyNarwhal,项目名称:Destination_Toolkit,代码行数:39,代码来源:Resizeable.cpp


示例11: GetPos

void g2Controller::GetGlobalPos(int* x, int* y)
{
    // Get this controller's global position
    // Which is the summation of all parent offsets
    int gX, gY, tX, tY; // Global, temp holders
    GetPos(&gX, &gY);
    
    g2Controller* Parent = GetParent();
    while(Parent != NULL)
    {
        Parent->GetPos(&tX, &tY);
        gX += tX;
        gY += tY;
        Parent = Parent->GetParent();
    }
    
    // Post results
    if(x != NULL)
        *x = gX;
    if(y != NULL)
        *y = gY;
}
开发者ID:superzanti,项目名称:Jackalope_TLE_SIM,代码行数:22,代码来源:g2Controller.cpp


示例12: Pos

void CLED::OnDraw(const SRect &rUpdate)
{
	if( !IsVisible() )
		return;


	tfloat fDrawSize = (miCurrent - miMin) / (float)(miMax - miMin);
	
	int iPixelsToDraw = (int)(GetSize().iCY * fDrawSize);

	// Possion to draw from
	SPos Pos(GetPos() + SPos(0, GetSize().iCY - iPixelsToDraw));

	// Size to draw
	SSize Size(GetSize().iCX, iPixelsToDraw);

	// Set rect to draw
	SRect Rect(Pos, Size);

	// Draw
	mpPrimitives->DrawRect(rUpdate, Rect, mColor);
}
开发者ID:eriser,项目名称:koblo_software-1,代码行数:22,代码来源:CLED.cpp


示例13: Melee

bool Monster::Melee(Game_Manager* gm_)
{
	if(!GetDamage())
		return false;
	bool ok_ = false;
	if(GetStop())
		return false;
	for(list<Unit*>::iterator it = gm_->unit_list.begin();it != gm_->unit_list.end();it++)
	{
		if((*it)->isLive() && !(*it)->isNonTarget()  && GetTeam() != (*it)->GetTeam())
		{
			if(GetSize()+(*it)->GetSize()+5.0f > distan_coord(GetPos(), (*it)->GetPos()))
			{
				//if(각도가 맞으면)
				MeleeDamage(gm_,(*it));
				SetDelay(30.0f);
				ok_ = true;
			}
		}
	}
	return ok_;
}
开发者ID:seobyeongky,项目名称:gunscape,代码行数:22,代码来源:monster.cpp


示例14: GetPos

bool CMissile::PointInObject (CVector vPos)

//	PointInObject
//
//	Returns TRUE if the given point is inside the object

	{
	if (m_fDestroyed)
		return false;

	//	Figure out the coordinates of vPos relative to the center of the
	//	object, in pixels.

	CVector vOffset = vPos - GetPos();
	int x = (int)((vOffset.GetX() / g_KlicksPerPixel) + 0.5);
	int y = -(int)((vOffset.GetY() / g_KlicksPerPixel) + 0.5);

	if (m_pPainter)
		return m_pPainter->PointInImage(x, y, m_iTick, (m_pDesc->m_bDirectional ? Angle2Direction(m_iRotation) : 0));
	else
		return m_pDesc->m_Image.PointInImage(x, y, m_iTick, (m_pDesc->m_bDirectional ? Angle2Direction(m_iRotation) : 0));
	}
开发者ID:alanhorizon,项目名称:Transport,代码行数:22,代码来源:CMissile.cpp


示例15: focusOnItem

bool DIALOG_DRC_CONTROL::focusOnItem( const DRC_ITEM* aItem )
{
    if( !aItem )
        return false;

    auto toolmgr = m_brdEditor->GetToolManager();
    auto pos = aItem->GetPointA();
    auto marker = static_cast<MARKER_PCB*>( aItem->GetParent() );

    if( marker )
    {
        pos = marker->GetPos();

        toolmgr->RunAction( PCB_ACTIONS::selectionClear, true );
        toolmgr->RunAction( PCB_ACTIONS::selectItem, true, marker );
    }

    toolmgr->GetView()->SetCenter( pos );
    m_brdEditor->GetCanvas()->Refresh();

    return true;
}
开发者ID:johnbeard,项目名称:kicad,代码行数:22,代码来源:dialog_drc.cpp


示例16: Special

bool Player::Special(Game_Manager* gm_, coord_def c, float focus_)
{
	if(GetStop())
		return false;
	if(current_weapon)
	{
		//focus_ += GetFocusSum();
		//InitNoneMoveCount();
		if(SetDelay(current_weapon->special(gm_, this, GetTeam(), GetPos(), c, focus_)) == -1)
		{
			//ÀÌ ºÎºÐÀº ¹Ì±¸Çö
			//SetDelay(0);
			return false;
		}
		else
		{
			//ÀÌ ºÎºÐµµ ¹Ì±¸Çö
			return true;
		}
	}
	return false;
}
开发者ID:seobyeongky,项目名称:gunscape,代码行数:22,代码来源:player.cpp


示例17: Metrics

int MultiButton::FindButton(int px)
{
	if(IsReadOnly())
		return Null;
	if(IsTrivial() && !Frame())
		return button[0].enabled ? 0 : Null;
	int border, lx, rx;
	Metrics(border, lx, rx);
	for(int i = 0; i < button.GetCount(); i++) {
		SubButton& b = button[i];
		int x = 0, cx = 0;
		if(GetPos(b, lx, rx, x, cx, px))
			return b.enabled ? i : Null;
	}
	if(WhenPush || WhenClick)
		return MAIN;
	if(display)
		for(int i = 0; i < button.GetCount(); i++)
			if(button[i].main)
				return i;
	return Null;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:22,代码来源:MultiButton.cpp


示例18: LLOG

dword BlockStream::_Get(void *data, dword size) {
	if(IsError() || !IsOpen()) return 0;
	LLOG("Get " << size);
	if(size == 0) return 0;
	_Term();
	byte *t = (byte *)data;
	int64 pos0 = GetPos();
	int64 pg0 = pos0 & pagemask;
	size = (int)min<int64>(GetSize() - pos0, size);
	int64 pos1 = pos0 + size;
	int64 pg1 = pos1 & pagemask;
	if(pg0 == pg1) {
		SyncPage();
		memcpy(data, buffer + pos0 - pos, size);
		ptr = buffer + pos1 - pos;
		_Term();
	}
	else {
		int last = int(pos1 - pg1);
		if(pagepos == pg1) {
			memcpy(t + size - last, buffer, last);
			last = 0;
		}
		SyncPage();
		int n = int(pos + pagesize - pos0);
		memcpy(t, buffer + pos0 - pos, n);
		dword q = dword(pg1 - pg0) - pagesize;
		if(q && Read(pos + pagesize, t + n, q) != q) {
			SetError();
			return 0;
		}
		SetPos(pos0 + size);
		if(last) {
			SyncPage();
			memcpy(t + size - last, buffer, last);
		}
	}
	return size;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:39,代码来源:BlockStream.cpp


示例19: ScreenWidth

void ChatEchoPanel::PerformLayout()
{
	float history_w = ScreenWidth() * 0.625f;
	float w = ScreenWidth() * 0.86f;

	int iLines = 4;
	if (ScreenHeight() <= 480)
		iLines = 3;
	//else if (ScreenHeight() <= 600)

	int line_tall = ScreenHeight() * 0.02f;	
	if (m_hFont != vgui::INVALID_FONT)	
	{
		line_tall = vgui::surface()->GetFontTall(m_hFont);
	}
	float h = line_tall * (iLines + 1.75f);
	SetSize(w, h);

	//Msg("ChatEchoPanel::PerformLayout line_tall=%d h=%f ScreenHeight=%d inputliney=%f\n",
		//line_tall, h, ScreenHeight(), float(line_tall) * (iLines + 0.5f));
	int x, y;
	GetPos(x, y);
	SetPos(x, ScreenHeight() - h);

	// centre the input line in whatever gap is left beneath our 4 chat lines
	m_pChatInputLine->SetBounds(0, line_tall * (iLines + 0.5f), w, line_tall+10);

	//Resize the History Panel so it fits more lines depending on the screen resolution.	
	int iChatHistoryX, iChatHistoryY, iChatHistoryW, iChatHistoryH;

	if (m_pChatHistory)
	{
		m_pChatHistory->GetBounds( iChatHistoryX, iChatHistoryY, iChatHistoryW, iChatHistoryH );

		iChatHistoryH = line_tall * iLines;

		m_pChatHistory->SetBounds( 0,  (h - line_tall) - iChatHistoryH, history_w, iChatHistoryH );
	}
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:39,代码来源:chatechopanel.cpp


示例20: SetMotion

//	パワーアーツ
bool	Thief::PowerArts(void)
{
	if ( !initflag )
	{
		artsTimer = 0;
		sound->PlaySE( SE::KAITO_POWER );
		initflag = true;
	}

	SetMotion(THIEF::MOTION_DATA::POWERARTS);
	//if (obj->GetFrame() >= 277) obj->SetFrame(277);

	//	行列から情報取得
	Vector3	front = GetFront();
	Vector3	p_pos = GetPos();
	SetMove(Vector3(0.0f, move.y, 0.0f));

	//	情報設定
	p_pos.y += 1.0f;
	Vector3	vec = front * 1.0f;

	float	 bulletSpeed = 0.8f;
	int playerNum = GetPlayerNum();


	if (artsTimer == 0/* obj->GetFrame() == ○○ */)
	{
		m_BulletManager->Set(BULLET_TYPE::THIEF_02, new ThiefBullet02, p_pos, vec, bulletSpeed, playerNum);
	}
	artsTimer++;

	if (obj->GetFrame() == THIEF::MOTION_FRAME::POWERARTS_END)
		{
			artsTimer = 0;
			initflag = false;
			return true;
		}
	return	false;
}
开发者ID:NyamLand,项目名称:WonderToyBox,代码行数:40,代码来源:Thief.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetPosX函数代码示例发布时间:2022-05-30
下一篇:
C++ GetPortString函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap