Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6048 in orxonox.OLD for trunk/src/lib/coord


Ignore:
Timestamp:
Dec 11, 2005, 3:04:04 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: some fixes, to PNode and world.

Location:
trunk/src/lib/coord
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/coord/p_node.cc

    r6004 r6048  
    2626#include "error.h"
    2727#include "debug.h"
    28 #include "list.h"
    2928#include "vector.h"
    3029
     
    3534
    3635/**
    37  * standard constructor
     36 * @brief standard constructor
    3837 */
    3938PNode::PNode ()
     
    5756
    5857/**
    59  * constructor with coodinates
     58 * @brief constructor with coodinates
    6059 * @param absCoordinate the Absolute coordinate of the Object
    6160 * @param parent The parent-node of this node.
     
    7271
    7372/**
    74  * standard deconstructor
     73 * @brief standard deconstructor
    7574 *
    7675 * There are two general ways to delete a PNode
     
    110109
    111110/**
    112  * initializes a PNode
     111 * @brief initializes a PNode
    113112 * @param parent the parent for this PNode
    114113 */
     
    129128
    130129/**
    131  * loads parameters of the PNode
     130 * @brief loads parameters of the PNode
    132131 * @param root the XML-element to load the properties of
    133132 */
     
    168167
    169168/**
    170  * set relative coordinates
     169 * @brief set relative coordinates
    171170 * @param relCoord relative coordinates to its parent
    172171 *
     
    189188
    190189/**
    191  * set relative coordinates
     190 * @brief set relative coordinates
    192191 * @param x x-relative coordinates to its parent
    193192 * @param y y-relative coordinates to its parent
     
    201200
    202201/**
    203  * sets a new relative position smoothely
     202 * @brief sets a new relative position smoothely
    204203 * @param relCoordSoft the new Position to iterate to
    205204 * @param bias how fast to iterate to this position
     
    216215
    217216/**
    218  * set relative coordinates smoothely
     217 * @brief set relative coordinates smoothely
    219218 * @param x x-relative coordinates to its parent
    220219 * @param y y-relative coordinates to its parent
     
    299298
    300299/**
    301  * shift coordinate relative
     300 * @brief shift coordinate relative
    302301 * @param shift shift vector
    303302 *
     
    323322
    324323/**
    325  * set relative direction
     324 * @brief set relative direction
    326325 * @param relDir to its parent
    327326 */
     
    353352
    354353/**
    355  * sets the Relative Direction of this node to its parent in a Smoothed way
     354 * @brief sets the Relative Direction of this node to its parent in a Smoothed way
    356355 * @param relDirSoft the direction to iterate to smoothely.
    357356 * @param bias how fast to iterate to the new Direction
     
    381380
    382381/**
    383  * sets the absolute direction
     382 * @brief sets the absolute direction
    384383 * @param absDir absolute coordinates
    385384 */
     
    414413
    415414/**
    416  * sets the absolute direction
     415 * @brief sets the absolute direction
    417416 * @param absDir absolute coordinates
     417 * @param bias how fast to iterator to the new Position
    418418 */
    419419void PNode::setAbsDirSoft (const Quaternion& absDirSoft, float bias)
     
    446446
    447447/**
    448  * shift Direction
     448 * @brief shift Direction
    449449 * @param shift the direction around which to shift.
    450450 */
     
    455455}
    456456
    457 /**
    458  *  adds a child and makes this node to a parent
     457
     458/**
     459 * @brief adds a child and makes this node to a parent
    459460 * @param child child reference
    460461 * use this to add a child to this node.
     
    473474}
    474475
     476
    475477/**
    476478 * @see PNode::addChild(PNode* child);
     
    484486}
    485487
    486 /**
    487  *  removes a child from the node
     488
     489/**
     490 * @brief removes a child from the node
    488491 * @param child the child to remove from this pNode.
    489492 *
     
    501504
    502505/**
    503  * remove this pnode from the tree and adds all following to NullParent
     506 * @brief remove this pnode from the tree and adds all following to NullParent
    504507 *
    505508 * this can be the case, if an entity in the world is being destroyed.
     
    515518}
    516519
    517 /**
    518  * sets the parent of this PNode
    519  * @param parent the Parent to set
    520  */
    521 void PNode::setParent (PNode* parent)
    522 {
    523   parent->addChild(this);
    524 }
    525520
    526521/**
     
    536531
    537532/**
    538  * does the reparenting in a very smooth way
     533 * @brief does the reparenting in a very smooth way
    539534 * @param parentNode the new Node to connect this node to.
    540535 * @param bias the speed to iterate to this new Positions
     
    574569
    575570/**
    576  * does the reparenting in a very smooth way
     571 * @brief does the reparenting in a very smooth way
    577572 * @param parentName the name of the Parent to reconnect to
    578573 * @param bias the speed to iterate to this new Positions
     
    585580}
    586581
    587 /**
    588  *  sets the mode of this parent manually
     582
     583/**
     584 * @brief sets the mode of this parent manually
    589585 * @param parentMode a String representing this parentingMode
    590586 */
     
    595591
    596592/**
    597  * updates the absCoordinate/absDirection
     593 * @brief updates the absCoordinate/absDirection
    598594 * @param dt The time passed since the last update
    599595 *
     
    699695
    700696
     697/**
     698 * @brief counts total amount the children walking through the entire tree.
     699 * @param nodes the counter
     700 */
    701701void PNode::countChildNodes(int& nodes) const
    702702{
     
    709709
    710710/**
    711  * displays some information about this pNode
     711 * @brief displays some information about this pNode
    712712 * @param depth The deph into which to debug the children of this PNode to.
    713713 * (0: all children will be debugged, 1: only this PNode, 2: this and direct children, ...)
     
    754754
    755755/**
    756  * displays the PNode at its position with its rotation as a cube.
     756 * @brief displays the PNode at its position with its rotation as a cube.
    757757 * @param  depth The deph into which to debug the children of this PNode to.
    758758 * (0: all children will be displayed, 1: only this PNode, 2: this and direct children, ...)
     
    856856
    857857/**
    858  * converts a parentingMode into a string that is the name of it
     858 * @brief converts a parentingMode into a string that is the name of it
    859859 * @param parentingMode the ParentingMode to convert
    860860 * @return the converted string
     
    875875
    876876/**
    877  * converts a parenting-mode-string into a int
     877 * @brief converts a parenting-mode-string into a int
    878878 * @param parentingMode the string naming the parentingMode
    879879 * @return the int corresponding to the named parentingMode
  • trunk/src/lib/coord/p_node.h

    r6042 r6048  
    4343  // REPARENTING
    4444  PNODE_REPARENT_TO_NULLPARENT         = 0x0010,    //!< Reparents to the NullParent, if the Parent is Removed.
    45   PNODE_REPARENT_TO_PARANTS_PARENT     = 0x0020,    //!< Reparents the Node to the parents (old) parent it the parent gets removed.
     45  PNODE_REPARENT_TO_PARENTS_PARENT     = 0x0020,    //!< Reparents the Node to the parents (old) parent it the parent gets removed.
    4646  PNODE_REPARENT_DELETE_CHILDREN       = 0x0040,    //!< Deletes the Children of the node when This Node is Removed. (Use with care).
    4747  PNODE_REPARENT_KEEP_POSITION         = 0x0080,    //!< Tries to keep the Position if the Node is reparented.
     
    5151  PNODE_PROHIBIT_CHILD_DELETE          = 0x0100,    //!< Prohibits the Children from being deleted if this Node gets deleted.
    5252  PNODE_PROHIBIT_DELETE_WITH_PARENT    = 0x0200,    //!< Prohibits the Node to be deleted if the Parent is. Child will be reparented according to the Repaenting-Rules
    53   PNODE_REPARENT_CHILDREN_ON_DELETE    = 0x0400,    //!< Reparents the Children of the Node to 
     53  PNODE_REPARENT_CHILDREN_ON_DELETE    = 0x0400,    //!< Reparents the Children of the Node to
    5454  PNODE_REPARANT_CHILDREN_ON_REMOVE    = 0x0800,    //!< Reparents the Children of the Node if the Node gets Removed.
    5555
     
    132132  void removeNode();
    133133
    134   void setParent (PNode* parent);
     134  /** @param the new parent of this node */
     135  inline void setParent (PNode* parent) { parent->addChild(this); };
    135136  void setParent (const char* parentName);
    136137  /** @returns the parent of this PNode */
     
    169170  inline Vector getLastAbsCoor() { return this->lastAbsCoordinate; }
    170171
     172  void reparent();
    171173
    172174 private:
Note: See TracChangeset for help on using the changeset viewer.