Changeset 6048 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Dec 11, 2005, 3:04:04 PM (19 years ago)
- Location:
- trunk/src/lib/coord
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.cc
r6004 r6048 26 26 #include "error.h" 27 27 #include "debug.h" 28 #include "list.h"29 28 #include "vector.h" 30 29 … … 35 34 36 35 /** 37 * standard constructor36 * @brief standard constructor 38 37 */ 39 38 PNode::PNode () … … 57 56 58 57 /** 59 * constructor with coodinates58 * @brief constructor with coodinates 60 59 * @param absCoordinate the Absolute coordinate of the Object 61 60 * @param parent The parent-node of this node. … … 72 71 73 72 /** 74 * standard deconstructor73 * @brief standard deconstructor 75 74 * 76 75 * There are two general ways to delete a PNode … … 110 109 111 110 /** 112 * initializes a PNode111 * @brief initializes a PNode 113 112 * @param parent the parent for this PNode 114 113 */ … … 129 128 130 129 /** 131 * loads parameters of the PNode130 * @brief loads parameters of the PNode 132 131 * @param root the XML-element to load the properties of 133 132 */ … … 168 167 169 168 /** 170 * set relative coordinates169 * @brief set relative coordinates 171 170 * @param relCoord relative coordinates to its parent 172 171 * … … 189 188 190 189 /** 191 * set relative coordinates190 * @brief set relative coordinates 192 191 * @param x x-relative coordinates to its parent 193 192 * @param y y-relative coordinates to its parent … … 201 200 202 201 /** 203 * sets a new relative position smoothely202 * @brief sets a new relative position smoothely 204 203 * @param relCoordSoft the new Position to iterate to 205 204 * @param bias how fast to iterate to this position … … 216 215 217 216 /** 218 * set relative coordinates smoothely217 * @brief set relative coordinates smoothely 219 218 * @param x x-relative coordinates to its parent 220 219 * @param y y-relative coordinates to its parent … … 299 298 300 299 /** 301 * shift coordinate relative300 * @brief shift coordinate relative 302 301 * @param shift shift vector 303 302 * … … 323 322 324 323 /** 325 * set relative direction324 * @brief set relative direction 326 325 * @param relDir to its parent 327 326 */ … … 353 352 354 353 /** 355 * sets the Relative Direction of this node to its parent in a Smoothed way354 * @brief sets the Relative Direction of this node to its parent in a Smoothed way 356 355 * @param relDirSoft the direction to iterate to smoothely. 357 356 * @param bias how fast to iterate to the new Direction … … 381 380 382 381 /** 383 * sets the absolute direction382 * @brief sets the absolute direction 384 383 * @param absDir absolute coordinates 385 384 */ … … 414 413 415 414 /** 416 * sets the absolute direction415 * @brief sets the absolute direction 417 416 * @param absDir absolute coordinates 417 * @param bias how fast to iterator to the new Position 418 418 */ 419 419 void PNode::setAbsDirSoft (const Quaternion& absDirSoft, float bias) … … 446 446 447 447 /** 448 * shift Direction448 * @brief shift Direction 449 449 * @param shift the direction around which to shift. 450 450 */ … … 455 455 } 456 456 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 459 460 * @param child child reference 460 461 * use this to add a child to this node. … … 473 474 } 474 475 476 475 477 /** 476 478 * @see PNode::addChild(PNode* child); … … 484 486 } 485 487 486 /** 487 * removes a child from the node 488 489 /** 490 * @brief removes a child from the node 488 491 * @param child the child to remove from this pNode. 489 492 * … … 501 504 502 505 /** 503 * remove this pnode from the tree and adds all following to NullParent506 * @brief remove this pnode from the tree and adds all following to NullParent 504 507 * 505 508 * this can be the case, if an entity in the world is being destroyed. … … 515 518 } 516 519 517 /**518 * sets the parent of this PNode519 * @param parent the Parent to set520 */521 void PNode::setParent (PNode* parent)522 {523 parent->addChild(this);524 }525 520 526 521 /** … … 536 531 537 532 /** 538 * does the reparenting in a very smooth way533 * @brief does the reparenting in a very smooth way 539 534 * @param parentNode the new Node to connect this node to. 540 535 * @param bias the speed to iterate to this new Positions … … 574 569 575 570 /** 576 * does the reparenting in a very smooth way571 * @brief does the reparenting in a very smooth way 577 572 * @param parentName the name of the Parent to reconnect to 578 573 * @param bias the speed to iterate to this new Positions … … 585 580 } 586 581 587 /** 588 * sets the mode of this parent manually 582 583 /** 584 * @brief sets the mode of this parent manually 589 585 * @param parentMode a String representing this parentingMode 590 586 */ … … 595 591 596 592 /** 597 * updates the absCoordinate/absDirection593 * @brief updates the absCoordinate/absDirection 598 594 * @param dt The time passed since the last update 599 595 * … … 699 695 700 696 697 /** 698 * @brief counts total amount the children walking through the entire tree. 699 * @param nodes the counter 700 */ 701 701 void PNode::countChildNodes(int& nodes) const 702 702 { … … 709 709 710 710 /** 711 * displays some information about this pNode711 * @brief displays some information about this pNode 712 712 * @param depth The deph into which to debug the children of this PNode to. 713 713 * (0: all children will be debugged, 1: only this PNode, 2: this and direct children, ...) … … 754 754 755 755 /** 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. 757 757 * @param depth The deph into which to debug the children of this PNode to. 758 758 * (0: all children will be displayed, 1: only this PNode, 2: this and direct children, ...) … … 856 856 857 857 /** 858 * converts a parentingMode into a string that is the name of it858 * @brief converts a parentingMode into a string that is the name of it 859 859 * @param parentingMode the ParentingMode to convert 860 860 * @return the converted string … … 875 875 876 876 /** 877 * converts a parenting-mode-string into a int877 * @brief converts a parenting-mode-string into a int 878 878 * @param parentingMode the string naming the parentingMode 879 879 * @return the int corresponding to the named parentingMode -
trunk/src/lib/coord/p_node.h
r6042 r6048 43 43 // REPARENTING 44 44 PNODE_REPARENT_TO_NULLPARENT = 0x0010, //!< Reparents to the NullParent, if the Parent is Removed. 45 PNODE_REPARENT_TO_PAR ANTS_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. 46 46 PNODE_REPARENT_DELETE_CHILDREN = 0x0040, //!< Deletes the Children of the node when This Node is Removed. (Use with care). 47 47 PNODE_REPARENT_KEEP_POSITION = 0x0080, //!< Tries to keep the Position if the Node is reparented. … … 51 51 PNODE_PROHIBIT_CHILD_DELETE = 0x0100, //!< Prohibits the Children from being deleted if this Node gets deleted. 52 52 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 54 54 PNODE_REPARANT_CHILDREN_ON_REMOVE = 0x0800, //!< Reparents the Children of the Node if the Node gets Removed. 55 55 … … 132 132 void removeNode(); 133 133 134 void setParent (PNode* parent); 134 /** @param the new parent of this node */ 135 inline void setParent (PNode* parent) { parent->addChild(this); }; 135 136 void setParent (const char* parentName); 136 137 /** @returns the parent of this PNode */ … … 169 170 inline Vector getLastAbsCoor() { return this->lastAbsCoordinate; } 170 171 172 void reparent(); 171 173 172 174 private:
Note: See TracChangeset
for help on using the changeset viewer.