Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9092 in orxonox.OLD


Ignore:
Timestamp:
Jul 4, 2006, 2:38:00 AM (18 years ago)
Author:
bensch
Message:

cmath (valgrinded)

Location:
branches/presentation/src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/lib/graphics/importer/primitive_model.cc

    r8316 r9092  
    1818#include "primitive_model.h"
    1919
    20 #include <math.h>
    2120#include "vector.h"
    2221#include "debug.h"
  • branches/presentation/src/lib/graphics/spatial_separation/quadtree.cc

    r8293 r9092  
    5252
    5353  /* make an array with access to the leafs of the Quad-Tree */
    54   this->nodes = new QuadtreeNode*[(int)pow(4, treeDepth)];
     54  this->nodes = new QuadtreeNode*[(int)pow(4.0, treeDepth)];
    5555  int index = 0; //new int; *index = 0; // !!changed by bensch!!
    56   for(int i = 0; i < (int)pow(2, treeDepth); ++i)
     56  for(int i = 0; i < (int)pow(2.0, treeDepth); ++i)
    5757  {
    5858    this->rootNode->buildHashTable(this->nodes, &index);
     
    7070  this->offset->x = xOff;
    7171  this->offset->z = yOff;
    72   this->maxIndex = (int)pow(2, this->treeDepth);
     72  this->maxIndex = (int)pow(2.0, this->treeDepth);
    7373}
    7474
     
    103103void Quadtree::revertHashTable(QuadtreeNode** nodes)
    104104{
    105   int                  len         = (int)pow(2, this->treeDepth);          //!< the length of a quadtree side
     105  int                  len         = (int)pow(2.0, this->treeDepth);          //!< the length of a quadtree side
    106106  int                  iterator    = 0;                                     //!< iterator used for mapping
    107107  QuadtreeNode*        tmpNode     = NULL;                                  //!< temp saving place
     
    132132void Quadtree::sortHashTable(QuadtreeNode** nodes)
    133133{
    134   int                  len         = (int)pow(2, this->treeDepth);          //!< the length of a quadtree side
     134  int                  len         = (int)pow(2.0, this->treeDepth);          //!< the length of a quadtree side
    135135  float                a;                                                   //!< temp place for float a
    136136  float                b;                                                   //!< temp place for float b
     
    207207{
    208208  //this->rootNode->drawTree();
    209   for(int i = 0; i < (int)pow(4, this->treeDepth); ++i)
     209  for(int i = 0; i < (int)pow(4.0, this->treeDepth); ++i)
    210210  {
    211211    this->nodes[i]->draw();
  • branches/presentation/src/lib/graphics/spatial_separation/quadtree_node.cc

    r6022 r9092  
    164164
    165165  /*              offset              #of elements in a row            #of rows in a quadtree          */
    166   int threshold = this->nodeIter + (int)pow(2, this->maxDepth) * (int)pow(2, maxDepth - treeDepth - 1);
     166  int threshold = this->nodeIter + (int)pow(2.0, this->maxDepth) * (int)pow(2.0, maxDepth - treeDepth - 1);
    167167  int loopLimit = (*index < threshold)?2:4;
    168168
  • branches/presentation/src/lib/gui/gtk/gui_gtk.cc

    r8145 r9092  
    3030#include <string.h>
    3131#include <stdlib.h>
    32 #include <math.h>
     32#include <cmath>
    3333
    3434using namespace std;
  • branches/presentation/src/lib/math/curve.cc

    r5232 r9092  
    2929#include "debug.h"
    3030
    31 #include <math.h>
     31#include <cmath>
    3232#include <stdio.h>
    3333
  • branches/presentation/src/lib/math/line.h

    r6617 r9092  
    2424#define __LINE_H_
    2525
    26 #include <math.h>
    2726#include "compiler.h"
    2827#include "vector.h"
  • branches/presentation/src/lib/math/matrix.cc

    r7711 r9092  
    1414*/
    1515#include "matrix.h"
    16 #include <math.h>
     16#include <cmath>
    1717
    1818#ifdef DEBUG
  • branches/presentation/src/lib/math/matrix.h

    r5698 r9092  
    44 */
    55
    6 #include <math.h>
    76#include "vector.h"
    87
  • branches/presentation/src/lib/math/plane.h

    r7711 r9092  
    2424#define __PLANE_H_
    2525
    26 #include <math.h>
    2726#include "compiler.h"
    2827#include "vector.h"
  • branches/presentation/src/lib/math/quaternion.h

    r9090 r9092  
    2424#define __QUATERNION_H_
    2525
    26 #include <math.h>
    2726#include "compiler.h"
    2827//! PI the circle-constant
  • branches/presentation/src/lib/math/vector.cc

    r9090 r9092  
    2929#endif
    3030
    31 using namespace std;
    3231
    3332/////////////
  • branches/presentation/src/lib/math/vector.h

    r9090 r9092  
    2424#define __VECTOR_H_
    2525
    26 #include <math.h>
     26#include <cmath>
    2727#include "compiler.h"
    2828//! PI the circle-constant
     
    8989  void scale(const Vector& v) {   x *= v.x;  y *= v.y; z *= v.z; };
    9090  /** @returns the length of the vector */
    91   inline float len() const { return sqrt (x*x+y*y+z*z); }
     91  inline float len() const { return sqrt (x*x + y*y + z*z); }
    9292  /** normalizes the vector */
    9393  inline void normalize() { float l = len(); if( unlikely(l == 0.0))return; this->x=this->x/l; this->y=this->y/l; this->z=this->z/l; };
  • branches/presentation/src/world_entities/environments/mapped_water.cc

    r9021 r9092  
    2020#include "state.h"
    2121#include "t_animation.h"
    22 #include "math.h"
     22#include <cmath>
    2323#include "glgui.h"
    2424#include "shell_command.h"
Note: See TracChangeset for help on using the changeset viewer.