本文整理汇总了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'))
{