Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5711 in orxonox.OLD for branches/collision_detection/src


Ignore:
Timestamp:
Nov 22, 2005, 5:44:16 PM (19 years ago)
Author:
patrick
Message:

collision_detection: small fix for segfault prevention

Location:
branches/collision_detection/src
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc

    r5710 r5711  
    4242 *  standard constructor
    4343 */
    44 OBBTreeNode::OBBTreeNode (const OBBTree* tree) 
     44OBBTreeNode::OBBTreeNode (const OBBTree* tree)
    4545  : BVTreeNode()
    4646{
     
    111111 * on the triangle informations (triangle soup not polygon soup)
    112112 */
    113 void OBBTreeNode::spawnBVTree(const int depth, const modelInfo& modelInf, 
     113void OBBTreeNode::spawnBVTree(const int depth, const modelInfo& modelInf,
    114114                              const int* triangleIndexes, unsigned int length)
    115115{
     
    119119  this->depth = depth;
    120120
    121   this->bvElement = new OBB(); 
     121  this->bvElement = new OBB();
    122122  this->bvElement->modelInf = &modelInf;
    123123  this->bvElement->triangleIndexes = triangleIndexes;
    124124  this->bvElement->numTriangles = length;
    125  
     125
    126126  /* create the boxes in three steps */
    127127  this->calculateBoxCovariance(this->bvElement, modelInf, triangleIndexes, length);
     
    173173//   PRINTF(3)("OBB Depth: %i, tree index: %i, numVertices: %i\n", depth, treeIndex, length);
    174174//   this->depth = depth;
    175 // 
    176 // 
     175//
     176//
    177177//   this->bvElement = new OBB();
    178178//   this->bvElement->vertices = verticesList;
     
    185185//   this->calculateBoxAxis(this->bvElement, verticesList, length);
    186186//   PRINTF(3)("Calculated attributes3\n");
    187 // 
    188 // 
    189 // 
     187//
     188//
     189//
    190190//   if( likely( this->depth > 0))
    191191//   {
    192192//     this->forkBox(this->bvElement);
    193 // 
    194 // 
     193//
     194//
    195195//     if(this->tmpLen1 > 2)
    196196//     {
     
    203203//       PRINTF(3)("Aboarding tree walk: less than 3 vertices left\n");
    204204//     }
    205 // 
     205//
    206206//     if( this->tmpLen2 > 2)
    207207//     {
     
    218218
    219219
    220 void OBBTreeNode::calculateBoxCovariance(OBB* box, const modelInfo& modelInf, 
     220void OBBTreeNode::calculateBoxCovariance(OBB* box, const modelInfo& modelInf,
    221221                                         const int* triangleIndexes, unsigned int length)
    222222{
    223223  const sVec3D* verticesList;
    224  
     224
    225225  PRINTF(3)("Created OBBox\n");
    226  
     226
    227227  float     facelet[length];                         //!< surface area of the i'th triangle of the convex hull
    228228  float     face = 0.0f;                             //!< surface area of the entire convex hull
     
    235235
    236236
    237  
     237
    238238  /* fist compute all the convex hull face/facelets and centroids */
    239239  for( int i = 0; i < length ; ++i)
     
    262262
    263263
    264   /* now calculate the covariance matrix - if not written in three for-loops, 
     264  /* now calculate the covariance matrix - if not written in three for-loops,
    265265     it would compute faster: minor */
    266266  for( int j = 0; j < 3; ++j)
     
    281281  PRINTF(3)("-- Calculated Covariance\n");
    282282
    283    
     283
    284284  PRINTF(3)("\nVertex Data:\n");
    285285  for(int i = 0; i < length; i++)
     
    297297  }
    298298  box->center = center;
    299  
     299
    300300  PRINTF(3)("-- Written Result to OBB\n");
    301301}
    302302
    303303
    304 void OBBTreeNode::calculateBoxEigenvectors(OBB* box, const modelInfo& modInfo, 
     304void OBBTreeNode::calculateBoxEigenvectors(OBB* box, const modelInfo& modInfo,
    305305                                           const int* triangleIndexes, unsigned int length)
    306306{}
     
    640640bool OBBTreeNode::overlapTest(OBB* boxA, OBB* boxB, WorldEntity* nodeA, WorldEntity* nodeB)
    641641{
     642  if( boxB == NULL || boxA == NULL)
     643    return false;
     644
    642645  /* first check all axis */
    643646  Vector t;
  • branches/collision_detection/src/lib/event/Makefile.in

    r5674 r5711  
    210210          esac; \
    211211        done; \
    212         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/event/Makefile'; \
     212        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/event/Makefile'; \
    213213        cd $(top_srcdir) && \
    214           $(AUTOMAKE) --gnu  src/lib/event/Makefile
     214          $(AUTOMAKE) --foreign  src/lib/event/Makefile
    215215.PRECIOUS: Makefile
    216216Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/lib/graphics/Makefile.in

    r5674 r5711  
    227227          esac; \
    228228        done; \
    229         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/graphics/Makefile'; \
     229        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/graphics/Makefile'; \
    230230        cd $(top_srcdir) && \
    231           $(AUTOMAKE) --gnu  src/lib/graphics/Makefile
     231          $(AUTOMAKE) --foreign  src/lib/graphics/Makefile
    232232.PRECIOUS: Makefile
    233233Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/lib/graphics/importer/Makefile.in

    r5674 r5711  
    214214          esac; \
    215215        done; \
    216         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/graphics/importer/Makefile'; \
     216        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/graphics/importer/Makefile'; \
    217217        cd $(top_srcdir) && \
    218           $(AUTOMAKE) --gnu  src/lib/graphics/importer/Makefile
     218          $(AUTOMAKE) --foreign  src/lib/graphics/importer/Makefile
    219219.PRECIOUS: Makefile
    220220Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/lib/graphics/spatial_separation/Makefile.in

    r5674 r5711  
    204204          esac; \
    205205        done; \
    206         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/graphics/spatial_separation/Makefile'; \
     206        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/graphics/spatial_separation/Makefile'; \
    207207        cd $(top_srcdir) && \
    208           $(AUTOMAKE) --gnu  src/lib/graphics/spatial_separation/Makefile
     208          $(AUTOMAKE) --foreign  src/lib/graphics/spatial_separation/Makefile
    209209.PRECIOUS: Makefile
    210210Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/lib/gui/Makefile.in

    r5674 r5711  
    183183          esac; \
    184184        done; \
    185         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/gui/Makefile'; \
     185        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/gui/Makefile'; \
    186186        cd $(top_srcdir) && \
    187           $(AUTOMAKE) --gnu  src/lib/gui/Makefile
     187          $(AUTOMAKE) --foreign  src/lib/gui/Makefile
    188188.PRECIOUS: Makefile
    189189Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/lib/gui/gl_gui/Makefile.in

    r5674 r5711  
    230230          esac; \
    231231        done; \
    232         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/gui/gl_gui/Makefile'; \
     232        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/gui/gl_gui/Makefile'; \
    233233        cd $(top_srcdir) && \
    234           $(AUTOMAKE) --gnu  src/lib/gui/gl_gui/Makefile
     234          $(AUTOMAKE) --foreign  src/lib/gui/gl_gui/Makefile
    235235.PRECIOUS: Makefile
    236236Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/lib/gui/gtk_gui/Makefile.in

    r5674 r5711  
    232232          esac; \
    233233        done; \
    234         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/gui/gtk_gui/Makefile'; \
     234        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/gui/gtk_gui/Makefile'; \
    235235        cd $(top_srcdir) && \
    236           $(AUTOMAKE) --gnu  src/lib/gui/gtk_gui/Makefile
     236          $(AUTOMAKE) --foreign  src/lib/gui/gtk_gui/Makefile
    237237.PRECIOUS: Makefile
    238238Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/lib/particles/Makefile.in

    r5674 r5711  
    207207          esac; \
    208208        done; \
    209         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/particles/Makefile'; \
     209        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/particles/Makefile'; \
    210210        cd $(top_srcdir) && \
    211           $(AUTOMAKE) --gnu  src/lib/particles/Makefile
     211          $(AUTOMAKE) --foreign  src/lib/particles/Makefile
    212212.PRECIOUS: Makefile
    213213Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/lib/physics/Makefile.in

    r5674 r5711  
    215215          esac; \
    216216        done; \
    217         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/physics/Makefile'; \
     217        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/physics/Makefile'; \
    218218        cd $(top_srcdir) && \
    219           $(AUTOMAKE) --gnu  src/lib/physics/Makefile
     219          $(AUTOMAKE) --foreign  src/lib/physics/Makefile
    220220.PRECIOUS: Makefile
    221221Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/lib/shell/Makefile.in

    r5674 r5711  
    211211          esac; \
    212212        done; \
    213         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/shell/Makefile'; \
     213        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/shell/Makefile'; \
    214214        cd $(top_srcdir) && \
    215           $(AUTOMAKE) --gnu  src/lib/shell/Makefile
     215          $(AUTOMAKE) --foreign  src/lib/shell/Makefile
    216216.PRECIOUS: Makefile
    217217Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/lib/sound/Makefile.in

    r5674 r5711  
    207207          esac; \
    208208        done; \
    209         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/sound/Makefile'; \
     209        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/sound/Makefile'; \
    210210        cd $(top_srcdir) && \
    211           $(AUTOMAKE) --gnu  src/lib/sound/Makefile
     211          $(AUTOMAKE) --foreign  src/lib/sound/Makefile
    212212.PRECIOUS: Makefile
    213213Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/lib/tinyxml/Makefile.in

    r5674 r5711  
    203203          esac; \
    204204        done; \
    205         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/tinyxml/Makefile'; \
     205        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/tinyxml/Makefile'; \
    206206        cd $(top_srcdir) && \
    207           $(AUTOMAKE) --gnu  src/lib/tinyxml/Makefile
     207          $(AUTOMAKE) --foreign  src/lib/tinyxml/Makefile
    208208.PRECIOUS: Makefile
    209209Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/subprojects/Makefile.in

    r5674 r5711  
    190190          esac; \
    191191        done; \
    192         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/subprojects/Makefile'; \
     192        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/subprojects/Makefile'; \
    193193        cd $(top_srcdir) && \
    194           $(AUTOMAKE) --gnu  src/subprojects/Makefile
     194          $(AUTOMAKE) --foreign  src/subprojects/Makefile
    195195.PRECIOUS: Makefile
    196196Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/subprojects/collision_detection/Makefile.in

    r5687 r5711  
    250250          esac; \
    251251        done; \
    252         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/subprojects/collision_detection/Makefile'; \
     252        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/subprojects/collision_detection/Makefile'; \
    253253        cd $(top_srcdir) && \
    254           $(AUTOMAKE) --gnu  src/subprojects/collision_detection/Makefile
     254          $(AUTOMAKE) --foreign  src/subprojects/collision_detection/Makefile
    255255.PRECIOUS: Makefile
    256256Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/subprojects/importer/Makefile.in

    r5674 r5711  
    233233          esac; \
    234234        done; \
    235         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/subprojects/importer/Makefile'; \
     235        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/subprojects/importer/Makefile'; \
    236236        cd $(top_srcdir) && \
    237           $(AUTOMAKE) --gnu  src/subprojects/importer/Makefile
     237          $(AUTOMAKE) --foreign  src/subprojects/importer/Makefile
    238238.PRECIOUS: Makefile
    239239Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/subprojects/particles/Makefile.in

    r5674 r5711  
    253253          esac; \
    254254        done; \
    255         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/subprojects/particles/Makefile'; \
     255        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/subprojects/particles/Makefile'; \
    256256        cd $(top_srcdir) && \
    257           $(AUTOMAKE) --gnu  src/subprojects/particles/Makefile
     257          $(AUTOMAKE) --foreign  src/subprojects/particles/Makefile
    258258.PRECIOUS: Makefile
    259259Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/subprojects/testmain/Makefile.in

    r5674 r5711  
    197197          esac; \
    198198        done; \
    199         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/subprojects/testmain/Makefile'; \
     199        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/subprojects/testmain/Makefile'; \
    200200        cd $(top_srcdir) && \
    201           $(AUTOMAKE) --gnu  src/subprojects/testmain/Makefile
     201          $(AUTOMAKE) --foreign  src/subprojects/testmain/Makefile
    202202.PRECIOUS: Makefile
    203203Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • branches/collision_detection/src/util/Makefile.in

    r5674 r5711  
    235235          esac; \
    236236        done; \
    237         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/util/Makefile'; \
     237        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/util/Makefile'; \
    238238        cd $(top_srcdir) && \
    239           $(AUTOMAKE) --gnu  src/util/Makefile
     239          $(AUTOMAKE) --foreign  src/util/Makefile
    240240.PRECIOUS: Makefile
    241241Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Note: See TracChangeset for help on using the changeset viewer.