Changeset 11307
- Timestamp:
- Nov 28, 2016, 3:34:58 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/QuestGuide_HS16/src/modules/waypoints/Waypointarrow.cc
r11298 r11307 14 14 RegisterObject(Waypointarrow); 15 15 model = new Model(this->getContext()); 16 model->setMeshSource(" cokebottle.mesh"); // Name of the arrow file for now bottle16 model->setMeshSource("arrow.mesh"); // Name of the arrow file for now bottle 17 17 this->attach(model); 18 18 model->setScale(3); 19 19 // model->setOrientation(Vector3(0,0,-1)); 20 model->setPosition(Vector3(0,15, 0));20 model->setPosition(Vector3(0,15, 0)); 21 21 waypoints_ = nullptr; 22 23 22 } 24 23 … … 27 26 } 28 27 29 /* 28 /* 30 29 Waypoint* WaypointGroup::getActive(){ 31 30 for (Waypoint* object : this->waypoints_){ … … 39 38 40 39 void tick::getActive 40 41 41 42 */ 42 43 … … 48 49 for (WaypointGroup* group : ObjectList<WaypointGroup>()) 49 50 waypoints_ = group; 50 51 51 52 } 52 53 … … 58 59 59 60 void Waypointarrow::tick(float dt){ 60 61 61 62 if (getWaypointgroup() == nullptr){ 62 63 orxout() << "Second" << endl; 63 64 64 65 return; 65 } 66 66 } 67 67 68 waypoints_ = getWaypointgroup(); 68 69 69 70 waypoint = waypoints_->getActive(); 70 71 71 72 Vector3 waypoint_position = waypoint->getWorldPosition(); 73 74 Vector3 trial = waypoint_position - this->getWorldPosition(); 75 76 //orxout() << "dsfsf" << waypoint_position.x << endl; 77 orxout() << "waypoint " << waypoint_position.x << "waypoint " << waypoint_position.y << "waypoint " << waypoint_position.z << endl; 78 orxout() << "model " << this->model->getWorldPosition().x << "model " << this->model->getWorldPosition().y << "model " << this->model->getWorldPosition().z << endl; 79 orxout() << "this " << this->getWorldPosition().x << "this " << this->getWorldPosition().y << "this " << this->getWorldPosition().z << endl; 80 orxout() << "trial " << trial.x << "trial " << trial.y << "trial " << trial.z << endl; 81 82 Vector3 origin = model->getWorldPosition();; 83 model->setDirection( origin - waypoint_position, TransformSpace::World); 72 84 73 orxout() << "dsfsf" << waypoint_position.x << endl;74 model->lookAt(waypoint_position - this->getWorldPosition());75 85 76 77 86 } 78 87 79 88 void Waypointarrow::XMLPort(Element& xmlelement, XMLPort::Mode mode){ 80 89 SUPER(Waypointarrow, XMLPort, xmlelement, mode); // From the SpaceShip.cc file 81 90 82 91 //XMLPortParamTemplate(WorldEntity, "orientation", setOrientation, getOrientation, xmlelement, mode, Vector3) 83 92 84 93 //XMLPortObject(SpaceShip, Engine, "engines", addEngine, getEngine, xmlelement, mode); // TRY ADDING THE WAYPOINT ARROW LIKE AN ENGINE 85 94 86 95 87 96 }
Note: See TracChangeset
for help on using the changeset viewer.