Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9043


Ignore:
Timestamp:
Mar 16, 2012, 4:06:01 PM (13 years ago)
Author:
scmoritz
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/waypoints/src/orxonox/controllers/FormationController.cc

    r9016 r9043  
    272272        }
    273273
    274         Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
     274        Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
    275275        float distance = (target - this->getControllableEntity()->getPosition()).length();
    276 
     276                if(coord.x < 0.01 && coord.y < 0.01)
     277                {
     278                        // I AM HERE
     279                        //this->getControllableEntity()->setOrientation() 
     280                }
    277281
    278282        if(this->state_ == FREE)
     
    281285            {
    282286                // Multiply with ROTATEFACTOR_FREE to make them a bit slower
    283                 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
    284                 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
    285             }
    286 
    287             if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
     287                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x);
     288                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y);
     289            }
     290
     291            if (this->target_ && distance <  200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
    288292            {
    289293              this->getControllableEntity()->moveFrontBack(-0.05f); // They don't brake with full power to give the player a chance
Note: See TracChangeset for help on using the changeset viewer.