Changeset 8738
- Timestamp:
- Jul 9, 2011, 7:45:14 PM (13 years ago)
- Location:
- code/trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/overlays/hud/HUDRadar.cc
r8737 r8738 106 106 panel->setMaterialName(TextureGenerator::getMaterialName( 107 107 shapeMaterials_[object->getRadarObjectShape()], object->getRadarObjectColour())); 108 panel->hide(); 108 109 this->radarObjects_[object] = panel; 109 110 } … … 166 167 float distance = (wePointer->getWorldPosition() - this->owner_->getPosition()).length(); 167 168 // calculate the size with 1/distance dependency for simplicity (instead of exp(-distance * lambda) 168 float size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) ;169 float size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale(); 169 170 it->second->setDimensions(size, size); 170 171 -
code/trunk/src/modules/weapons/projectiles/Rocket.cc
r8706 r8738 52 52 Constructor. Registers the object and initializes some default values. 53 53 */ 54 Rocket::Rocket(BaseObject* creator) : ControllableEntity(creator), BasicProjectile() 54 Rocket::Rocket(BaseObject* creator) 55 : ControllableEntity(creator) 56 , BasicProjectile() 57 , RadarViewable(creator, static_cast<WorldEntity*>(this)) 55 58 { 56 59 RegisterObject(Rocket);// - register the Rocket class to the core … … 106 109 camPosition->setAllowMouseLook(true); 107 110 this->addCameraPosition(camPosition); 111 112 this->setRadarObjectColour(ColourValue(1.0, 0.5, 0.0)); // orange 113 this->setRadarObjectShape(RadarViewable::Triangle); 114 this->setRadarObjectScale(0.5f); 108 115 } 109 116 -
code/trunk/src/modules/weapons/projectiles/Rocket.h
r8706 r8738 34 34 #include "tools/Timer.h" 35 35 #include "worldentities/ControllableEntity.h" 36 #include "interfaces/RadarViewable.h" 36 37 37 38 #include "BasicProjectile.h" … … 48 49 Oli Scheuss 49 50 */ 50 class _WeaponsExport Rocket : public ControllableEntity, public BasicProjectile 51 class _WeaponsExport Rocket : public ControllableEntity, public BasicProjectile, public RadarViewable 51 52 { 52 53 public: -
code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc
r8706 r8738 48 48 CreateFactory(SimpleRocket); 49 49 50 SimpleRocket::SimpleRocket(BaseObject* creator) : ControllableEntity(creator), BasicProjectile() 50 SimpleRocket::SimpleRocket(BaseObject* creator) 51 : ControllableEntity(creator) 52 , BasicProjectile() 53 , RadarViewable(creator, static_cast<WorldEntity*>(this)) 51 54 { 52 55 RegisterObject(SimpleRocket);// - register the SimpleRocket class to the core 53 56 54 57 this->localAngularVelocity_ = 0; 55 this->lifetime_ = 1 20;58 this->lifetime_ = 10; 56 59 57 60 this->setMass(15); … … 86 89 } 87 90 91 this->setRadarObjectColour(ColourValue(1.0, 1.0, 0.0)); // yellow 92 this->setRadarObjectShape(RadarViewable::Triangle); 93 this->setRadarObjectScale(0.5f); 88 94 } 89 95 -
code/trunk/src/modules/weapons/projectiles/SimpleRocket.h
r8706 r8738 35 35 #include "worldentities/ControllableEntity.h" 36 36 #include "graphics/ParticleSpawner.h" 37 #include "interfaces/RadarViewable.h" 37 38 38 39 #include "BasicProjectile.h" … … 48 49 Gabriel Nadler (Original file: Oli Scheuss) 49 50 */ 50 class _WeaponsExport SimpleRocket : public ControllableEntity, public BasicProjectile 51 class _WeaponsExport SimpleRocket : public ControllableEntity, public BasicProjectile, public RadarViewable 51 52 { 52 53 public: -
code/trunk/src/orxonox/interfaces/RadarViewable.cc
r7163 r8738 50 50 , radarObjectShape_(Dot) 51 51 , radarObjectDescription_("staticObject") 52 , scale_(1.0f) 52 53 { 53 54 RegisterRootObject(RadarViewable); -
code/trunk/src/orxonox/interfaces/RadarViewable.h
r7163 r8738 113 113 inline Shape getRadarObjectShape() const 114 114 { return this->radarObjectShape_; } 115 116 inline void setRadarObjectScale(float scale) 117 { 118 if(this->scale_ != scale) 119 { 120 this->scale_ = scale; 121 this->settingsChanged(); 122 } 123 } 124 inline float getRadarObjectScale() const 125 { return this->scale_; } 126 115 127 void settingsChanged(); 116 128 … … 139 151 std::string radarObjectDescription_; 140 152 ColourValue radarObjectColour_; 141 153 float scale_; 142 154 }; 143 155 }
Note: See TracChangeset
for help on using the changeset viewer.