Changeset 871 for code/trunk/src/orxonox/objects
- Timestamp:
- Mar 9, 2008, 4:44:36 PM (17 years ago)
- Location:
- code/trunk/src/orxonox/objects
- Files:
-
- 32 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/objects/Ambient.cc
r790 r871 40 40 #include "../core/CoreIncludes.h" 41 41 #include "../Orxonox.h" 42 #include "core/XMLPort.h" 42 43 43 44 #include "Ambient.h" … … 45 46 namespace orxonox 46 47 { 47 // create a template instantiations48 //template class _OrxonoxExport ClassIdentifier<Ambient>;49 50 48 CreateFactory(Ambient); 51 49 … … 61 59 void Ambient::loadParams(TiXmlElement* xmlElem) 62 60 { 63 Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager();64 65 61 if (xmlElem->Attribute("colourvalue")) 66 62 { … … 72 68 String2Number<float>(b, colourvalues[2]); 73 69 74 mgr->setAmbientLight(ColourValue(r,g,b));70 this->setAmbientLight(ColourValue(r, g, b)); 75 71 76 72 COUT(4) << "Loader: Set ambient light: "<<r<<" " << g << " " << b << std::endl << std::endl; 77 73 } 78 74 } 75 76 void Ambient::setAmbientLight(const ColourValue& colour) 77 { 78 Orxonox::getSingleton()->getSceneManager()->setAmbientLight(colour); 79 } 80 81 /** 82 @brief XML loading and saving. 83 @param xmlelement The XML-element 84 @param loading Loading (true) or saving (false) 85 @return The XML-element 86 */ 87 void Ambient::XMLPort(Element& xmlelement, bool loading) 88 { 89 BaseObject::XMLPort(xmlelement, loading); 90 91 XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, loading); 92 } 79 93 } -
code/trunk/src/orxonox/objects/Ambient.h
r790 r871 14 14 virtual ~Ambient(); 15 15 16 17 16 void loadParams(TiXmlElement* xmlElem); 17 virtual void XMLPort(Element& xmlelement, bool loading); 18 void setAmbientLight(const ColourValue& colour); 18 19 19 20 private: 20 21 21 22 22 23 }; 23 ExportClass(Ambient, Orxonox);24 24 } 25 25 -
code/trunk/src/orxonox/objects/Camera.h
r790 r871 14 14 virtual ~Camera(); 15 15 16 16 17 17 void loadParams(TiXmlElement* xmlElem); 18 18 19 19 private: 20 20 21 21 22 22 }; 23 ExportClass(Camera, Orxonox);24 23 } 25 24 -
code/trunk/src/orxonox/objects/Explosion.h
r790 r871 21 21 ParticleInterface* particle_; 22 22 }; 23 ExportClass(Explosion, Orxonox);24 23 } 25 24 -
code/trunk/src/orxonox/objects/Fighter.h
r790 r871 90 90 int emitterRate_; 91 91 }; 92 ExportClass(Fighter, Orxonox);93 92 } 94 93 -
code/trunk/src/orxonox/objects/Model.cc
r790 r871 33 33 #include "../core/CoreIncludes.h" 34 34 #include "../Orxonox.h" 35 #include "core/XMLPort.h" 35 36 36 37 #include "Model.h" … … 60 61 } 61 62 63 /** 64 @brief XML loading and saving. 65 @param xmlelement The XML-element 66 @param loading Loading (true) or saving (false) 67 @return The XML-element 68 */ 69 void Model::XMLPort(Element& xmlelement, bool loading) 70 { 71 WorldEntity::XMLPort(xmlelement, loading); 72 73 XMLPortParamLoadOnly(Model, "mesh", setMesh, xmlelement, loading); 74 75 create(); 76 } 77 78 void Model::setMesh(const std::string& meshname) 79 { 80 this->meshSrc_ = meshname; 81 } 82 62 83 bool Model::create(){ 63 84 if(meshSrc_.compare("")!=0){ … … 71 92 72 93 void Model::registerAllVariables(){ 73 registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING);94 // registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING); 74 95 } 75 96 } -
code/trunk/src/orxonox/objects/Model.h
r790 r871 18 18 virtual ~Model(); 19 19 virtual void loadParams(TiXmlElement* xmlElem); 20 virtual void XMLPort(Element& xmlelement, bool loading); 21 void setMesh(const std::string& meshname); 20 22 bool create(); 21 23 … … 25 27 void registerAllVariables(); 26 28 }; 27 ExportClass(Model, Orxonox);28 29 } 29 30 -
code/trunk/src/orxonox/objects/NPC.h
r790 r871 44 44 static int const NUMELEMENTS = 9; //number of elements 45 45 }; 46 ExportClass(NPC, Orxonox);47 48 46 } 49 47 #endif /* _NPC_H__ */ -
code/trunk/src/orxonox/objects/Projectile.h
r790 r871 28 28 Timer<Projectile> destroyTimer_; 29 29 }; 30 ExportClass(Projectile, Orxonox);31 30 } 32 31 -
code/trunk/src/orxonox/objects/Skybox.cc
r790 r871 38 38 #include "../core/CoreIncludes.h" 39 39 #include "../core/Debug.h" 40 #include "core/XMLPort.h" 40 41 41 42 #include "Skybox.h" … … 56 57 void Skybox::loadParams(TiXmlElement* xmlElem) 57 58 { 58 Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager();59 60 59 if (xmlElem->Attribute("src")) 61 60 { 62 61 std::string skyboxSrc = xmlElem->Attribute("src"); 63 mgr->setSkyBox(true,skyboxSrc);62 this->setSkybox(skyboxSrc); 64 63 65 64 COUT(4) << "Loader: Set skybox: "<< skyboxSrc << std::endl << std::endl; 66 65 } 67 66 } 67 68 void Skybox::setSkybox(const std::string& skyboxname) 69 { 70 Orxonox::getSingleton()->getSceneManager()->setSkyBox(true, skyboxname); 71 } 72 73 /** 74 @brief XML loading and saving. 75 @param xmlelement The XML-element 76 @param loading Loading (true) or saving (false) 77 @return The XML-element 78 */ 79 void Skybox::XMLPort(Element& xmlelement, bool loading) 80 { 81 BaseObject::XMLPort(xmlelement, loading); 82 83 XMLPortParamLoadOnly(Skybox, "src", setSkybox, xmlelement, loading); 84 } 68 85 } -
code/trunk/src/orxonox/objects/Skybox.h
r790 r871 16 16 virtual ~Skybox(); 17 17 18 19 18 void loadParams(TiXmlElement* xmlElem); 19 virtual void XMLPort(Element& xmlelement, bool loading); 20 void setSkybox(const std::string& skyboxname); 20 21 21 22 private: 22 23 23 24 24 25 }; 25 ExportClass(Skybox, Orxonox);26 26 } 27 27 -
code/trunk/src/orxonox/objects/SpaceShip.cc
r790 r871 44 44 #include "../particle/ParticleInterface.h" 45 45 #include "Projectile.h" 46 #include "core/XMLPort.h" 46 47 47 48 #include "SpaceShip.h" … … 123 124 this->brakeLoop(loop); 124 125 */ 126 this->init(); 127 125 128 COUT(3) << "Info: SpaceShip was loaded" << std::endl; 126 129 } … … 132 135 } 133 136 134 void SpaceShip::setConfigValues() 135 { 136 SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down)."); 137 SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds"); 138 SetConfigValue(testvector_, Vector3()).description("asdfblah"); 139 } 140 141 void SpaceShip::loadParams(TiXmlElement* xmlElem) 142 { 143 Model::loadParams(xmlElem); 144 145 137 void SpaceShip::init() 138 { 146 139 // START CREATING THRUSTER 147 140 this->tt_ = new ParticleInterface(Orxonox::getSingleton()->getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow"); … … 197 190 198 191 // END of testing crosshair 199 192 } 193 194 void SpaceShip::setConfigValues() 195 { 196 SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down)."); 197 SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds"); 198 SetConfigValue(testvector_, Vector3()).description("asdfblah"); 199 } 200 201 void SpaceShip::loadParams(TiXmlElement* xmlElem) 202 { 203 Model::loadParams(xmlElem); 200 204 /* 201 205 if (xmlElem->Attribute("forward") && xmlElem->Attribute("rotateupdown") && xmlElem->Attribute("rotaterightleft") && xmlElem->Attribute("looprightleft")) … … 242 246 if (xmlElem->Attribute("camera")) 243 247 { 244 Ogre::Camera *cam = Orxonox::getSingleton()->getSceneManager()->createCamera("ShipCam"); 245 this->camNode_ = this->getNode()->createChildSceneNode("CamNode"); 246 /* 247 // node->setInheritOrientation(false); 248 cam->setPosition(Vector3(0,50,-150)); 249 cam->lookAt(Vector3(0,20,0)); 250 cam->roll(Degree(0)); 251 */ 252 253 cam->setPosition(Vector3(-200,0,35)); 254 // cam->setPosition(Vector3(0,-350,0)); 255 cam->lookAt(Vector3(0,0,35)); 256 cam->roll(Degree(-90)); 257 258 this->camNode_->attachObject(cam); 259 Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam); 248 this->setCamera(); 260 249 } 250 } 251 252 void SpaceShip::setCamera(const std::string& camera) 253 { 254 Ogre::Camera *cam = Orxonox::getSingleton()->getSceneManager()->createCamera("ShipCam"); 255 this->camNode_ = this->getNode()->createChildSceneNode("CamNode"); 256 /* 257 // node->setInheritOrientation(false); 258 cam->setPosition(Vector3(0,50,-150)); 259 cam->lookAt(Vector3(0,20,0)); 260 cam->roll(Degree(0)); 261 */ 262 263 cam->setPosition(Vector3(-200,0,35)); 264 // cam->setPosition(Vector3(0,-350,0)); 265 cam->lookAt(Vector3(0,0,35)); 266 cam->roll(Degree(-90)); 267 268 this->camNode_->attachObject(cam); 269 Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam); 270 } 271 272 void SpaceShip::setMaxSpeed(float value) 273 { this->maxSpeed_ = value; } 274 void SpaceShip::setMaxSideAndBackSpeed(float value) 275 { this->maxSideAndBackSpeed_ = value; } 276 void SpaceShip::setMaxRotation(float value) 277 { this->maxRotation_ = value; this->maxRotationRadian_ = Radian(value); } 278 void SpaceShip::setTransAcc(float value) 279 { this->translationAcceleration_ = value; } 280 void SpaceShip::setRotAcc(float value) 281 { this->rotationAcceleration_ = value; this->rotationAccelerationRadian_ = Radian(value); } 282 void SpaceShip::setTransDamp(float value) 283 { this->translationDamping_ = value; } 284 void SpaceShip::setRotDamp(float value) 285 { this->rotationDamping_ = value; this->rotationDampingRadian_ = Radian(value); } 286 287 /** 288 @brief XML loading and saving. 289 @param xmlelement The XML-element 290 @param loading Loading (true) or saving (false) 291 @return The XML-element 292 */ 293 void SpaceShip::XMLPort(Element& xmlelement, bool loading) 294 { 295 Model::XMLPort(xmlelement, loading); 296 297 XMLPortParamLoadOnly(SpaceShip, "camera", setCamera, xmlelement, loading); 298 XMLPortParamLoadOnly(SpaceShip, "maxSpeed", setMaxSpeed, xmlelement, loading); 299 XMLPortParamLoadOnly(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, xmlelement, loading); 300 XMLPortParamLoadOnly(SpaceShip, "maxRotation", setMaxRotation, xmlelement, loading); 301 XMLPortParamLoadOnly(SpaceShip, "transAcc", setTransAcc, xmlelement, loading); 302 XMLPortParamLoadOnly(SpaceShip, "rotAcc", setRotAcc, xmlelement, loading); 303 XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, loading); 304 XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, loading); 261 305 } 262 306 -
code/trunk/src/orxonox/objects/SpaceShip.h
r790 r871 21 21 SpaceShip(); 22 22 ~SpaceShip(); 23 void init(); 23 24 void setConfigValues(); 24 25 virtual void loadParams(TiXmlElement* xmlElem); 26 virtual void XMLPort(Element& xmlelement, bool loading); 25 27 virtual void tick(float dt); 28 29 void setCamera(const std::string& camera = ""); 30 void setMaxSpeed(float value); 31 void setMaxSideAndBackSpeed(float value); 32 void setMaxRotation(float value); 33 void setTransAcc(float value); 34 void setRotAcc(float value); 35 void setTransDamp(float value); 36 void setRotDamp(float value); 26 37 27 38 bool mouseMoved(const OIS::MouseEvent &e); … … 75 86 int emitterRate_; 76 87 }; 77 ExportClass(SpaceShip, Orxonox);78 88 } 79 89 -
code/trunk/src/orxonox/objects/SpaceshipSteeringObject.cc
r790 r871 40 40 #include "util/Tokenizer.h" 41 41 #include "util/String2Number.h" 42 #include "../core/Debug.h" 43 42 #include "core/CoreIncludes.h" 44 43 #include "SpaceshipSteeringObject.h" 45 44 -
code/trunk/src/orxonox/objects/Test.h
r790 r871 30 30 31 31 #include "core/BaseObject.h" 32 #include "../core/CoreIncludes.h"33 32 34 33 namespace orxonox … … 74 73 public: 75 74 A1B2() { RegisterObject(A1B2); } 75 // virtual void test() = 0; 76 76 }; 77 77 … … 116 116 public: 117 117 A1B2C1() { RegisterObject(A1B2C1); } 118 // void test() { std::cout << "test!\n"; } 118 119 }; 119 120 -
code/trunk/src/orxonox/objects/Tickable.h
r790 r871 44 44 45 45 #include "../OrxonoxPrereqs.h" 46 47 #include "../core/CoreIncludes.h" 46 #include "core/OrxonoxClass.h" 48 47 49 48 namespace orxonox … … 62 61 63 62 protected: 64 /** 65 @brief Constructor: Registers the object in the Tickable-list 66 */ 67 Tickable() { RegisterRootObject(Tickable); } 63 Tickable(); 68 64 }; 69 ExportAbstractClass(Tickable, Orxonox);70 65 71 66 //! The TickFrameListener calls the tick(dt) function of all Tickables every frame. -
code/trunk/src/orxonox/objects/WorldEntity.cc
r790 r871 37 37 #include "../Orxonox.h" 38 38 #include "WorldEntity.h" 39 #include "core/XMLPort.h" 39 40 40 41 namespace orxonox … … 86 87 void WorldEntity::loadParams(TiXmlElement* xmlElem) 87 88 { 89 88 90 BaseObject::loadParams(xmlElem); 89 91 /* 90 92 if (xmlElem->Attribute("position")) 91 93 { … … 153 155 154 156 create(); 155 157 */ 158 } 159 160 void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll) 161 { 162 this->yaw(yaw); 163 this->pitch(pitch); 164 this->roll(roll); 165 } 166 167 /** 168 @brief XML loading and saving. 169 @param xmlelement The XML-element 170 @param loading Loading (true) or saving (false) 171 @return The XML-element 172 */ 173 void WorldEntity::XMLPort(Element& xmlelement, bool loading) 174 { 175 BaseObject::XMLPort(xmlelement, loading); 176 177 XMLPortParam(WorldEntity, "position", setPositionLoader2, getPosition, xmlelement, loading); 178 XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionLoader, xmlelement, loading); 179 XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, loading); 180 XMLPortParam(WorldEntity, "scale", setTotalScale, getScale, xmlelement, loading); 181 XMLPortParam(WorldEntity, "rotationAxis", setRotationAxisLoader, getRotationAxis, xmlelement, loading); 182 XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, loading); 183 184 XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, loading); 156 185 } 157 186 … … 163 192 void WorldEntity::registerAllVariables() 164 193 { 165 // register coordinates194 /* // register coordinates 166 195 registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA); 167 196 registerVar( (void*) &(this->getPosition().y), sizeof(this->getPosition().y), network::DATA); … … 171 200 registerVar( (void*) &(this->getOrientation().x), sizeof(this->getOrientation().x), network::DATA); 172 201 registerVar( (void*) &(this->getOrientation().y), sizeof(this->getOrientation().y), network::DATA); 173 registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA); 202 registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA);*/ 174 203 // not needed at the moment, because we don't have prediction yet 175 204 /*// register velocity_ … … 183 212 registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA);*/ 184 213 } 214 215 void WorldEntity::attachWorldEntity(WorldEntity* entity) 216 { 217 this->attachedWorldEntities_.push_back(entity); 218 } 219 220 const WorldEntity* WorldEntity::getAttachedWorldEntity(unsigned int index) 221 { 222 if (index < this->attachedWorldEntities_.size()) 223 return this->attachedWorldEntities_[index]; 224 else 225 return 0; 226 } 185 227 } -
code/trunk/src/orxonox/objects/WorldEntity.h
r790 r871 8 8 9 9 #include "util/Math.h" 10 #include "util/XMLIncludes.h" 10 11 #include "network/Synchronisable.h" 11 #include "util/tinyxml/tinyxml.h" 12 #include "../core/CoreIncludes.h" 12 //#include "util/tinyxml/tinyxml.h" 13 13 #include "core/BaseObject.h" 14 14 #include "Tickable.h" … … 17 17 namespace orxonox 18 18 { 19 class _OrxonoxExport WorldEntity : public BaseObject, public Tickable, public network::Synchronisable20 {21 public:22 WorldEntity();23 virtual ~WorldEntity();19 class _OrxonoxExport WorldEntity : public BaseObject, public Tickable//, public network::Synchronisable 20 { 21 public: 22 WorldEntity(); 23 virtual ~WorldEntity(); 24 24 25 virtual void tick(float dt); 26 virtual void loadParams(TiXmlElement* xmlElem); 27 bool create(); 25 virtual void tick(float dt); 26 virtual void loadParams(TiXmlElement* xmlElem); 27 virtual void XMLPort(Element& xmlelement, bool loading); 28 bool create(); 28 29 29 inline Ogre::SceneNode* getNode()30 { return this->node_; }30 void attachWorldEntity(WorldEntity* entity); 31 const WorldEntity* getAttachedWorldEntity(unsigned int index); 31 32 32 inline void setNode(Ogre::SceneNode* node)33 { this->node_ = node; }33 inline Ogre::SceneNode* getNode() 34 { return this->node_; } 34 35 35 inline void setPosition(const Vector3& pos) 36 { this->node_->setPosition(pos); } 37 inline void setPosition(Real x, Real y, Real z) 38 { this->node_->setPosition(x, y, z); } 39 inline const Vector3& getPosition() const 40 { return this->node_->getPosition(); } 36 inline void setNode(Ogre::SceneNode* node) 37 { this->node_ = node; } 41 38 42 inline void translate(const Vector3 &d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT) 43 { this->node_->translate(d, relativeTo); } 44 inline void translate(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT) 45 { this->node_->translate(x, y, z, relativeTo); } 46 inline void translate(const Matrix3 &axes, const Vector3 &move, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT) 47 { this->node_->translate(axes, move, relativeTo); } 48 inline void translate(const Matrix3 &axes, Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT) 49 { this->node_->translate(axes, x, y, z, relativeTo); } 39 inline void setPosition(const Vector3& pos) 40 { this->node_->setPosition(pos); } 41 inline void setPositionLoader1(const Vector3& pos) 42 { this->node_->setPosition(pos); } 43 inline void setPositionLoader2(Real x, Real y, Real z) 44 { this->node_->setPosition(x, y, z); } 45 inline void setPosition(Real x, Real y, Real z) 46 { this->node_->setPosition(x, y, z); } 47 inline const Vector3& getPosition() const 48 { return this->node_->getPosition(); } 50 49 51 inline void yaw(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL) 52 { this->node_->yaw(angle, relativeTo); } 53 inline void pitch(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL) 54 { this->node_->pitch(angle, relativeTo); } 55 inline void roll(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL) 56 { this->node_->roll(angle, relativeTo); } 50 inline void translate(const Vector3 &d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT) 51 { this->node_->translate(d, relativeTo); } 52 inline void translate(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT) 53 { this->node_->translate(x, y, z, relativeTo); } 54 inline void translate(const Matrix3 &axes, const Vector3 &move, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT) 55 { this->node_->translate(axes, move, relativeTo); } 56 inline void translate(const Matrix3 &axes, Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT) 57 { this->node_->translate(axes, x, y, z, relativeTo); } 57 58 58 inline const Ogre::Quaternion& getOrientation() 59 { return this->node_->getOrientation(); } 60 inline void setOrientation(const Ogre::Quaternion& quat) 61 { this->node_->setOrientation(quat); } 62 inline void rotate(const Vector3 &axis, const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL) 63 { this->node_->rotate(axis, angle, relativeTo); } 64 inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z) 65 { this->node_->setDirection(x, y, z, relativeTo, localDirectionVector); } 66 inline void setDirection(const Vector3 &vec, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z) 67 { this->node_->setDirection(vec, relativeTo, localDirectionVector); } 68 inline void lookAt(const Vector3 &targetPoint, Ogre::Node::TransformSpace relativeTo, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z) 69 { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); } 59 inline void yaw(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL) 60 { this->node_->yaw(angle, relativeTo); } 61 inline void pitch(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL) 62 { this->node_->pitch(angle, relativeTo); } 63 inline void roll(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL) 64 { this->node_->roll(angle, relativeTo); } 65 void setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll); 70 66 71 inline void setScale(const Vector3 &scale) 72 { this->node_->setScale(scale); } 73 inline void setScale(Real x, Real y, Real z) 74 { this->node_->setScale(x, y, z); } 75 inline void setScale(Real scale) 76 { this->node_->setScale(scale, scale, scale); } 77 inline const Vector3& getScale(void) const 78 { return this->node_->getScale(); } 79 inline void scale(const Vector3 &scale) 80 { this->node_->scale(scale); } 81 inline void scale(Real x, Real y, Real z) 82 { this->node_->scale(x, y, z); } 83 inline void scale(Real scale) 84 { this->node_->scale(scale, scale, scale); } 67 inline void setYaw(const Degree &angle) 68 { this->node_->yaw(angle, Ogre::Node::TS_LOCAL); } 69 inline void setPitch(const Degree &angle) 70 { this->node_->pitch(angle, Ogre::Node::TS_LOCAL); } 71 inline void setRoll(const Degree &angle) 72 { this->node_->roll(angle, Ogre::Node::TS_LOCAL); } 85 73 86 inline void attachObject(Ogre::MovableObject *obj) 87 { this->node_->attachObject(obj); } 88 inline void attachObject(Mesh &mesh) 89 { this->node_->attachObject(mesh.getEntity()); } 90 inline void detachObject(Ogre::MovableObject *obj) 91 { this->node_->detachObject(obj); } 92 inline void detachAllObjects() 93 { this->node_->detachAllObjects(); } 74 inline const Ogre::Quaternion& getOrientation() 75 { return this->node_->getOrientation(); } 76 inline void setOrientation(const Ogre::Quaternion& quat) 77 { this->node_->setOrientation(quat); } 78 inline void rotate(const Vector3 &axis, const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL) 79 { this->node_->rotate(axis, angle, relativeTo); } 80 inline void setDirectionLoader(Real x, Real y, Real z) 81 { this->setDirection(x, y, z); } 82 inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z) 83 { this->node_->setDirection(x, y, z, relativeTo, localDirectionVector); } 84 inline void setDirection(const Vector3 &vec, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z) 85 { this->node_->setDirection(vec, relativeTo, localDirectionVector); } 86 inline void lookAt(const Vector3 &targetPoint, Ogre::Node::TransformSpace relativeTo, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z) 87 { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); } 94 88 95 inline void setVelocity(const Vector3& velocity) 96 { this->velocity_ = velocity; } 97 inline void setVelocity(Real x, Real y, Real z) 98 { this->velocity_.x = x; this->velocity_.y = y; this->velocity_.z = z; } 99 inline const Vector3& getVelocity() const 100 { return this->velocity_; } 89 inline void setScale(const Vector3 &scale) 90 { this->node_->setScale(scale); } 91 inline void setScale(Real x, Real y, Real z) 92 { this->node_->setScale(x, y, z); } 93 inline void setScale(Real scale) 94 { this->node_->setScale(scale, scale, scale); } 95 inline void setTotalScale(Real scale) 96 { this->node_->setScale(scale, scale, scale); } 97 inline const Vector3& getScale(void) const 98 { return this->node_->getScale(); } 99 inline void scale(const Vector3 &scale) 100 { this->node_->scale(scale); } 101 inline void scale(Real x, Real y, Real z) 102 { this->node_->scale(x, y, z); } 103 inline void scale(Real scale) 104 { this->node_->scale(scale, scale, scale); } 101 105 102 inline void setAcceleration(const Vector3& acceleration) 103 { this->acceleration_ = acceleration; } 104 inline void setAcceleration(Real x, Real y, Real z) 105 { this->acceleration_.x = x; this->acceleration_.y = y; this->acceleration_.z = z; } 106 inline const Vector3& getAcceleration() const 107 { return this->acceleration_; } 106 inline void attachObject(Ogre::MovableObject *obj) 107 { this->node_->attachObject(obj); } 108 inline void attachObject(Mesh &mesh) 109 { this->node_->attachObject(mesh.getEntity()); } 110 inline void detachObject(Ogre::MovableObject *obj) 111 { this->node_->detachObject(obj); } 112 inline void detachAllObjects() 113 { this->node_->detachAllObjects(); } 108 114 109 inline void setRotationAxis(const Vector3& axis)110 { this->rotationAxis_ = axis; }111 inline void setRotationAxis(Real x, Real y, Real z)112 { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; }113 inline const Vector3& getRotationAxis() const114 { return this->rotationAxis_; }115 inline void setVelocity(const Vector3& velocity) 116 { this->velocity_ = velocity; } 117 inline void setVelocity(Real x, Real y, Real z) 118 { this->velocity_.x = x; this->velocity_.y = y; this->velocity_.z = z; } 119 inline const Vector3& getVelocity() const 120 { return this->velocity_; } 115 121 116 inline void setRotationRate(const Radian& angle)117 { this->rotationRate_ = angle; }118 inline void setRotationRate(const Degree& angle)119 { this->rotationRate_ = angle; }120 inline const Radian& getRotationRate() const121 { return this->rotationRate_; }122 inline void setAcceleration(const Vector3& acceleration) 123 { this->acceleration_ = acceleration; } 124 inline void setAcceleration(Real x, Real y, Real z) 125 { this->acceleration_.x = x; this->acceleration_.y = y; this->acceleration_.z = z; } 126 inline const Vector3& getAcceleration() const 127 { return this->acceleration_; } 122 128 123 inline void setMomentum(const Radian& angle) 124 { this->momentum_ = angle; } 125 inline void setMomentum(const Degree& angle) 126 { this->momentum_ = angle; } 127 inline const Radian& getMomentum() const 128 { return this->momentum_; } 129 inline void setRotationAxisLoader(const Vector3& axis) 130 { this->rotationAxis_ = axis; } 131 inline void setRotationAxis(const Vector3& axis) 132 { this->rotationAxis_ = axis; } 133 inline void setRotationAxis(Real x, Real y, Real z) 134 { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; } 135 inline const Vector3& getRotationAxis() const 136 { return this->rotationAxis_; } 129 137 130 inline void setStatic(bool bStatic) 131 { this->bStatic_ = bStatic; } 132 inline bool isStatic() 133 { return this->bStatic_; } 138 // inline void setRotationRate(const Radian& angle) 139 // { this->rotationRate_ = angle; } 140 inline void setRotationRate(const Degree& angle) 141 { this->rotationRate_ = angle; this->setStatic(angle == Degree(0)); } 142 inline const Radian& getRotationRate() const 143 { return this->rotationRate_; } 134 144 135 protected: 136 void registerAllVariables(); 145 inline void setMomentum(const Radian& angle) 146 { this->momentum_ = angle; } 147 inline void setMomentum(const Degree& angle) 148 { this->momentum_ = angle; } 149 inline const Radian& getMomentum() const 150 { return this->momentum_; } 137 151 138 Vector3 velocity_; 139 Vector3 acceleration_; 140 Vector3 rotationAxis_; 141 Radian rotationRate_; 142 Radian momentum_; 152 inline void setStatic(bool bStatic) 153 { this->bStatic_ = bStatic; } 154 inline bool isStatic() 155 { return this->bStatic_; } 143 156 144 private: 145 static unsigned int worldEntityCounter_s; 146 Ogre::SceneNode* node_; 147 bool bStatic_; 148 }; 149 ExportClass(WorldEntity, Orxonox); 157 protected: 158 void registerAllVariables(); 159 160 Vector3 velocity_; 161 Vector3 acceleration_; 162 Vector3 rotationAxis_; 163 Radian rotationRate_; 164 Radian momentum_; 165 166 private: 167 static unsigned int worldEntityCounter_s; 168 Ogre::SceneNode* node_; 169 bool bStatic_; 170 std::vector<WorldEntity*> attachedWorldEntities_; 171 }; 150 172 } 151 173 -
code/trunk/src/orxonox/objects/test1.cc
r790 r871 29 29 #include "test2.h" 30 30 #include "test3.h" 31 #include "util/tinyxml/tinyxml.h" 32 #include "../Orxonox.h" 33 #include <OgreSceneManager.h> 31 #include "core/CoreIncludes.h" 34 32 35 33 namespace orxonox -
code/trunk/src/orxonox/objects/test2.cc
r790 r871 29 29 #include "test2.h" 30 30 #include "test3.h" 31 #include "core/CoreIncludes.h" 31 32 32 33 namespace orxonox -
code/trunk/src/orxonox/objects/test3.cc
r790 r871 29 29 #include "test2.h" 30 30 #include "test3.h" 31 #include "core/CoreIncludes.h" 31 32 32 33 namespace orxonox … … 63 64 void Test3::configOutput() 64 65 { 65 std::cout << this->value_int_ << std::endl;66 std::cout << this->value_uint_ << std::endl;67 std::cout << (int)this->value_char_ << std::endl;68 std::cout << (int)this->value_uchar_ << std::endl;69 std::cout << this->value_float_ << std::endl;70 std::cout << this->value_double_ << std::endl;71 std::cout << this->value_bool_ << std::endl;72 std::cout << this->value_string_ << std::endl;73 std::cout << this->value_constchar_ << std::endl;74 std::cout << this->value_vector2_ << std::endl;75 std::cout << this->value_vector3_ << std::endl;76 std::cout << this->value_colourvalue_ << std::endl;66 std::cout << "int: " << this->value_int_ << std::endl; 67 std::cout << "uint: " << this->value_uint_ << std::endl; 68 std::cout << "char: " << (int)this->value_char_ << std::endl; 69 std::cout << "uchar: " << (int)this->value_uchar_ << std::endl; 70 std::cout << "float: " << this->value_float_ << std::endl; 71 std::cout << "double: " << this->value_double_ << std::endl; 72 std::cout << "bool: " << this->value_bool_ << std::endl; 73 std::cout << "string: " << this->value_string_ << std::endl; 74 std::cout << "constchar: " << this->value_constchar_ << std::endl; 75 std::cout << "vector2: " << this->value_vector2_ << std::endl; 76 std::cout << "vector3: " << this->value_vector3_ << std::endl; 77 std::cout << "colourvalue: " << this->value_colourvalue_ << std::endl; 77 78 } 78 79 -
code/trunk/src/orxonox/objects/test3.h
r790 r871 3 3 4 4 #include "core/BaseObject.h" 5 #include "util/Math.h" 5 6 6 7 namespace orxonox -
code/trunk/src/orxonox/objects/weapon/AmmunitionDump.cc
r790 r871 31 31 #include "BulletManager.h" 32 32 #include "util/tinyxml/tinyxml.h" 33 #include "core/CoreIncludes.h" 33 34 34 35 #include "AmmunitionDump.h" -
code/trunk/src/orxonox/objects/weapon/AmmunitionDump.h
r790 r871 37 37 38 38 #include "network/Synchronisable.h" 39 //#include "../core/CoreIncludes.h"40 39 #include "core/BaseObject.h" 41 40 … … 66 65 int *capacity_; 67 66 }; 68 ExportClass(AmmunitionDump, Orxonox);69 67 } 70 68 -
code/trunk/src/orxonox/objects/weapon/BarrelGun.cc
r790 r871 38 38 #include "AmmunitionDump.h" 39 39 #include "BaseWeapon.h" 40 #include "core/CoreIncludes.h" 40 41 41 42 #include "BarrelGun.h" -
code/trunk/src/orxonox/objects/weapon/BarrelGun.h
r790 r871 60 60 61 61 }; 62 ExportClass(BarrelGun, Orxonox);63 62 } 64 63 -
code/trunk/src/orxonox/objects/weapon/BaseWeapon.cc
r790 r871 38 38 #include "BulletManager.h" 39 39 #include "AmmunitionDump.h" 40 #include "core/CoreIncludes.h" 40 41 41 42 #include "BaseWeapon.h" -
code/trunk/src/orxonox/objects/weapon/BaseWeapon.h
r790 r871 122 122 123 123 }; 124 ExportAbstractClass(BaseWeapon, Orxonox);125 124 } 126 125 -
code/trunk/src/orxonox/objects/weapon/Bullet.cc
r790 r871 27 27 28 28 #include "OrxonoxStableHeaders.h" 29 #include "core/CoreIncludes.h" 29 30 30 31 #include "Bullet.h" -
code/trunk/src/orxonox/objects/weapon/Bullet.h
r790 r871 47 47 inline virtual void loadParams(TiXmlElement* xmlElem) { Model::loadParams(xmlElem); }; 48 48 }; 49 ExportClass(Bullet, Orxonox);50 49 } 51 50 -
code/trunk/src/orxonox/objects/weapon/BulletManager.cc
r790 r871 30 30 #include "BulletManager.h" 31 31 #include "Bullet.h" 32 #include "core/CoreIncludes.h" 32 33 33 34 -
code/trunk/src/orxonox/objects/weapon/BulletManager.h
r790 r871 38 38 #include "network/Synchronisable.h" 39 39 #include "util/tinyxml/tinyxml.h" 40 #include "../../core/CoreIncludes.h"41 40 #include "core/BaseObject.h" 42 41 #include "../Tickable.h" … … 67 66 int bulletsIndex_; 68 67 }; 69 ExportClass(BulletManager, Orxonox);70 68 } 71 69
Note: See TracChangeset
for help on using the changeset viewer.