Changeset 6143
- Timestamp:
- Nov 25, 2009, 1:42:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc
r6122 r6143 135 135 } 136 136 */ 137 if( !NewHumanController::localController_s->getControllableEntity()->isInMouseLook() ) 138 this->updateTarget(); 139 140 HumanController::localController_s->getControllableEntity()->fire(firemode); 137 138 if (firemode == 1 && this->controlMode_ == 1) { 139 //unlocked steering, steer on right mouse click 140 //HumanController::yaw(new Vector2(this->currentYaw_, 0)); 141 //HumanController::pitch(new Vector2(this->currentPitch_, 0)); 142 } 143 else { 144 if( !NewHumanController::localController_s->getControllableEntity()->isInMouseLook() ) 145 this->updateTarget(); 146 147 HumanController::localController_s->getControllableEntity()->fire(firemode); 148 } 149 141 150 } 142 151 … … 190 199 continue; 191 200 } 192 193 if( this->getControllableEntity()->getTarget() != wePtr ) 201 202 if ( this->getControllableEntity() && this->getControllableEntity()->getTarget() != wePtr ) 203 { 194 204 this->getControllableEntity()->setTarget(wePtr); 205 } 206 207 if( pawn ) 208 { 209 pawn->setAimPosition( mouseRay.getOrigin() + mouseRay.getDirection() * itr->distance ); 210 } 195 211 196 212 itr->movable->getParentSceneNode()->showBoundingBox(true); 197 213 //std::cout << itr->movable->getParentSceneNode()->_getDerivedPosition() << endl; 198 214 //return mouseRay.getOrigin() + mouseRay.getDirection() * itr->distance; //or itr->movable->getParentSceneNode()->_getDerivedPosition() 199 if ( pawn )200 {201 pawn->setAimPosition( mouseRay.getOrigin() + mouseRay.getDirection() * itr->distance ); // or itr->movable->getParentSceneNode()->_getDerivedPosition()202 pawn->setTarget( wePtr );203 }204 215 return; 205 216 } … … 209 220 { 210 221 pawn->setAimPosition( mouseRay.getOrigin() + mouseRay.getDirection() * 1200 ); 211 if( this->getControllableEntity()->getTarget() != 0 ) 212 pawn->setTarget( 0 ); 213 } 222 } 223 224 if( this->getControllableEntity() && this->getControllableEntity()->getTarget() != 0 ) 225 this->getControllableEntity()->setTarget( 0 ); 214 226 215 227 … … 223 235 if (this->controlMode_ == 0) 224 236 HumanController::yaw(value); 225 237 226 238 this->currentYaw_ = value.x; 227 //std::cout << "Y: " << static_cast<float>(this->currentPitch_) << " X: " << static_cast<float>(this->currentYaw_) << endl;228 239 } 229 240 … … 234 245 HumanController::pitch(value); 235 246 247 std::cout << value << endl; 248 236 249 this->currentPitch_ = value.x; 237 //std::cout << "Y: " << static_cast<float>(this->currentPitch_) << " X: " << static_cast<float>(this->currentYaw_) << endl;238 250 } 239 251 … … 247 259 NewHumanController::localController_s->controlMode_ = 0; 248 260 } 249 261 250 262 void NewHumanController::changedControllableEntity() 251 263 {
Note: See TracChangeset
for help on using the changeset viewer.