Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 29, 2012, 11:02:13 PM (12 years ago)
Author:
landauf
Message:

fixed "quivering" movement also for DockingController and in the 2nd move-to-position function of FormationController

Location:
code/branches/presentation2012merge/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2012merge/src/modules/docking/DockingController.cc

    r8858 r9337  
    6060
    6161        float distance = (this->dock_->getWorldPosition() - entity->getPosition()).length();
    62         Vector2 coord = get2DViewdirection(     // I don't understand this too
     62        Vector2 coord = get2DViewcoordinates(     // I don't understand this too
    6363            entity->getPosition(),
    6464            entity->getOrientation() * WorldEntity::FRONT,
     
    7070        if (distance > 10)
    7171        {
    72             entity->rotateYaw(-1.0f * 0.8f * sgn(coord.x) * coord.x*coord.x);
    73             entity->rotatePitch(0.8f * sgn(coord.y) * coord.y*coord.y);
     72            entity->rotateYaw(-1.0f * 0.8f * clamp(coord.x * 10, -1.0f, 1.0f));
     73            entity->rotatePitch(0.8f * clamp(coord.y * 10, -1.0f, 1.0f));
    7474        }
    7575
  • code/branches/presentation2012merge/src/orxonox/controllers/FormationController.cc

    r9336 r9337  
    10511051            return;
    10521052
    1053         Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
     1053        Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
    10541054        float distance = (target - this->getControllableEntity()->getPosition()).length();
    10551055
     
    10571057            {
    10581058                // Multiply with ROTATEFACTOR_FREE to make them a bit slower
    1059                 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
    1060                 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
     1059                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * clamp(coord.x * 10, -1.0f, 1.0f));
     1060                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * clamp(coord.y * 10, -1.0f, 1.0f));
    10611061                this->getControllableEntity()->moveFrontBack(SPEED_FREE);
    10621062            }
Note: See TracChangeset for help on using the changeset viewer.