本文整理汇总了C++中GLFrame::MoveRight方法的典型用法代码示例。如果您正苦于以下问题:C++ GLFrame::MoveRight方法的具体用法?C++ GLFrame::MoveRight怎么用?C++ GLFrame::MoveRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLFrame
的用法示例。
在下文中一共展示了GLFrame::MoveRight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupRC
void setupRC()
{
expCounter = counterLoader();
//BG:
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
//Enable depth testing so things won't look effed up:
glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_SRC_COLOR);
//Initialize stock shaders from GLTools:
shaderManager.InitializeStockShaders();
//Move cam back:
cameraFrame.MoveForward(-30.0f);
cameraFrame.MoveRight(-5.0f);
cameraFrame.MoveUp(-8.0f);
newDeskButton.init(20, 80, 165, 70, "Assets/button_new_desk165x70.tga");
removeDeskButton.init(208, 80, 175, 67, "Assets/button_remove_desk175x67.tga");
exportButton.init(403, 80, 168, 67, "Assets/button_export168x67.tga");
M3DVector4f deskShine = {0.5, 0.5, 0.5, 1.0};
M3DVector4f deskColor = {0.0f, 0.0f, 0.5f, 1.0f};
hlGrid.init(0.0f, 0.0f, 0.0f, C_DM/2);
cRoom.init();
stuDesks.init(deskColor, deskShine, C_DM/2);
}
示例2: beingAttacked
void LeadingRole::beingAttacked()
{
if(state == normalState)
{
state = beingAttackedState;
ySpeed = 0.5;
xSpeed = 0.3;
}
if(state == beingAttackedState)
{
ySpeed = ySpeed-0.1;
frame.MoveUp(ySpeed);
frameCamera.MoveUp(ySpeed*scaleY);
if(faceRight == true)
{
frame.MoveForward(-xSpeed);
frameCamera.MoveRight(xSpeed*scaleX);
}
else
{
frame.MoveForward(-xSpeed);
frameCamera.MoveRight(-xSpeed*scaleX);
}
bool collision = collisionGround();
if(collision == true)
{
frame.MoveUp(-ySpeed);
frameCamera.MoveUp(-ySpeed*scaleY);
while(collision == true)
{
frame.MoveUp(0.1);
frameCamera.MoveUp(0.1*scaleY);
collision = collisionGround();
}
xSpeed = 0;
ySpeed = 0;
state = normalState;
//cout << "normal" << endl;
}
}
}
示例3: handleInput
void handleInput(CStopWatch &inputTimer)
{
// Exit
if (in.keyPressed(sf::Keyboard::Escape))
exit(0);
// Camera movement
float elapsedTime = inputTimer.GetElapsedSeconds() * 1.5f;
inputTimer.Reset();
if (mouseActive)
{
if (in.keyPressed(sf::Keyboard::W))
cameraFrame.MoveForward(camSpeed*elapsedTime);
if (in.keyPressed(sf::Keyboard::S))
cameraFrame.MoveForward(-camSpeed*elapsedTime);
if (in.keyPressed(sf::Keyboard::A))
cameraFrame.MoveRight(camSpeed*elapsedTime);
if (in.keyPressed(sf::Keyboard::D))
cameraFrame.MoveRight(-camSpeed*elapsedTime);
if (in.keyPressed(sf::Keyboard::Space))
cameraFrame.MoveUp(camSpeed*elapsedTime);
if (in.keyPressed(sf::Keyboard::LControl))
cameraFrame.MoveUp(-camSpeed*elapsedTime);
}
else
{
if (in.keyPressed(sf::Keyboard::W))
cameraFrame.MoveUp(camSpeed*elapsedTime);
if (in.keyPressed(sf::Keyboard::S))
cameraFrame.MoveUp(-camSpeed*elapsedTime);
if (in.keyPressed(sf::Keyboard::A))
cameraFrame.MoveRight(camSpeed*elapsedTime);
if (in.keyPressed(sf::Keyboard::D))
cameraFrame.MoveRight(-camSpeed*elapsedTime);
}
}
示例4: walkFoward
void LeadingRole::walkFoward(float step)
{
if(step < 0)
{
if(faceRight == true)
{
faceRight = !faceRight;
frame.RotateWorld(M_PI, 0, 1, 0);
}
frame.MoveForward(-step);
frameCamera.MoveRight(-step*scaleX);
if(collisionGround() == true)
{
frame.MoveForward(step);
frameCamera.MoveRight(step*scaleX);
return;
}
if(walkLoop == 0 && rightHandRotate[0] >= -45 && state == normalState)
{
rightHandRotate[0] -= 5;
}
else if(walkLoop == 1 && rightHandRotate[0] <= 45 && state == normalState)
{
rightHandRotate[0] += 5;
}
else if(state == normalState)
{
walkLoop = !walkLoop;
}
}
else
{
if(faceRight == false)
{
faceRight = !faceRight;
frame.RotateWorld(-M_PI, 0, 1, 0);
}
frame.MoveForward(step);
frameCamera.MoveRight(-step*scaleX);
if(collisionGround() == true)
{
frame.MoveForward(-step);
frameCamera.MoveRight(step*scaleX);
return;
}
if(walkLoop == 0 && rightHandRotate[0] <= 45 && state == normalState)
{
rightHandRotate[0] += 5;
}
else if(walkLoop == 1 && rightHandRotate[0] >= -45 && state == normalState)
{
rightHandRotate[0] -= 5;
}
else if(state == normalState)
{
walkLoop = !walkLoop;
}
}
leftLegRotate[0] = leftHandRotate[0] = -rightHandRotate[0];
rightLegRotate[0] = rightHandRotate[0];
}