Changeset 11298
- Timestamp:
- Nov 21, 2016, 3:55:43 PM (8 years ago)
- Location:
- code/branches/QuestGuide_HS16/src/modules/waypoints
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/QuestGuide_HS16/src/modules/waypoints/Waypoint.h
r11287 r11298 52 52 53 53 54 54 bool waypoint_actived; 55 55 56 56 private: … … 59 59 Model* model; 60 60 DistanceTrigger* distancetrigger; 61 bool waypoint_actived;62 61 int order; 63 62 -
code/branches/QuestGuide_HS16/src/modules/waypoints/WaypointGroup.cc
r11287 r11298 16 16 { 17 17 RegisterObject(WaypointGroup); 18 activeWaypoint = nullptr; 19 18 20 //model = new Model(this->getContext()); 19 21 //model->setMeshSource("cube.mesh"); // Name of the arrow file for now bottle … … 60 62 61 63 Waypoint* WaypointGroup::getActive(){ 62 for (Waypoint* object : this->waypoints_){ 64 if (activeWaypoint == nullptr){ 65 orxout() << "OOOOOOOOOO" << endl; 66 67 activateNext(); 68 69 } 70 return activeWaypoint; 71 } 72 73 Waypoint* WaypointGroup::activateNext(){ 74 for (Waypoint* object : this->waypoints_){ 63 75 if(!(object->waypoint_actived)){ 64 76 object->enable_waypoint(); 65 returnobject;77 activeWaypoint = object; 66 78 } 67 79 } 80 return activeWaypoint; 68 81 } 69 70 82 71 83 -
code/branches/QuestGuide_HS16/src/modules/waypoints/WaypointGroup.h
r11287 r11298 45 45 46 46 47 47 Waypoint* getActive(); 48 48 49 50 Waypoint* activateNext(); 49 51 50 52 … … 58 60 59 61 std::set<Waypoint*> waypoints_; 62 Waypoint* activeWaypoint; 60 63 61 64 // network callbacks -
code/branches/QuestGuide_HS16/src/modules/waypoints/Waypointarrow.cc
r11287 r11298 19 19 // model->setOrientation(Vector3(0,0,-1)); 20 20 model->setPosition(Vector3(0,15,0)); 21 waypoints_ = nullptr; 21 22 22 23 } … … 26 27 } 27 28 29 /* 30 Waypoint* WaypointGroup::getActive(){ 31 for (Waypoint* object : this->waypoints_){ 32 if(!(object->waypoint_actived)){ 33 object->enable_waypoint(); 34 return object; 35 } 36 } 37 } 38 39 40 void tick::getActive 41 */ 42 43 44 WaypointGroup* Waypointarrow::getWaypointgroup() 45 { 46 if (waypoints_ == nullptr){ 47 48 for (WaypointGroup* group : ObjectList<WaypointGroup>()) 49 waypoints_ = group; 50 51 } 52 53 return waypoints_; 54 } 55 56 57 58 59 void Waypointarrow::tick(float dt){ 28 60 61 if (getWaypointgroup() == nullptr){ 62 orxout() << "Second" << endl; 29 63 64 return; 65 } 66 67 waypoints_ = getWaypointgroup(); 68 69 waypoint = waypoints_->getActive(); 70 71 Vector3 waypoint_position = waypoint->getWorldPosition(); 72 73 orxout() << "dsfsf" << waypoint_position.x << endl; 74 model->lookAt(waypoint_position - this->getWorldPosition()); 75 76 77 } 30 78 31 79 void Waypointarrow::XMLPort(Element& xmlelement, XMLPort::Mode mode){ 32 80 SUPER(Waypointarrow, XMLPort, xmlelement, mode); // From the SpaceShip.cc file 81 33 82 //XMLPortParamTemplate(WorldEntity, "orientation", setOrientation, getOrientation, xmlelement, mode, Vector3) 34 83 -
code/branches/QuestGuide_HS16/src/modules/waypoints/Waypointarrow.h
r11287 r11298 31 31 */ 32 32 33 class _OrxonoxExport Waypointarrow : public StaticEntity {33 class _OrxonoxExport Waypointarrow : public StaticEntity, public Tickable { 34 34 35 35 public: … … 37 37 Waypointarrow(Context* context); 38 38 virtual ~Waypointarrow(); 39 WaypointGroup* getWaypointgroup(); 39 40 40 41 41 42 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 42 43 43 44 virtual void tick(float dt); 44 45 45 46 … … 48 49 //virtual bool isCollisionTypeLegal(CollisionType type) const override; 49 50 Model* model; 50 //Waypoint* waypoint; 51 WaypointGroup* waypoints_; 52 Waypoint* waypoint; 51 53 // network callbacks 52 54 };
Note: See TracChangeset
for help on using the changeset viewer.