Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 12, 2008, 4:32:10 AM (16 years ago)
Author:
landauf
Message:
  • Some small changes in XMLPortParam: It's now possible to add functions of another class. an example is setPosition and getPosition that are directly referred to Ogre::Node. Use XMLPortParamExtern if you need this. It takes the object to call the functions on as an additional argument (in our example: this→node_).
  • Removed loadParams functions and reduced the usage of XMLPortParamLoadOnly in several classes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core3/src/orxonox/objects/WorldEntity.h

    r1535 r1592  
    5151
    5252            virtual void tick(float dt);
    53             virtual void loadParams(TiXmlElement* xmlElem);
    5453            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5554            virtual inline bool create(){ return Synchronisable::create(); }
     
    6665            inline void setPosition(const Vector3& pos)
    6766                { 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); }
    7267            inline void setPosition(Real x, Real y, Real z)
    7368                { this->node_->setPosition(x, y, z); }
     
    105100            inline void rotate(const Vector3 &axis, const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    106101              { this->node_->rotate(axis, angle, relativeTo); }
    107             inline void setDirectionLoader(Real x, Real y, Real z)
     102            inline void setDirectionSimple(Real x, Real y, Real z)
    108103              { this->setDirection(x, y, z); }
    109104            inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
     
    114109              { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); }
    115110
    116             inline void setScale(const Vector3 &scale)
     111            inline void setScale3D(const Vector3 &scale)
    117112              { this->node_->setScale(scale); }
    118             inline void setScale(Real x, Real y, Real z)
     113            inline void setScale3D(Real x, Real y, Real z)
    119114              { 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)
    121118              { 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)
    127122              { this->node_->scale(scale); }
    128             inline void scale(Real x, Real y, Real z)
     123            inline void scale3D(Real x, Real y, Real z)
    129124              { this->node_->scale(x, y, z); }
    130125            inline void scale(Real scale)
     
    154149                { return this->acceleration_; }
    155150
    156             inline void setRotationAxisLoader(const Vector3& axis)
    157                 { this->rotationAxis_ = axis; rotationAxis_.normalise(); }
    158151            inline void setRotationAxis(const Vector3& axis)
    159                 { this->rotationAxis_ = axis; rotationAxis_.normalise(); }
     152                { this->rotationAxis_ = axis; this->rotationAxis_.normalise(); }
    160153            inline void setRotationAxis(Real x, Real y, Real z)
    161154                { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; rotationAxis_.normalise(); }
Note: See TracChangeset for help on using the changeset viewer.