Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 17, 2014, 4:05:06 PM (11 years ago)
Author:
muemart
Message:

Move logic into controller, don't use bullet for rotations, and use WorldPosition in FormationController+ (good idea?)

Location:
code/branches/turretFS14/src/orxonox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/turretFS14/src/orxonox/controllers/ArtificialController.cc

    r9667 r10039  
    9494        static const float hardcoded_projectile_speed = 1250;
    9595
    96         this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getPosition(), hardcoded_projectile_speed, this->target_->getPosition(), this->target_->getVelocity());
     96        this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getWorldPosition(), hardcoded_projectile_speed, this->target_->getWorldPosition(), this->target_->getVelocity());
    9797        this->bHasTargetPosition_ = (this->targetPosition_ != Vector3::ZERO);
    9898
  • code/branches/turretFS14/src/orxonox/controllers/FormationController.cc

    r9800 r10039  
    277277        }
    278278
    279         Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
    280         float distance = (target - this->getControllableEntity()->getPosition()).length();
     279        Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getWorldPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
     280        float distance = (target - this->getControllableEntity()->getWorldPosition()).length();
    281281        float rotateX = clamp(coord.x * 10, -1.0f, 1.0f);
    282282        float rotateY = clamp(coord.y * 10, -1.0f, 1.0f);
  • code/branches/turretFS14/src/orxonox/worldentities/WorldEntity.cc

    r10031 r10039  
    414414            else if (this->isDynamic())
    415415            {
     416                //hacky hack, really shouldn't do that
    416417                //orxout(internal_warning) << "Cannot attach a dynamic object to a WorldEntity." << endl;
    417418                //return false;
Note: See TracChangeset for help on using the changeset viewer.