Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 12, 2016, 4:02:21 PM (8 years ago)
Author:
tgidron
Message:

New Pickup + try to create ground from separate tiles

Location:
code/branches/tgidronFS16
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tgidronFS16

  • code/branches/tgidronFS16/src/libraries/core/command/TclThreadManager.cc

    r11071 r11184  
    410410            {
    411411                // This query would lead to a deadlock - return with an error
    412                 TclThreadManager::error("Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + ' ' + multi_cast<std::string>(source_bundle->id_) \
    413                             + " -> " + multi_cast<std::string>(target_bundle->id_) \
    414                             + "), couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_) \
     412                TclThreadManager::error("Circular query (" + this->dumpList(source_bundle->queriers_.getList()) + ' ' + multi_cast<std::string>(source_bundle->id_)
     413                            + " -> " + multi_cast<std::string>(target_bundle->id_)
     414                            + "), couldn't query Tcl-interpreter with ID " + multi_cast<std::string>(target_bundle->id_)
    415415                            + " from other interpreter with ID " + multi_cast<std::string>(source_bundle->id_) + '.');
    416416            }
  • code/branches/tgidronFS16/src/modules/hover/Hover.cc

    r11182 r11184  
    169169            Pawn* crate = new Pawn(origin_->getContext());
    170170
     171           
     172            crate->addTemplate(origin_->getObstacleTemplate()); 
    171173            crate->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 10.0f));
    172             crate->addTemplate(origin_->getObstacleTemplate()); 
    173             crate->setInitialHealth(100.0f);
     174            //ate->setInitialHealth(100.0f);
    174175           
    175176
  • code/branches/tgidronFS16/src/modules/hover/HoverFlag.cc

    r11099 r11184  
    8787        model_ = new Model(this->getContext());
    8888        model_->setMeshSource("ss_flag_eu.mesh");
    89         model_->setScale3D(Vector3(5, 5, 5));
    90         model_->setPosition(Vector3(xCoordinate*cellSize*1.0f + cellSize/2,10.0f,yCoordinate*cellSize*1.0f + cellSize/2));
     89        model_->setScale3D(Vector3(30, 30, 30));
     90        model_->setPosition(Vector3(xCoordinate*cellSize*1.0f + cellSize/2,50.0f,yCoordinate*cellSize*1.0f + cellSize/2));
    9191
    9292        this->attach(model_);
    9393
    9494        cs_ = new BoxCollisionShape(this->getContext());
    95         cs_->setHalfExtents(Vector3(5, 5, 5));
     95        cs_->setHalfExtents(Vector3(30, 30, 30));
    9696        cs_->setPosition(Vector3(xCoordinate*cellSize*1.0f + cellSize/2,0.0f,yCoordinate*cellSize*1.0f + cellSize/2));
    9797
  • code/branches/tgidronFS16/src/modules/hover/HoverOrigin.cc

    r11182 r11184  
    4848        //not needed
    4949
    50         /*pickupTemplate_ = "";
     50        pickupTemplate_ = "";
    5151        pickupRepresentationTemplate_ = "";
    5252
     
    5656
    5757        pickupTemplateShrink_ = "";
    58         pickupRepresentationTemplateShrink_ = "";*/
     58        pickupRepresentationTemplateShrink_ = "";
    5959    }
    6060
  • code/branches/tgidronFS16/src/orxonox/Scene.h

    r11085 r11184  
    4848#include "network/synchronisable/Synchronisable.h"
    4949#include "tools/interfaces/Tickable.h"
     50#include "core/command/ConsoleCommandIncludes.h"
    5051
    5152namespace orxonox
  • code/branches/tgidronFS16/src/orxonox/gametypes/TeamGametype.cc

    r11071 r11184  
    141141    void TeamGametype::spawnDeadPlayersIfRequested()
    142142    {
    143         for (const auto& mapEntry : this->players_)\
     143        for (const auto& mapEntry : this->players_)
    144144        {
    145145            if(allowedInGame_[mapEntry.first] == false)//check if dead player is allowed to enter
  • code/branches/tgidronFS16/src/orxonox/weaponsystem/WeaponSystem.h

    r11071 r11184  
    5555            void removeWeaponSlot(WeaponSlot * wSlot);
    5656            WeaponSlot * getWeaponSlot(unsigned int index) const;
     57            inline const std::vector<WeaponSlot *>& getAllWeaponSlots() const
     58                { return weaponSlots_; }
    5759
    5860            // adding and removing WeaponSets
  • code/branches/tgidronFS16/src/orxonox/worldentities/pawns/Pawn.cc

    r11099 r11184  
    4949#include "weaponsystem/Munition.h"
    5050#include "sound/WorldSound.h"
     51#include "core/object/ObjectListIterator.h"
    5152
    5253#include "controllers/FormationController.h"
     
    5556{
    5657    RegisterClass(Pawn);
     58
     59    SetConsoleCommand("Pawn", "debugDrawWeapons", &Pawn::consoleCommand_debugDrawWeapons).addShortcut();
    5760
    5861    Pawn::Pawn(Context* context)
     
    168171    {
    169172        registerVariable(this->bAlive_,            VariableDirection::ToClient);
     173        registerVariable(this->bVulnerable_,       VariableDirection::ToClient);
    170174        registerVariable(this->health_,            VariableDirection::ToClient);
    171175        registerVariable(this->maxHealth_,         VariableDirection::ToClient);
     
    592596        return BLANKSTRING;
    593597    }
     598
     599    void Pawn::drawWeapons(bool bDraw)
     600    {
     601        if (bDraw)
     602        {
     603            std::vector<WeaponSlot*> weaponSlots = weaponSystem_->getAllWeaponSlots();
     604            int numWeaponSlots = weaponSlots.size();
     605            Vector3 slotPosition = Vector3::ZERO;
     606            Quaternion slotOrientation = Quaternion::IDENTITY;
     607            Model* slotModel = nullptr;
     608
     609            for (int i = 0; i < numWeaponSlots; ++i)
     610            {
     611                slotPosition = weaponSlots.at(i)->getPosition();
     612                slotOrientation = weaponSlots.at(i)->getOrientation();
     613                slotModel = new Model(this->getContext());
     614                slotModel->setMeshSource("Coordinates.mesh");
     615                slotModel->setScale(3.0f);
     616                slotModel->setOrientation(slotOrientation);
     617                slotModel->setPosition(slotPosition);
     618
     619                this->attach(slotModel);
     620                debugWeaponSlotModels_.push_back(slotModel);
     621            }
     622        }
     623        else
     624        {
     625            // delete all debug models
     626            for(Model* model : debugWeaponSlotModels_)
     627            {
     628                model->destroy();
     629            }
     630            debugWeaponSlotModels_.clear();
     631        }
     632    }
     633
     634    /*static*/ void Pawn::consoleCommand_debugDrawWeapons(bool bDraw)
     635    {
     636        if (bDraw)
     637        {
     638            orxout() << "WeaponSlot visualization enabled." << endl;
     639        }
     640        else
     641        {
     642            orxout() << "WeaponSlot visualization disabled." << endl;
     643        }
     644
     645        ObjectList<Pawn> pawnList;
     646        for (ObjectListIterator<Pawn> it = pawnList.begin(); it != pawnList.end(); ++it)
     647        {
     648            it->drawWeapons(bDraw);
     649        }
     650    }
    594651}
  • code/branches/tgidronFS16/src/orxonox/worldentities/pawns/Pawn.h

    r11071 r11184  
    218218                { return this->weaponSystem_; }
    219219
     220            static void consoleCommand_debugDrawWeapons(bool bDraw);
     221
    220222        protected:
    221223            virtual void preDestroy() override;
     
    233235
    234236            bool bAlive_;
    235             bool bVulnerable_; ///< If false the pawn may not ged damaged
     237            bool bVulnerable_; ///< If this is false, then the pawn may not take damage
    236238
    237239            virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const override
     
    269271            inline void setWeaponSystem(WeaponSystem* weaponsystem)
    270272                { this->weaponSystem_ = weaponsystem; }
     273            void drawWeapons(bool bDraw);
    271274
    272275            Vector3 aimPosition_;
    273276
    274277            WorldSound* explosionSound_; // TODO: Does this really belong here? Maybe move it to BigExplosion?
     278
     279            std::vector<Model*> debugWeaponSlotModels_;
    275280
    276281    }; // tolua_export
Note: See TracChangeset for help on using the changeset viewer.