当前位置: 首页>>代码示例>>C++>>正文


C++ Map::GetMesh方法代码示例

本文整理汇总了C++中Map::GetMesh方法的典型用法代码示例。如果您正苦于以下问题:C++ Map::GetMesh方法的具体用法?C++ Map::GetMesh怎么用?C++ Map::GetMesh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Map的用法示例。


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

示例1: GetGraphics


//.........这里部分代码省略.........
		mPlatform->Update(diff);

		if(this->networkController)
		{
			mPlatform->SetRotate(true);
			Vector3 phoneDirr = Vector3(this->networkController->direction.y, this->networkController->direction.z, -this->networkController->direction.x);
			//Vector3 phoneDirr = this->networkController->direction;
			phoneDirr.Normalize();
			prevVectors[currentPrev] = phoneDirr;
			float angle = CalcAngle(phoneDirr, DefaultDir, prevVectors, currentPrev);

			float angleX = acos(DefaultDir.GetDotProduct(Vector3(0, phoneDirr.y , phoneDirr.z).Normalize()));
			float angleZ = acos(DefaultDir.GetDotProduct(Vector3(phoneDirr.x, phoneDirr.y, 0).Normalize()));
			if(phoneDirr.z > 0)
			{
				angleX *= -1;
			}
			if(phoneDirr.x < 0)
			{
				angleZ *= -1;
			}
			mPlatform->SetTargetAngleX(angleX/4);
			mPlatform->SetTargetAngleZ(angleZ/4);

			angle /= 4;
			currentPrev++;
			if(currentPrev >= NROFPREV)
				currentPrev = 0;
		}
		if(mGe->GetKeyListener()->IsPressed('W'))
		{
			mPlatform->RotateX(-diff);

			Vector3 tempPos = mBalls->GetPosition() - mPlatform->GetMesh()->GetPosition();
			tempPos.RotateAroundAxis(Vector3(1,0,0), (PI/8.0f)*-diff*0.001f);
			mBalls->SetPosition(mPlatform->GetMesh()->GetPosition() + tempPos);
		}
		if(mGe->GetKeyListener()->IsPressed('S'))
		{
			mPlatform->RotateX(diff);

			Vector3 tempPos = mBalls->GetPosition() - mPlatform->GetMesh()->GetPosition();
			tempPos.RotateAroundAxis(Vector3(1,0,0), (PI/8.0f)*diff*0.001f);
			mBalls->SetPosition(mPlatform->GetMesh()->GetPosition() + tempPos);
		}
		if(mGe->GetKeyListener()->IsPressed('A'))
		{
			mPlatform->RotateZ(-diff);

			Vector3 tempPos = mBalls->GetPosition() - mPlatform->GetMesh()->GetPosition();
			tempPos.RotateAroundAxis(Vector3(0,0,1), (PI/8.0f)*-diff*0.001f);
			mBalls->SetPosition(mPlatform->GetMesh()->GetPosition() + tempPos);
		}
		if(mGe->GetKeyListener()->IsPressed('D'))
		{
			mPlatform->RotateZ(diff);

			Vector3 tempPos = mBalls->GetPosition() - mPlatform->GetMesh()->GetPosition();
			tempPos.RotateAroundAxis(Vector3(0,0,1), (PI/8.0f)*diff*0.001f);
			mBalls->SetPosition(mPlatform->GetMesh()->GetPosition() + tempPos);
		}
		
		//////////////////////////////////////////////////////////////////////////
		static bool posb = true;
		if(GetGraphics()->GetKeyListener()->IsPressed('Q'))
		{
开发者ID:Malow,项目名称:PhoneGame,代码行数:67,代码来源:GameMode2.cpp


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