Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 27, 2010, 10:16:08 PM (14 years ago)
Author:
gasserlu
Message:

drone smooth flight mode & minmaxDistance, multiple drones possible

Location:
code/branches/ai/src/orxonox/worldentities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai/src/orxonox/worldentities/Drone.cc

    r6918 r6991  
    4040namespace orxonox
    4141{
    42     // put your code in here:
    43     // create the factory for the drone
    4442    CreateFactory(Drone);
    4543    /**
     
    4947    Drone::Drone(BaseObject* creator) : Pawn(creator)
    5048    {
    51         // put your code in here:
    52         // - register the drone class to the core
    5349        RegisterObject(Drone);
    5450
     
    5753        this->localLinearAcceleration_.setValue(0, 0, 0);
    5854        this->localAngularAcceleration_.setValue(0, 0, 0);
    59         this->primaryThrust_  = 100;
    60         this->auxilaryThrust_ = 100;
    61         this->rotationThrust_ = 10;
    62        
     55        this->setRadarVisibility(false);
    6356        this->setCollisionType(WorldEntity::Dynamic);
    6457       
     
    8578    void Drone::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    8679    {
    87         // this calls the XMLPort function of the parent class
    8880        SUPER(Drone, XMLPort, xmlelement, mode);
    8981
    90         // put your code in here:
    91         // make sure you add the variables primaryThrust_, auxilaryThrust_ and rotationThrust_ to xmlport
    92         // make sure that the set- and get-functions exist.
    93         // variables can be added by the following command
    94         // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunction, getFunction, xmlelement, mode)
    9582        XMLPortParam(Drone, "primaryThrust_", setPrimaryThrust, getPrimaryThrust, xmlelement, mode);
    9683        XMLPortParam(Drone, "auxilaryThrust_", setAuxilaryThrust, getAuxilaryThrust, xmlelement, mode);
    9784        XMLPortParam(Drone, "rotationThrust_", setRotationThrust, getRotationThrust, xmlelement, mode);
    98 
    99 
     85        XMLPortParam(Drone, "maxDistanceToOwner_", setMaxDistanceToOwner, getMaxDistanceToOwner, xmlelement, mode);
     86        XMLPortParam(Drone, "minDistanceToOwner_", setMinDistanceToOwner, getMinDistanceToOwner, xmlelement, mode);
    10087    }
    10188
  • code/branches/ai/src/orxonox/worldentities/Drone.h

    r6832 r6991  
    110110            inline void setRotationThrust( float thrust )
    111111                { this->rotationThrust_=thrust; }     
     112            inline void setMaxDistanceToOwner( float distance)
     113                { this->maxDistanceToOwner_=distance; }
     114            inline void setMinDistanceToOwner( float distance)
     115                { this->minDistanceToOwner_=distance; }
    112116                       
    113117           
     
    118122            inline float getPrimaryThrust()
    119123                { return this->primaryThrust_; }
    120 
    121            inline float getAuxilaryThrust()
     124            inline float getAuxilaryThrust()
    122125                { return this->auxilaryThrust_; }
    123            inline float getRotationThrust()
     126            inline float getRotationThrust()
    124127                { return this->rotationThrust_; }
     128            inline float getMaxDistanceToOwner()
     129                { return this->maxDistanceToOwner_; }
     130            inline float getMinDistanceToOwner()
     131                { return this->minDistanceToOwner_; }
    125132           
    126133        private:
     
    132139            float auxilaryThrust_; //!< The amount of auxilary thrust. Used for all other movements (except for rotations).
    133140            float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.
     141            float maxDistanceToOwner_; //Maximum Distance to owner
     142            float minDistanceToOwner_; //Minimum Distance to owner
    134143    };
    135144
Note: See TracChangeset for help on using the changeset viewer.