Changeset 5113 in orxonox.OLD for trunk/src/lib/coord
- Timestamp:
- Aug 23, 2005, 11:18:39 PM (19 years ago)
- Location:
- trunk/src/lib/coord
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.cc
r5111 r5113 165 165 void PNode::setRelCoor (const Vector& relCoord) 166 166 { 167 if (this->toCoordinate!= NULL) 168 { 169 delete this->toCoordinate; 170 this->toCoordinate = NULL; 171 } 172 167 173 this->relCoordinate = relCoord; 168 174 this->bRelCoorChanged = true; … … 213 219 void PNode::setAbsCoor (const Vector& absCoord) 214 220 { 221 if (this->toCoordinate!= NULL) 222 { 223 delete this->toCoordinate; 224 this->toCoordinate = NULL; 225 } 226 215 227 if( likely(this->parentMode & PNODE_MOVEMENT)) 216 228 { … … 276 288 void PNode::setRelDir (const Quaternion& relDir) 277 289 { 290 if (this->toDirection!= NULL) 291 { 292 delete this->toDirection; 293 this->toDirection = NULL; 294 } 278 295 this->relDirection = relDir; 279 296 this->bRelCoorChanged = true; … … 327 344 void PNode::setAbsDir (const Quaternion& absDir) 328 345 { 346 if (this->toDirection!= NULL) 347 { 348 delete this->toDirection; 349 this->toDirection = NULL; 350 } 351 329 352 if (likely(this->parent != NULL)) 330 353 this->relDirection = absDir / this->parent->getAbsDir(); -
trunk/src/lib/coord/p_node.h
r5111 r5113 66 66 /** @returns the relative position */ 67 67 inline const Vector& getRelCoor () const { return this->prevRelCoordinate; }; 68 /** @returns the Relative Coordinate Destination */ 69 inline const Vector& getRelCoorSoft2D() const { return (this->toCoordinate)?*this->toCoordinate:this->relCoordinate; }; 68 70 void setAbsCoor (const Vector& absCoord); 69 71 void setAbsCoor (float x, float y, float z); … … 78 80 /** @returns the relative Direction */ 79 81 inline const Quaternion& getRelDir () const { return this->prevRelDirection; }; 82 /** @returns the Relative Directional Destination */ 83 inline const Quaternion& getRelDirSoft2D() const { return (this->toDirection)?*this->toDirection:this->relDirection; }; 80 84 /** @returns a Vector pointing into the relative Direction */ 81 85 inline Vector getRelDirV() const { return this->prevRelDirection.apply(Vector(0,1,0)); };
Note: See TracChangeset
for help on using the changeset viewer.