Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 5, 2006, 9:07:04 PM (17 years ago)
Author:
bottac
Message:

CrPhysicsFullWalk on Static Models and BSP Patches almost working. libODE≥0.7 required.
Screenshot: http://people.ee.ethz.ch/~bottac/Collision_ODE/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ODE/src/lib/graphics/importer/bsp_file.cc

    r9869 r9919  
    3939// STL Containers
    4040#include <vector>
     41
     42#include<ode/ode.h>
    4143
    4244
     
    332334    this->patchTrianglesPerRow = new char[7*4*this->numPatches];
    333335    this->VertexArrayModels  = new VertexArrayModel*[this->numPatches];
     336   
     337    this->ODE_Geometry = new dTriMeshDataID[this->numPatches*7*7];
     338    this->ODE_Geom_IDs = new dGeomID[this->numPatches* 7 *7];
     339
    334340
    335341    PRINTF(4)("BSP FILE:NumberOfPatches: %i . \n", numPatches);
     
    729735 */
    730736
     737uint  Ind [] = {8,0,9,     0,1,9,     9,1,10,   1,2,10,    10,2,11,  2,3,11,   11,3,12,  3,4,12,    12,4,13,  4,5,13,   13,5,14,   5,6,14,   14,6,15,  6,7,15, 
     738                16,8,17,   8,9,17,    17,9,18,  9,10,18,   18,10,19, 10,11,19, 19,11,20, 11,12,20,  20,12,21, 12,13,21, 21,13,22, 13,14,22,  22,14,23, 14,15,23,
     739                24,16,25,  16,17,25,  25,17,26, 17,18,26,  26,18,27, 18,19,27, 27,19,28, 19,20,28,  28,20,29, 20,21,29, 29,21,30, 21,22,30,  30,22,31, 22,23,31,
     740                32,24,33,  24,25,33,  33,25,34, 25,26,34,  34,26,35, 26,27,35, 35,27,36, 27,28,36,  36,28,37, 28,29,37 ,37,29,38, 29,30,38,  38,30,39, 30,31,39,
     741                40,32,41,  32,33,41,  41,33,42, 33,34,42,  42,34,43, 34,35,43, 43,35,44, 35,36,44,  44,36,45, 36,37,45, 45,37,46, 37,38,46,  46,38,47, 38,39,47,
     742                48,40,49,  40,41,49,  49,41,50, 41,42,50,  50,42,51, 42,43,51, 51,43,52, 43,44,52,  52,44,53, 44,45,53, 53,45,54, 45,46,54,  54,46,55, 46,47,55,
     743                56,48,57,  48,49,57,  57,49,58, 49,50,58,  58,50,59, 50,51,59, 59,51,60, 51,52,60,  60,52,61, 52,53,61, 61,53,62, 52,54,62,  62,54,63, 54,55,63, 0 };
     744
    731745
    732746void BspFile::tesselate(int iface)
     
    877891      }
    878892
    879       //Create indices
     893      // Create indices
    880894      GLuint* indices= & ((GLuint*)(this->patchIndexes))[level*level1*2*this->patchOffset];
    881895
     
    888902        }
    889903      }
     904       
     905        this->ODE_Geometry[this->patchOffset] = dGeomTriMeshDataCreate();
     906     // Create ODE Triangle Mesh Geometry
     907        dGeomTriMeshDataBuildSingle(this->ODE_Geometry[this->patchOffset], &((((BspVertex*)(this->patchVertice))[level1*level1*this->patchOffset ]).position[0]), sizeof(BspVertex), level1*level1, &(Ind[0]) ,7*14*3, 3* sizeof(uint) );
    890908
    891909
Note: See TracChangeset for help on using the changeset viewer.