Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 12, 2018, 2:07:03 PM (7 years ago)
Author:
adamc
Message:

merged HS17 into FS18

Location:
code/branches/ScriptableController_FS18
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ScriptableController_FS18

  • code/branches/ScriptableController_FS18/src/orxonox/worldentities/WorldEntity.cc

    r11083 r11855  
    4444#include "core/XMLPort.h"
    4545#include "Scene.h"
     46#include "Level.h"
    4647#include "collisionshapes/WorldEntityCollisionShape.h"
     48#include "scriptablecontroller/scriptable_controller.h"
    4749
    4850namespace orxonox
     
    7981        this->parentID_ = OBJECTID_UNKNOWN;
    8082        this->bDeleteWithParent_ = true;
     83        this->id_ = -1;
    8184
    8285        this->node_->setPosition(Vector3::ZERO);
     
    160163        XMLPortParamTemplate(WorldEntity, "scale3D",     setScale3D,     getScale3D,     xmlelement, mode, const Vector3&);
    161164        XMLPortParam        (WorldEntity, "scale",       setScale,       getScale,       xmlelement, mode);
     165        XMLPortParamLoadOnly(WorldEntity, "id",          setID,                xmlelement, mode);
    162166        XMLPortParamLoadOnly(WorldEntity, "lookat",      lookAt_xmlport,       xmlelement, mode);
    163167        XMLPortParamLoadOnly(WorldEntity, "direction",   setDirection_xmlport, xmlelement, mode);
     
    181185        // Attached collision shapes
    182186        XMLPortObject(WorldEntity, CollisionShape, "collisionShapes", attachCollisionShape, getAttachedCollisionShape, xmlelement, mode);
     187
     188        if(!this->id_.empty() && this->getLevel() != nullptr)
     189            this->getLevel()->getScriptableController()->registerWorldEntity(this->id_, this);
    183190    }
    184191
Note: See TracChangeset for help on using the changeset viewer.