Changeset 5211 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Sep 21, 2005, 2:21:41 PM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.cc
r5209 r5211 104 104 { 105 105 this->setClassID(CL_PARENT_NODE, "PNode"); 106 106 107 this->children = new tList<PNode>(); 107 108 this->bRelCoorChanged = true; -
trunk/src/lib/graphics/importer/model.cc
r5115 r5211 350 350 delete this->normals; 351 351 if (this->triangles) 352 delete this->triangles;352 delete[] this->triangles; 353 353 354 354 this->vertices = NULL; 355 355 this->vTexture = NULL; 356 356 this->normals = NULL; 357 this->triangles = NULL; this->triangleCount = 0; 357 this->triangles = NULL; 358 this->triangleCount = 0; 358 359 } 359 360 -
trunk/src/lib/graphics/importer/texture.cc
r4836 r5211 45 45 Texture::~Texture() 46 46 { 47 if (this->texture )47 if (this->texture != 0) 48 48 glDeleteTextures(1, &this->texture); 49 49 } -
trunk/src/lib/graphics/light.cc
r5156 r5211 244 244 if (this->lights[i]) 245 245 delete lights[i]; 246 delete lights;246 delete[] lights; 247 247 LightManager::singletonRef = NULL; 248 248 } -
trunk/src/lib/graphics/render2D/element_2d.cc
r5118 r5211 90 90 this->parent = NULL; 91 91 this->children = new tList<Element2D>; 92 this->absDirection = 0.0; 92 93 this->relDirection = 0.0; 93 94 this->bRelCoorChanged = true; … … 844 845 NullElement2D::~NullElement2D () 845 846 { 846 //delete singletonRef;847 847 NullElement2D::singletonRef = NULL; 848 848 } -
trunk/src/lib/graphics/render2D/element_2d.h
r5113 r5211 193 193 Vector absCoordinate; //!< absolute coordinates in the world ( from (0,0,0) ) 194 194 float relDirection; //!< direction relative to the parent 195 float absDirection; //!< absolute dire vtion in the world ( from (0,0,1) )195 float absDirection; //!< absolute diretion in the world ( from (0,0,1) ) 196 196 197 197 Vector prevRelCoordinate; //!< The last Relative Coordinate from the last update-Cycle. -
trunk/src/lib/math/curve.cc
r4836 r5211 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 13 13 co-programmer: Patrick Boenzli 14 14 15 ADD: Patrick Boenzli B-Spline 16 17 18 TODO: 15 ADD: Patrick Boenzli B-Spline 16 17 18 TODO: 19 19 local-Time implementation 20 20 NURBS 21 21 tList implementation 22 22 23 23 */ 24 24 … … 33 33 34 34 35 /** 35 /** 36 36 * default constructor for a Curve 37 37 */ … … 71 71 void Curve::addNode(const Vector& newNode, unsigned int insertPosition) 72 72 { 73 74 73 if (this->nodeCount == 0 || insertPosition > this->nodeCount) 75 74 return addNode(newNode); … … 85 84 { 86 85 while (tmpNode->next->number != insertPosition) 87 86 tmpNode= tmpNode->next; 88 87 insNode->next = tmpNode->next; 89 88 tmpNode->next = insNode; … … 199 198 tmpNode->factor = binCoef; 200 199 if (tmpNode =tmpNode->next) 201 202 203 204 200 { 201 binCoef *=(n-k)/(k+1); 202 ++k; 203 } 205 204 } 206 205 … … 212 211 dirCurve = new BezierCurve(1); 213 212 while(tmpNode->next) 214 215 216 217 218 219 220 221 222 213 { 214 Vector tmpVector = (tmpNode->next->position)- (tmpNode->position); 215 tmpVector.x*=(float)nodeCount; 216 tmpVector.y*=(float)nodeCount; 217 tmpVector.z*=(float)nodeCount; 218 tmpVector.normalize(); 219 this->dirCurve->addNode(tmpVector); 220 tmpNode = tmpNode->next; 221 } 223 222 } 224 223 } … … 229 228 * @return the Position on the Path 230 229 */ 231 Vector BezierCurve::calcPos(float t) 230 Vector BezierCurve::calcPos(float t) 232 231 { 233 232 Vector ret = Vector(0.0,0.0,0.0); … … 237 236 double factor = pow(1.0-t,nodeCount-1); 238 237 while(tmpNode) 239 240 241 242 243 244 245 246 238 { 239 ret.x += tmpNode->factor * factor * tmpNode->position.x; 240 ret.y += tmpNode->factor * factor * tmpNode->position.y; 241 ret.z += tmpNode->factor * factor * tmpNode->position.z; 242 factor *= t/(1.0-t); // same as pow but much faster. 243 244 tmpNode = tmpNode->next; 245 } 247 246 } 248 247 else if (nodeCount == 2) -
trunk/src/lib/physics/physics_engine.cc
r5129 r5211 58 58 } 59 59 delete itPC; 60 60 delete this->connections; 61 61 // 62 62 // // delete all PhysicsInterfaces, still in existence (this could be dangerous) -
trunk/src/lib/util/list.h
r5209 r5211 82 82 { 83 83 listElement<T>* le = this->currentEl->next; 84 //delete this->currentEl->curr; 84 //delete this->currentEl->curr; //! THIS IS EXTREMELY UNSAFE (the list only stores pointers not instances) // 85 85 delete this->currentEl; 86 86 this->currentEl = le;
Note: See TracChangeset
for help on using the changeset viewer.