Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 21, 2016, 3:55:43 PM (7 years ago)
Author:
ooguz
Message:

Arrow movessvn add Waypoint.h!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/QuestGuide_HS16/src/modules/waypoints/Waypointarrow.cc

    r11287 r11298  
    1919       // model->setOrientation(Vector3(0,0,-1));
    2020        model->setPosition(Vector3(0,15,0));
     21        waypoints_ = nullptr;
    2122       
    2223    }
     
    2627    }
    2728
     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){
    2860     
     61        if (getWaypointgroup() == nullptr){
     62                    orxout() << "Second" << endl;
    2963
     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    }
    3078
    3179    void Waypointarrow::XMLPort(Element& xmlelement, XMLPort::Mode mode){
    3280        SUPER(Waypointarrow, XMLPort, xmlelement, mode); // From the SpaceShip.cc file
     81       
    3382        //XMLPortParamTemplate(WorldEntity, "orientation", setOrientation, getOrientation, xmlelement, mode, Vector3)
    3483
Note: See TracChangeset for help on using the changeset viewer.