- Timestamp:
- Jan 4, 2016, 6:31:29 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationHS15/src/modules/hover/HoverFlag.cc
r11041 r11042 48 48 { 49 49 RegisterObject(HoverFlag); 50 model_ = NULL; 51 cs_ = NULL; 50 51 this->model_ = NULL; 52 this->cs_ = NULL; 53 this->collided_ = false; 54 55 this->enableCollisionCallback(); 56 this->setCollisionResponse(true); 57 this->setCollisionType(Static); 52 58 } 53 59 54 60 /** 55 61 @brief 56 Constructor that expects two coordinate-values in the range 0-962 Initializes the flag. 57 63 @param xCoordinate 58 64 X-Coordinate of the flage, 0-9, origin is bottom left … … 60 66 Y-Coordinate of the flage, 0-9, origin is bottom left 61 67 */ 62 HoverFlag::HoverFlag(Context* context, int xCoordinate, int yCoordinate, int cellSize) : StaticEntity(context)68 void HoverFlag::init(int xCoordinate, int yCoordinate, int cellSize) 63 69 { 64 RegisterObject(HoverFlag); 65 enableCollisionCallback(); 66 model_ = NULL; 67 cs_ = NULL; 68 69 model_ = new Model(context); 70 model_ = new Model(this->getContext()); 70 71 model_->setMeshSource("ss_flag_eu.mesh"); 71 72 model_->setScale3D(Vector3(5, 5, 5)); … … 74 75 this->attach(model_); 75 76 76 this->enableCollisionCallback(); 77 this->setCollisionResponse(true); 78 this->setCollisionType(Static); 79 80 cs_ = new BoxCollisionShape(context); 77 cs_ = new BoxCollisionShape(this->getContext()); 81 78 cs_->setHalfExtents(Vector3(5, 5, 5)); 82 79 cs_->setPosition(Vector3(xCoordinate*cellSize*1.0f + cellSize/2,0.0f,yCoordinate*cellSize*1.0f + cellSize/2)); 83 80 84 81 this->attachCollisionShape(cs_); 85 this->collided_ = false;86 87 82 } 88 83
Note: See TracChangeset
for help on using the changeset viewer.