Changeset 1592
- Timestamp:
- Jun 12, 2008, 4:32:10 AM (16 years ago)
- Location:
- code/branches/core3/src
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/audio/AudioManager.h
r1535 r1592 58 58 void setOri(std::vector<float> at, std::vector<float> up); 59 59 60 // Parses given xml string61 void loadParams();62 63 60 // Update 64 61 void tick(float dt); -
code/branches/core3/src/core/BaseObject.cc
r1559 r1592 66 66 67 67 /** 68 @brief load general xml paramters69 */70 void BaseObject::loadParams(TiXmlElement* xmlElem)71 {72 if (xmlElem->Attribute("name"))73 {74 this->setName(xmlElem->Attribute("name"));75 }76 }77 78 /**79 68 @brief XML loading and saving. 80 69 @param xmlelement The XML-element -
code/branches/core3/src/core/BaseObject.h
r1558 r1592 52 52 BaseObject(); 53 53 virtual ~BaseObject(); 54 virtual void loadParams(TiXmlElement* xmlElem);55 54 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 56 55 -
code/branches/core3/src/core/Functor.h
r1586 r1592 80 80 CreateTypeToStringTemplate(Degree); 81 81 82 template <> \83 inline std::string typeToString<std::string>() { return "string"; } \84 template <> \85 inline std::string typeToString<std::string&>() { return "string"; } \86 template <> \87 inline std::string typeToString<const std::string>() { return "string"; } \88 template <> \82 template <> 83 inline std::string typeToString<std::string>() { return "string"; } 84 template <> 85 inline std::string typeToString<std::string&>() { return "string"; } 86 template <> 87 inline std::string typeToString<const std::string>() { return "string"; } 88 template <> 89 89 inline std::string typeToString<const std::string&>() { return "string"; } 90 90 -
code/branches/core3/src/core/Identifier.cc
r1591 r1592 42 42 #include "ObjectList.h" 43 43 #include "OrxonoxClass.h" 44 #include "XMLPort.h" 44 45 45 46 namespace orxonox … … 206 207 207 208 /** 209 @brief Tells the container to which Identifier it belongs to. 210 */ 211 void Identifier::addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container) 212 { 213 container->setIdentifier(this); 214 } 215 216 /** 208 217 @brief Returns true, if the Identifier is at least of the given type. 209 218 @param identifier The identifier to compare with -
code/branches/core3/src/core/Identifier.h
r1591 r1592 206 206 ConfigValueContainer* getLowercaseConfigValueContainer(const std::string& varname); 207 207 208 virtual void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container) = 0;208 virtual void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container); 209 209 virtual XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname) = 0; 210 210 … … 313 313 ~ClassIdentifier() {} // don't delete 314 314 315 std::map<std::string, XMLPortClassParamContainer< T>*> xmlportParamContainers_; //!< All loadable parameters315 std::map<std::string, XMLPortClassParamContainer<class O>*> xmlportParamContainers_; //!< All loadable parameters 316 316 std::map<std::string, XMLPortClassObjectContainer<T, class O>*> xmlportObjectContainers_; //!< All attachable objects 317 317 … … 427 427 XMLPortParamContainer* ClassIdentifier<T>::getXMLPortParamContainer(const std::string& paramname) 428 428 { 429 typename std::map<std::string, XMLPortClassParamContainer< T>*>::const_iterator it = xmlportParamContainers_.find(paramname);429 typename std::map<std::string, XMLPortClassParamContainer<class O>*>::const_iterator it = xmlportParamContainers_.find(paramname); 430 430 if (it != xmlportParamContainers_.end()) 431 431 return (XMLPortParamContainer*)((*it).second); … … 442 442 void ClassIdentifier<T>::addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container) 443 443 { 444 this->xmlportParamContainers_[paramname] = (XMLPortClassParamContainer<T>*)container; 444 Identifier::addXMLPortParamContainer(paramname, container); 445 this->xmlportParamContainers_[paramname] = (XMLPortClassParamContainer<class O>*)container; 445 446 } 446 447 -
code/branches/core3/src/core/XMLPort.h
r1586 r1592 42 42 43 43 #define XMLPortParam(classname, paramname, loadfunction, savefunction, xmlelement, mode) \ 44 XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction),#savefunction), xmlelement, mode)45 #define XMLPortParam _Template(classname, paramname, loadtemplate, loadfunction, savetemplate, savefunction, xmlelement, mode) \46 XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, paramname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor savetemplate (&classname::savefunction),#savefunction), xmlelement, mode)44 XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode) 45 #define XMLPortParamTemplate(classname, paramname, loadfunction, savefunction, xmlelement, mode, ...) \ 46 XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode) 47 47 48 48 #define XMLPortParamLoadOnly(classname, paramname, loadfunction, xmlelement, mode) \ 49 XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), 0, xmlelement, mode) 50 #define XMLPortParamLoadOnly_Template(classname, paramname, loadtemplate, loadfunction, xmlelement, mode) \ 51 XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, paramname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), 0, xmlelement, mode) 52 53 #define XMLPortParamGeneric(containername, classname, paramname, loadexecutor, saveexecutor, xmlelement, mode) \ 49 XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), 0, xmlelement, mode) 50 #define XMLPortParamLoadOnlyTemplate(classname, paramname, loadfunction, xmlelement, mode, ...) \ 51 XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), 0, xmlelement, mode) 52 53 #define XMLPortParamExtern(classname, object, paramname, loadfunction, savefunction, xmlelement, mode) \ 54 XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, object, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode); 55 #define XMLPortParamExternTemplate(classname, object, paramname, loadfunction, savefunction, xmlelement, mode, ...) \ 56 XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, object, paramname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode); 57 58 #define XMLPortParamGeneric(containername, classname, object, paramname, loadexecutor, saveexecutor, xmlelement, mode) \ 54 59 orxonox::XMLPortClassParamContainer<classname>* containername = (orxonox::XMLPortClassParamContainer<classname>*)(this->getIdentifier()->getXMLPortParamContainer(paramname)); \ 55 60 if (!containername) \ … … 58 63 this->getIdentifier()->addXMLPortParamContainer(paramname, containername); \ 59 64 } \ 60 containername->port( this, xmlelement, mode)65 containername->port(object, xmlelement, mode) 61 66 62 67 63 68 #define XMLPortObject(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \ 64 XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction),#savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)65 #define XMLPortObject _Template(classname, objectclass, sectionname, loadtemplate, loadfunction, savetemplate, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \66 XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor savetemplate (&classname::savefunction),#savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)69 XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore) 70 #define XMLPortObjectTemplate(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore, ...) \ 71 XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore) 67 72 68 73 #define XMLPortObjectGeneric(containername, classname, objectclass, sectionname, loadexecutor, saveexecutor, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \ … … 98 103 inline const std::string& getName() const 99 104 { return this->paramname_; } 105 inline void setIdentifier(Identifier* identifier) 106 { this->identifier_ = identifier; } 100 107 101 108 virtual XMLPortParamContainer& description(const std::string description) = 0; … … 112 119 std::string paramname_; 113 120 ParseResult parseResult_; 114 121 Identifier* identifier_; 115 122 }; 116 123 … … 146 153 if ((attribute.size() > 0) || (this->loadexecutor_->allDefaultValuesSet())) 147 154 { 148 COUT(5) << ((BaseObject*)object)->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << object->getIdentifier()->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")." << std::endl << ((BaseObject*)object)->getLoaderIndentation();155 COUT(5) << ((BaseObject*)object)->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")." << std::endl << ((BaseObject*)object)->getLoaderIndentation(); 149 156 if (this->loadexecutor_->parse(object, attribute, ",")) 150 157 this->parseResult_ = PR_finished; … … 156 163 { 157 164 COUT(1) << std::endl; 158 COUT(1) << "An error occurred in XMLPort.h while loading attribute '" << this->paramname_ << "' of '" << object->getIdentifier()->getName() << "' (objectname: " << ((BaseObject*)object)->getName() << ") in " << ((BaseObject*)object)->getLevelfile() << ":" << std::endl;165 COUT(1) << "An error occurred in XMLPort.h while loading attribute '" << this->paramname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << ((BaseObject*)object)->getName() << ") in " << ((BaseObject*)object)->getLevelfile() << ":" << std::endl; 159 166 COUT(1) << ex.what() << std::endl; 160 167 } -
code/branches/core3/src/orxonox/objects/Ambient.cc
r1586 r1592 64 64 } 65 65 66 bool Ambient::create(){ 67 GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_); 68 return Synchronisable::create(); 66 bool Ambient::create() 67 { 68 GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_); 69 return Synchronisable::create(); 69 70 } 70 71 71 void Ambient::registerAllVariables() {72 registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);73 72 void Ambient::registerAllVariables() 73 { 74 registerVar(&ambientLight_, sizeof(ColourValue), network::DATA); 74 75 } 75 76 76 void Ambient:: loadParams(TiXmlElement* xmlElem)77 void Ambient::setAmbientLight(const ColourValue& colour) 77 78 { 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); 96 ambientLight_=colour; 97 } 79 GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour); 80 ambientLight_=colour; 81 } 98 82 99 83 /** … … 107 91 BaseObject::XMLPort(xmlelement, mode); 108 92 109 XMLPortParam LoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, mode);93 XMLPortParam(Ambient, "colourvalue", setAmbientLight, getAmbienetLight, xmlelement, mode); 110 94 create(); 111 95 } -
code/branches/core3/src/orxonox/objects/Ambient.h
r1505 r1592 44 44 virtual ~Ambient(); 45 45 46 void loadParams(TiXmlElement* xmlElem);47 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 48 void setAmbientLight(const ColourValue& colour);49 47 virtual bool create(); 50 48 void registerAllVariables(); 49 50 void setAmbientLight(const ColourValue& colour); 51 inline const ColourValue& getAmbienetLight() const 52 { return this->ambientLight_; } 51 53 52 54 static void setAmbientLightTest(const ColourValue& colour) -
code/branches/core3/src/orxonox/objects/Model.cc
r1559 r1592 68 68 WorldEntity::XMLPort(xmlelement, mode); 69 69 70 XMLPortParam LoadOnly(Model, "mesh", setMesh, xmlelement, mode);70 XMLPortParam(Model, "mesh", setMesh, getMesh, xmlelement, mode); 71 71 72 72 Model::create(); 73 }74 75 void Model::setMesh(const std::string& meshname)76 {77 this->meshSrc_ = meshname;78 73 } 79 74 -
code/branches/core3/src/orxonox/objects/Model.h
r1558 r1592 45 45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 46 46 virtual void changedVisibility(); 47 void setMesh(const std::string& meshname); 47 inline void setMesh(const std::string& meshname) 48 { this->meshSrc_ = meshname; } 49 inline const std::string& getMesh() const 50 { return this->meshSrc_; } 48 51 virtual bool create(); 49 52 -
code/branches/core3/src/orxonox/objects/NPC.cc
r1591 r1592 46 46 NPC::~NPC() 47 47 { 48 }49 50 void NPC::loadParams(TiXmlElement* xmlElem)51 {52 Model::loadParams(xmlElem);53 48 } 54 49 -
code/branches/core3/src/orxonox/objects/NPC.h
r1505 r1592 48 48 NPC(); 49 49 virtual ~NPC(); 50 virtual void loadParams(TiXmlElement* xmlElem);51 50 void tick(float dt); 52 51 void update(); -
code/branches/core3/src/orxonox/objects/Projectile.cc
r1591 r1592 92 92 if ((*it) != this->owner_) 93 93 { 94 radius = it->getScale ().x * 3.0;94 radius = it->getScale3D().x * 3.0; 95 95 96 96 if (this->getPosition().squaredDistance(it->getPosition()) <= (radius*radius)) -
code/branches/core3/src/orxonox/objects/Skybox.cc
r1586 r1592 59 59 } 60 60 61 void Skybox::setSkyboxSrc(const std::string& src)62 {63 this->skyboxSrc_ = src;64 }65 66 61 /** 67 62 @brief XML loading and saving. … … 74 69 BaseObject::XMLPort(xmlelement, mode); 75 70 76 XMLPortParam LoadOnly(Skybox, "src", setSkyboxSrc, xmlelement, mode);71 XMLPortParam(Skybox, "src", setSkyboxSrc, getSkyboxSrc, xmlelement, mode); 77 72 create(); 78 73 } -
code/branches/core3/src/orxonox/objects/Skybox.h
r1558 r1592 49 49 virtual bool create(); 50 50 void registerAllVariables(); 51 void setSkyboxSrc(const std::string &src); 51 52 inline void setSkyboxSrc(const std::string &src) 53 { this->skyboxSrc_ = src; } 54 inline const std::string& getSkyboxSrc() const 55 { return this->skyboxSrc_; } 52 56 53 57 private: -
code/branches/core3/src/orxonox/objects/SpaceShip.cc
r1591 r1592 347 347 Model::XMLPort(xmlelement, mode); 348 348 349 XMLPortParam LoadOnly(SpaceShip, "camera", setCamera, xmlelement, mode);350 XMLPortParam LoadOnly(SpaceShip, "maxSpeed", setMaxSpeed, xmlelement, mode);351 XMLPortParam LoadOnly(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, xmlelement, mode);352 XMLPortParam LoadOnly(SpaceShip, "maxRotation", setMaxRotation, xmlelement, mode);353 XMLPortParam LoadOnly(SpaceShip, "transAcc", setTransAcc, xmlelement, mode);354 XMLPortParam LoadOnly(SpaceShip, "rotAcc", setRotAcc, xmlelement, mode);355 XMLPortParam LoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, mode);356 XMLPortParam LoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode);349 XMLPortParam(SpaceShip, "camera", setCamera, getCamera, xmlelement, mode); 350 XMLPortParam(SpaceShip, "maxSpeed", setMaxSpeed, getMaxSpeed, xmlelement, mode); 351 XMLPortParam(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, getMaxSideAndBackSpeed, xmlelement, mode); 352 XMLPortParam(SpaceShip, "maxRotation", setMaxRotation, getMaxRotation, xmlelement, mode); 353 XMLPortParam(SpaceShip, "transAcc", setTransAcc, getTransAcc, xmlelement, mode); 354 XMLPortParam(SpaceShip, "rotAcc", setRotAcc, getRotAcc, xmlelement, mode); 355 XMLPortParam(SpaceShip, "transDamp", setTransDamp, getTransDamp, xmlelement, mode); 356 XMLPortParam(SpaceShip, "rotDamp", setRotDamp, getRotDamp, xmlelement, mode); 357 357 358 358 SpaceShip::create(); -
code/branches/core3/src/orxonox/objects/WorldEntity.cc
r1559 r1592 95 95 } 96 96 97 void WorldEntity::loadParams(TiXmlElement* xmlElem)98 {99 100 BaseObject::loadParams(xmlElem);101 create();102 }103 104 105 97 void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll) 106 98 { … … 120 112 BaseObject::XMLPort(xmlelement, mode); 121 113 122 XMLPortParam (WorldEntity, "position", setPositionLoader2, getPosition, xmlelement, mode);123 XMLPortParamLoadOnly(WorldEntity, "direction", setDirection Loader, xmlelement, mode);114 XMLPortParamExternTemplate(Ogre::Node, this->node_, "position", setPosition, getPosition, xmlelement, mode, Ogre::Node, const Vector3&); 115 XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionSimple, xmlelement, mode); 124 116 XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, mode); 125 XMLPortParam(WorldEntity, "scale", set TotalScale, getScale, xmlelement, mode);126 XMLPortParam (WorldEntity, "rotationAxis", setRotationAxisLoader, getRotationAxis, xmlelement, mode);117 XMLPortParam(WorldEntity, "scale", setScale, getScale, xmlelement, mode); 118 XMLPortParamTemplate(WorldEntity, "rotationAxis", setRotationAxis, getRotationAxis, xmlelement, mode, WorldEntity, const Vector3&); 127 119 XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, mode); 128 120 … … 157 149 registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA, 0x3); 158 150 // register scale of node 159 registerVar( (void*) &(this->getScale ().x), sizeof(this->getScale().x), network::DATA, 0x3);160 registerVar( (void*) &(this->getScale ().y), sizeof(this->getScale().y), network::DATA, 0x3);161 registerVar( (void*) &(this->getScale ().z), sizeof(this->getScale().z), network::DATA, 0x3);151 registerVar( (void*) &(this->getScale3D().x), sizeof(this->getScale3D().x), network::DATA, 0x3); 152 registerVar( (void*) &(this->getScale3D().y), sizeof(this->getScale3D().y), network::DATA, 0x3); 153 registerVar( (void*) &(this->getScale3D().z), sizeof(this->getScale3D().z), network::DATA, 0x3); 162 154 //register staticity 163 155 registerVar( (void*) &(this->bStatic_), sizeof(this->bStatic_), network::DATA, 0x3); -
code/branches/core3/src/orxonox/objects/WorldEntity.h
r1535 r1592 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(); } … … 66 65 inline void setPosition(const Vector3& pos) 67 66 { this->node_->setPosition(pos); } 68 inline void setPositionLoader1(const Vector3& pos)69 { this->node_->setPosition(pos); }70 inline void setPositionLoader2(Real x, Real y, Real z)71 { this->node_->setPosition(x, y, z); }72 67 inline void setPosition(Real x, Real y, Real z) 73 68 { this->node_->setPosition(x, y, z); } … … 105 100 inline void rotate(const Vector3 &axis, const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL) 106 101 { this->node_->rotate(axis, angle, relativeTo); } 107 inline void setDirection Loader(Real x, Real y, Real z)102 inline void setDirectionSimple(Real x, Real y, Real z) 108 103 { this->setDirection(x, y, z); } 109 104 inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z) … … 114 109 { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); } 115 110 116 inline void setScale (const Vector3 &scale)111 inline void setScale3D(const Vector3 &scale) 117 112 { this->node_->setScale(scale); } 118 inline void setScale (Real x, Real y, Real z)113 inline void setScale3D(Real x, Real y, Real z) 119 114 { this->node_->setScale(x, y, z); } 120 inline void setScale(Real scale) 115 inline const Vector3& getScale3D(void) const 116 { return this->node_->getScale(); } 117 inline void setScale(float scale) 121 118 { this->node_->setScale(scale, scale, scale); } 122 inline void setTotalScale(Real scale) 123 { this->node_->setScale(scale, scale, scale); } 124 inline const Vector3& getScale(void) const 125 { return this->node_->getScale(); } 126 inline void scale(const Vector3 &scale) 119 inline float getScale() const 120 { Vector3 scale = this->getScale3D(); return (scale.x == scale.y && scale.x == scale.z) ? scale.x : 1; } 121 inline void scale3D(const Vector3 &scale) 127 122 { this->node_->scale(scale); } 128 inline void scale (Real x, Real y, Real z)123 inline void scale3D(Real x, Real y, Real z) 129 124 { this->node_->scale(x, y, z); } 130 125 inline void scale(Real scale) … … 154 149 { return this->acceleration_; } 155 150 156 inline void setRotationAxisLoader(const Vector3& axis)157 { this->rotationAxis_ = axis; rotationAxis_.normalise(); }158 151 inline void setRotationAxis(const Vector3& axis) 159 { this->rotationAxis_ = axis; rotationAxis_.normalise(); }152 { this->rotationAxis_ = axis; this->rotationAxis_.normalise(); } 160 153 inline void setRotationAxis(Real x, Real y, Real z) 161 154 { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; rotationAxis_.normalise(); }
Note: See TracChangeset
for help on using the changeset viewer.