Changeset 3248 in orxonox.OLD for orxonox/branches
- Timestamp:
- Dec 22, 2004, 3:28:14 PM (20 years ago)
- Location:
- orxonox/branches/parenting/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/src/list.h
r3224 r3248 78 78 79 79 80 void add( WorldEntity* entity);81 void remove( WorldEntity* entity);80 void add(T* entity); 81 void remove(T* entity); 82 82 void destroy(); 83 83 T* firstElement(); … … 104 104 105 105 template<class T> 106 void tList<T>::add( WorldEntity* entity)106 void tList<T>::add(T* entity) 107 107 { 108 108 listElement* el = new listElement; … … 120 120 121 121 template<class T> 122 void tList<T>::remove( WorldEntity* entity)122 void tList<T>::remove(T* entity) 123 123 { 124 124 this->currentEl = this->first; -
orxonox/branches/parenting/src/p_node.cc
r3247 r3248 28 28 \todo this constructor is not jet implemented - do it 29 29 */ 30 PNode::PNode () {} 30 PNode::PNode () 31 { 32 this->children = new tList<PNode>(); 33 } 31 34 32 35 … … 36 39 \todo this deconstructor is not jet implemented - do it 37 40 */ 38 PNode::~PNode () {} 41 PNode::~PNode () 42 { 43 this->children->destroy(); 44 delete this->children; 45 } 39 46 40 47 … … 44 51 */ 45 52 Vector PNode::getRelCoor () 46 {} 53 { 54 Vector r = this->relCoordinate; /* return a copy, so it can't be modified */ 55 return r; 56 } 47 57 48 58 … … 80 90 81 91 /** 92 \brief shift coordinate (abs and rel) 93 \param shift vector 94 95 this function shifts the current coordinates about the vector shift. this is 96 usefull because from some place else you can: 97 PNode* someNode = ...; 98 Vector objectMovement = calculateShift(); 99 someNode->shiftCoor(objectMovement); 100 101 elsewhere you would have to: 102 PNode* someNode = ...; 103 Vector objectMovement = calculateShift(); 104 Vector currentCoor = someNode->getRelCoor(); 105 Vector newCoor = currentCoor + objectMovement; 106 someNode->setRelCoor(newCoor); 107 108 yea right... shorter... 109 110 */ 111 void PNode::shiftCoor (Vector shift) 112 {} 113 114 115 116 /** 82 117 \brief get relative direction 83 118 \returns relative direction to its parent … … 120 155 121 156 /** 157 \brief shift coordinate (abs and rel) 158 \param shift vector 159 160 this function shifts the current coordinates about the vector shift. this is 161 usefull because from some place else you can: 162 PNode* someNode = ...; 163 Quaternion objectMovement = calculateShift(); 164 someNode->shiftCoor(objectMovement); 165 166 elsewhere you would have to: 167 PNode* someNode = ...; 168 Quaternion objectMovement = calculateShift(); 169 Quaternion currentCoor = someNode->getRelCoor(); 170 Quaternion newCoor = currentCoor + objectMovement; 171 someNode->setRelCoor(newCoor); 172 173 yea right... shorter... 174 175 */ 176 void PNode::shiftDir (Quaternion shift) 177 {} 178 179 180 181 /** 122 182 \brief adds a child and makes this node to a parent 123 183 \param child reference … … 126 186 */ 127 187 void PNode::addChild (PNode* pNode) 128 {} 129 130 188 { 189 this->addChild(pNode, DEFAULT_MODE); 190 } 191 192 193 /** 194 \brief adds a child and makes this node to a parent 195 \param child reference 196 \param on which changes the child should also change ist state 197 198 use this to add a child to this node. 199 */ 200 void PNode::addChild (PNode* pNode, parentingMode mode) 201 { 202 pNode->mode = mode; 203 this->children->add (pNode); 204 } 205 206 207 /** 208 /brief removes a child from the node 209 */ 131 210 void PNode::removeChild (PNode* pNode) 132 {} 133 134 211 { 212 this->children->remove (pNode); 213 } 214 215 216 /** 217 \brief sets the parent of this PNode 218 */ 135 219 void PNode::setParent (PNode* parent) 136 {} 137 220 { 221 this->parent = parent; 222 } 223 224 225 /** 226 \brief updates the absCoordinate/absDirection 227 228 this is used to go through the parent-tree to update all the absolute coordinates 229 and directions. this update should be done by the engine, so you don't have to 230 worry, normaly... 231 */ 232 void PNode::update() 233 { 234 235 } 236 -
orxonox/branches/parenting/src/p_node.h
r3247 r3248 24 24 #include "stdincl.h" 25 25 26 typedef enum parentingMode {}; 26 class PNode; /* forward decleration, so that parentEntry has access to PNode */ 27 28 typedef enum parentingMode {MOVEMENT = 0, ROTATION, ALL}; 29 #define DEFAULT_MODE ALL 27 30 28 31 class PNode { … … 32 35 ~PNode (); 33 36 37 parentingMode mode; 38 34 39 Vector getRelCoor (); 35 40 void setRelCoor (Vector relCoord); 36 41 Vector getAbsCoor (); 37 42 void setAbsCoor (Vector absCoord); 43 void shiftCoor (Vector shift); 38 44 39 45 Quaternion getRelDir (); … … 41 47 Quaternion getAbsDir (); 42 48 void setAbsDir (Quaternion absDir); 49 void shiftDir (Quaternion shift); 43 50 44 51 void addChild (PNode* pNode); 52 void addChild (PNode* pNode, parentingMode mode); 45 53 void removeChild (PNode* pNode); 46 54 void setParent (PNode* parent); 55 void update (); 47 56 48 57 private:
Note: See TracChangeset
for help on using the changeset viewer.