Changeset 1625 for code/trunk/src/orxonox/objects
- Timestamp:
- Jun 26, 2008, 2:13:17 PM (17 years ago)
- Location:
- code/trunk/src/orxonox/objects
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/objects/Ambient.cc
r1505 r1625 73 73 74 74 } 75 76 void Ambient:: loadParams(TiXmlElement* xmlElem)75 76 void Ambient::setAmbientLight(const ColourValue& colour) 77 77 { 78 if (xmlElem->Attribute("colourvalue")) 79 { 80 SubString colourvalues(xmlElem->Attribute("colourvalue"), ','); 81 82 float r, g, b; 83 convertValue<std::string, float>(&r, colourvalues[0]); 84 convertValue<std::string, float>(&g, colourvalues[1]); 85 convertValue<std::string, float>(&b, colourvalues[2]); 86 87 this->setAmbientLight(ColourValue(r, g, b)); 88 89 COUT(4) << "Loader: Set ambient light: "<<r<<" " << g << " " << b << std::endl << std::endl; 90 } 91 } 92 93 void Ambient::setAmbientLight(const ColourValue& colour) 94 { 95 GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour); 78 GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour); 96 79 ambientLight_=colour; 97 }80 } 98 81 99 82 /** -
code/trunk/src/orxonox/objects/Ambient.h
r1505 r1625 44 44 virtual ~Ambient(); 45 45 46 void loadParams(TiXmlElement* xmlElem);47 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 48 47 void setAmbientLight(const ColourValue& colour); -
code/trunk/src/orxonox/objects/NPC.cc
r1505 r1625 45 45 NPC::~NPC() 46 46 { 47 }48 49 void NPC::loadParams(TiXmlElement* xmlElem)50 {51 Model::loadParams(xmlElem);52 47 } 53 48 -
code/trunk/src/orxonox/objects/NPC.h
r1505 r1625 48 48 NPC(); 49 49 virtual ~NPC(); 50 virtual void loadParams(TiXmlElement* xmlElem);51 50 void tick(float dt); 52 51 void update(); -
code/trunk/src/orxonox/objects/SpaceShip.cc
r1608 r1625 43 43 #include "core/XMLPort.h" 44 44 #include "core/ConsoleCommand.h" 45 #include "core/input/InputManager.h"46 45 47 46 #include "network/Client.h" 48 47 49 #include "hud/HUD.h"50 48 #include "tools/ParticleInterface.h" 51 49 … … 118 116 this->timeToReload_ = 0; 119 117 120 this->setMouseEventCallback_ = false;121 118 this->bLMousePressed_ = false; 122 119 this->bRMousePressed_ = false; 123 120 this->mouseXRotation_ = 0; 124 121 this->mouseYRotation_ = 0; 125 this->mouseX_ = 0;126 this->mouseY_ = 0;127 122 this->myShip_ = false; 128 123 … … 142 137 this->teamNr_ = 0; 143 138 this->health_ = 100; 139 140 this->radarObject_ = static_cast<WorldEntity*>(this); 144 141 } 145 142 … … 161 158 delete this->backlight_; 162 159 163 if (this->setMouseEventCallback_)164 InputManager::removeMouseHandler("SpaceShip");165 166 160 if (this->cam_) 167 161 delete this->cam_; 168 169 if (!this->myShip_)170 HUD::getSingleton().removeRadarObject(this);171 162 } 172 163 } … … 177 168 myShip_=true; 178 169 else 179 HUD::getSingleton().addRadarObject(this,this->getProjectileColour());170 this->setRadarObjectColour(this->getProjectileColour()); 180 171 } 181 172 if(Model::create()) … … 418 409 419 410 currentDir_ = getOrientation()*initialDir_; 420 411 currentOrth_ = getOrientation()*initialOrth_; 421 412 422 413 if (this->cam_) -
code/trunk/src/orxonox/objects/SpaceShip.h
r1608 r1625 36 36 #include "Camera.h" 37 37 #include "Model.h" 38 #include "RadarViewable.h" 38 39 #include "tools/BillboardSet.h" 39 40 40 41 namespace orxonox 41 42 { 42 class _OrxonoxExport SpaceShip : public Model 43 class _OrxonoxExport SpaceShip : public Model, public RadarViewable 43 44 { 44 45 public: … … 131 132 Vector3 currentOrth_; 132 133 bool bInvertYAxis_; 133 bool setMouseEventCallback_;134 134 bool bLMousePressed_; 135 135 bool bRMousePressed_; -
code/trunk/src/orxonox/objects/WorldEntity.cc
r1602 r1625 95 95 } 96 96 97 void WorldEntity::loadParams(TiXmlElement* xmlElem)98 {99 100 BaseObject::loadParams(xmlElem);101 create();102 }103 104 97 105 98 void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll) -
code/trunk/src/orxonox/objects/WorldEntity.h
r1602 r1625 51 51 52 52 virtual void tick(float dt); 53 virtual void loadParams(TiXmlElement* xmlElem);54 53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 55 54 virtual inline bool create(){ return Synchronisable::create(); } … … 74 73 inline const Vector3& getPosition() const 75 74 { return this->node_->getPosition(); } 75 inline const Vector3& getWorldPosition() const 76 { return this->node_->getWorldPosition(); } 76 77 77 78 inline void translate(const Vector3& d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT) … … 101 102 inline const Ogre::Quaternion& getOrientation() 102 103 { return this->node_->getOrientation(); } 104 inline const Ogre::Quaternion& getWorldOrientation() 105 { return this->node_->getWorldOrientation(); } 103 106 inline void setOrientation(const Ogre::Quaternion& quat) 104 107 { this->node_->setOrientation(quat); }
Note: See TracChangeset
for help on using the changeset viewer.