Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 22, 2010, 10:45:09 PM (15 years ago)
Author:
ebeier
Message:

first working version of the SpeedPickup, needs some more work for "onUse" type. Spaceship trails need to be looked at, because they don't show when a SpeedPickup with SpeedAdd is used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ppspickups1/src/orxonox/items/Engine.cc

    r6540 r6607  
    6464        this->boostBlur_ = 0;
    6565
     66        this->speedAdd_ = 0.0;
     67        this->speedMultiply_ = 1.0;
     68
    6669        this->setConfigValues();
    6770        this->registerVariables();
     
    119122        registerVariable(this->accelerationLeftRight_, VariableDirection::ToClient);
    120123        registerVariable(this->accelerationUpDown_,    VariableDirection::ToClient);
     124
     125        registerVariable(this->speedAdd_, VariableDirection::ToClient);
     126        registerVariable(this->speedMultiply_, VariableDirection::ToClient);
    121127    }
    122128
     
    192198        }
    193199
    194         this->ship_->setAcceleration(this->ship_->getOrientation() * acceleration);
     200        this->ship_->setAcceleration(this->ship_->getOrientation() * (acceleration*this->getSpeedMultiply()+Vector3(0,0,-this->getSpeedAdd())));
    195201
    196202        if (!this->ship_->getPermanentBoost())
     
    241247            return Vector3::ZERO;
    242248    }
     249
     250    PickupCarrier* Engine::getCarrierParent(void)
     251    {
     252        return this->ship_;
     253    }
     254
     255    const Vector3& Engine::getCarrierPosition(void)
     256    {
     257        return this->ship_->getWorldPosition();
     258    }
    243259}
Note: See TracChangeset for help on using the changeset viewer.