本文整理汇总了C++中Movement::slideLeft方法的典型用法代码示例。如果您正苦于以下问题:C++ Movement::slideLeft方法的具体用法?C++ Movement::slideLeft怎么用?C++ Movement::slideLeft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Movement
的用法示例。
在下文中一共展示了Movement::slideLeft方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scanUpdate
void scanUpdate() {
//Perform the scanning actions
switch(internalState){
//Move until hitting a color
case 0:
//scanning sea (state transition 2 in state diagram)
if (curPos == POS_SEA) {
move.slideRight(0.25);
//focused on bay, read color
if(rightCam.inZone()){
//put color read code here!
//--------------------------
//--------------------------
blockPos++;
if(blockPos > 5){
//we are done lets moveTo the next place
internalState = 2;
}
else{
internalState = 1;
}
}
}
//scanning rail (state transition 6)
else if (curPos == POS_RAIL) {
move.slideLeft(0.25);
//if we're focused on a bay, read color
if (leftCam.inZone()) {
//put color read code here!
//--------------------------
//--------------------------
blockPos++;
if(blockPos > 5){
//we are done lets moveTo the next place
internalState = 2;
}
else{
internalState = 1;
}
}
}
//scanning pickup (state transition 4)
else {
move.slideRight(0.25);
//TODO: change to "onBlock" or something?
if (rightCam.inZone()) {
//put color read code here!
//--------------------------
//--------------------------
blockPos++;
if(blockPos > 13){
//we are done lets moveTo the next place
internalState = 2;
}
else{
internalState = 1;
}
}
}
break;
//We already read this color, so just keep moving until white
case 1:
//move right
if (curPos == POS_PICK_SEA || curPos == POS_PICK_UP) {
move.slideRight(0.25);
//TODO: CREATE inbetweenZones
if(rightCam.inbetweenZones()){
internalState = 0:
}
}
//move left
else {