diff --git a/Demos/BspDemo/BspConverter.cpp b/Demos/BspDemo/BspConverter.cpp index 2c9475a56..5fefd50c3 100644 --- a/Demos/BspDemo/BspConverter.cpp +++ b/Demos/BspDemo/BspConverter.cpp @@ -90,7 +90,7 @@ void BspConverter::convertBsp(BspLoader& bspLoader,float scaling) bool isEntity = false; btVector3 entityTarget(0.f,0.f,0.f); - AddConvexVerticesCollider(vertices,isEntity,entityTarget); + addConvexVerticesCollider(vertices,isEntity,entityTarget); } } @@ -107,11 +107,11 @@ void BspConverter::convertBsp(BspLoader& bspLoader,float scaling) for (i=0;i& planeEquations, const btVector3& point, float margin); ///this callback is called for each brush that succesfully converted into vertices - virtual void AddConvexVerticesCollider(std::vector& vertices, bool isEntity, const btVector3& entityTargetLocation) = 0; + virtual void addConvexVerticesCollider(std::vector& vertices, bool isEntity, const btVector3& entityTargetLocation) = 0; }; diff --git a/Demos/BspDemo/BspDemo.cpp b/Demos/BspDemo/BspDemo.cpp index 6a3cdb4e3..3ba3489e5 100644 --- a/Demos/BspDemo/BspDemo.cpp +++ b/Demos/BspDemo/BspDemo.cpp @@ -60,7 +60,7 @@ public: { } - virtual void AddConvexVerticesCollider(std::vector& vertices, bool isEntity, const btVector3& entityTargetLocation) + virtual void addConvexVerticesCollider(std::vector& vertices, bool isEntity, const btVector3& entityTargetLocation) { ///perhaps we can do something special with entities (isEntity) ///like adding a collision Triggering (as example) @@ -76,7 +76,7 @@ public: //this create an internal copy of the vertices btCollisionShape* shape = new btConvexHullShape(&vertices[0],vertices.size()); - m_demoApp->LocalCreatePhysicsObject(isDynamic, mass, startTransform,shape); + m_demoApp->localCreatePhysicsObject(isDynamic, mass, startTransform,shape); } } }; @@ -168,7 +168,7 @@ void BspDemo::initPhysics(char* bspfilename) //how to detect file size? memoryBuffer = malloc(size+1); fread(memoryBuffer,1,size,file); - bspLoader.LoadBSPFile( memoryBuffer); + bspLoader.loadBSPFile( memoryBuffer); BspToBulletConverter bsp2bullet(this); float bspScaling = 0.1f; diff --git a/Demos/BspDemo/BspLoader.cpp b/Demos/BspDemo/BspLoader.cpp index c4b3e437b..65ffc845e 100644 --- a/Demos/BspDemo/BspLoader.cpp +++ b/Demos/BspDemo/BspLoader.cpp @@ -40,12 +40,12 @@ bool endofscript; bool tokenready; // only true if UnGetToken was just called // -//LoadBSPFile +//loadBSPFile // int extrasize = 100; -bool BspLoader::LoadBSPFile( void* memoryBuffer) { +bool BspLoader::loadBSPFile( void* memoryBuffer) { BSPHeader *header = (BSPHeader*) memoryBuffer; @@ -53,73 +53,73 @@ bool BspLoader::LoadBSPFile( void* memoryBuffer) { if (header) { // swap the header - SwapBlock( (int *)header, sizeof(*header) ); + swapBlock( (int *)header, sizeof(*header) ); int length = (header->lumps[BSPLUMP_SHADERS].filelen) / sizeof(BSPShader); m_dshaders.resize(length+extrasize); - m_numShaders = CopyLump( header, BSPLUMP_SHADERS, &m_dshaders[0], sizeof(BSPShader) ); + m_numShaders = copyLump( header, BSPLUMP_SHADERS, &m_dshaders[0], sizeof(BSPShader) ); length = (header->lumps[LUMP_MODELS].filelen) / sizeof(BSPModel); m_dmodels.resize(length+extrasize); - m_nummodels = CopyLump( header, LUMP_MODELS, &m_dmodels[0], sizeof(BSPModel) ); + m_nummodels = copyLump( header, LUMP_MODELS, &m_dmodels[0], sizeof(BSPModel) ); length = (header->lumps[BSPLUMP_PLANES].filelen) / sizeof(BSPPlane); m_dplanes.resize(length+extrasize); - m_numplanes = CopyLump( header, BSPLUMP_PLANES, &m_dplanes[0], sizeof(BSPPlane) ); + m_numplanes = copyLump( header, BSPLUMP_PLANES, &m_dplanes[0], sizeof(BSPPlane) ); length = (header->lumps[BSPLUMP_LEAFS].filelen) / sizeof(BSPLeaf); m_dleafs.resize(length+extrasize); - m_numleafs = CopyLump( header, BSPLUMP_LEAFS, &m_dleafs[0], sizeof(BSPLeaf) ); + m_numleafs = copyLump( header, BSPLUMP_LEAFS, &m_dleafs[0], sizeof(BSPLeaf) ); length = (header->lumps[BSPLUMP_NODES].filelen) / sizeof(BSPNode); m_dnodes.resize(length+extrasize); - m_numnodes = CopyLump( header, BSPLUMP_NODES, &m_dnodes[0], sizeof(BSPNode) ); + m_numnodes = copyLump( header, BSPLUMP_NODES, &m_dnodes[0], sizeof(BSPNode) ); length = (header->lumps[BSPLUMP_LEAFSURFACES].filelen) / sizeof(m_dleafsurfaces[0]); m_dleafsurfaces.resize(length+extrasize); - m_numleafsurfaces = CopyLump( header, BSPLUMP_LEAFSURFACES, &m_dleafsurfaces[0], sizeof(m_dleafsurfaces[0]) ); + m_numleafsurfaces = copyLump( header, BSPLUMP_LEAFSURFACES, &m_dleafsurfaces[0], sizeof(m_dleafsurfaces[0]) ); length = (header->lumps[BSPLUMP_LEAFBRUSHES].filelen) / sizeof(m_dleafbrushes[0]) ; m_dleafbrushes.resize(length+extrasize); - m_numleafbrushes = CopyLump( header, BSPLUMP_LEAFBRUSHES, &m_dleafbrushes[0], sizeof(m_dleafbrushes[0]) ); + m_numleafbrushes = copyLump( header, BSPLUMP_LEAFBRUSHES, &m_dleafbrushes[0], sizeof(m_dleafbrushes[0]) ); length = (header->lumps[LUMP_BRUSHES].filelen) / sizeof(BSPBrush); m_dbrushes.resize(length+extrasize); - m_numbrushes = CopyLump( header, LUMP_BRUSHES, &m_dbrushes[0], sizeof(BSPBrush) ); + m_numbrushes = copyLump( header, LUMP_BRUSHES, &m_dbrushes[0], sizeof(BSPBrush) ); length = (header->lumps[LUMP_BRUSHSIDES].filelen) / sizeof(BSPBrushSide); m_dbrushsides.resize(length+extrasize); - m_numbrushsides = CopyLump( header, LUMP_BRUSHSIDES, &m_dbrushsides[0], sizeof(BSPBrushSide) ); + m_numbrushsides = copyLump( header, LUMP_BRUSHSIDES, &m_dbrushsides[0], sizeof(BSPBrushSide) ); length = (header->lumps[LUMP_SURFACES].filelen) / sizeof(BSPSurface); m_drawSurfaces.resize(length+extrasize); - m_numDrawSurfaces = CopyLump( header, LUMP_SURFACES, &m_drawSurfaces[0], sizeof(BSPSurface) ); + m_numDrawSurfaces = copyLump( header, LUMP_SURFACES, &m_drawSurfaces[0], sizeof(BSPSurface) ); length = (header->lumps[LUMP_DRAWINDEXES].filelen) / sizeof(m_drawIndexes[0]); m_drawIndexes.resize(length+extrasize); - m_numDrawIndexes = CopyLump( header, LUMP_DRAWINDEXES, &m_drawIndexes[0], sizeof(m_drawIndexes[0]) ); + m_numDrawIndexes = copyLump( header, LUMP_DRAWINDEXES, &m_drawIndexes[0], sizeof(m_drawIndexes[0]) ); length = (header->lumps[LUMP_VISIBILITY].filelen) / 1; m_visBytes.resize(length+extrasize); - m_numVisBytes = CopyLump( header, LUMP_VISIBILITY, &m_visBytes[0], 1 ); + m_numVisBytes = copyLump( header, LUMP_VISIBILITY, &m_visBytes[0], 1 ); length = (header->lumps[LUMP_LIGHTMAPS].filelen) / 1; m_lightBytes.resize(length+extrasize); - m_numLightBytes = CopyLump( header, LUMP_LIGHTMAPS, &m_lightBytes[0], 1 ); + m_numLightBytes = copyLump( header, LUMP_LIGHTMAPS, &m_lightBytes[0], 1 ); length = (header->lumps[BSPLUMP_ENTITIES].filelen) / 1; m_dentdata.resize(length+extrasize); - m_entdatasize = CopyLump( header, BSPLUMP_ENTITIES, &m_dentdata[0], 1); + m_entdatasize = copyLump( header, BSPLUMP_ENTITIES, &m_dentdata[0], 1); length = (header->lumps[LUMP_LIGHTGRID].filelen) / 1; m_gridData.resize(length+extrasize); - m_numGridPoints = CopyLump( header, LUMP_LIGHTGRID, &m_gridData[0], 8 ); + m_numGridPoints = copyLump( header, LUMP_LIGHTGRID, &m_gridData[0], 8 ); // swap everything - SwapBSPFile(); + swapBSPFile(); return true; @@ -129,7 +129,7 @@ bool BspLoader::LoadBSPFile( void* memoryBuffer) { -const char* BspLoader::ValueForKey( const BSPEntity* ent, const char* key ) const { +const char* BspLoader::getValueForKey( const BSPEntity* ent, const char* key ) const { const BSPKeyValuePair* ep; @@ -141,17 +141,17 @@ const char* BspLoader::ValueForKey( const BSPEntity* ent, const char* key ) con return ""; } -float BspLoader::FloatForKey( const BSPEntity *ent, const char *key ) { +float BspLoader::getFloatForKey( const BSPEntity *ent, const char *key ) { const char *k; - k = ValueForKey( ent, key ); + k = getValueForKey( ent, key ); return float(atof(k)); } -bool BspLoader::GetVectorForKey( const BSPEntity *ent, const char *key, BSPVector3 vec ) { +bool BspLoader::getVectorForKey( const BSPEntity *ent, const char *key, BSPVector3 vec ) { const char *k; - k = ValueForKey (ent, key); + k = getValueForKey (ent, key); if (strcmp(k, "")) { sscanf (k, "%f %f %f", &vec[0], &vec[1], &vec[2]); @@ -165,10 +165,10 @@ bool BspLoader::GetVectorForKey( const BSPEntity *ent, const char *key, BSPVect /* ============== -ParseFromMemory +parseFromMemory ============== */ -void BspLoader::ParseFromMemory (char *buffer, int size) +void BspLoader::parseFromMemory (char *buffer, int size) { script = scriptstack; script++; @@ -188,7 +188,7 @@ void BspLoader::ParseFromMemory (char *buffer, int size) } -bool BspLoader::EndOfScript (bool crossline) +bool BspLoader::isEndOfScript (bool crossline) { if (!crossline) //printf("Line %i is incomplete\n",scriptline); @@ -208,16 +208,16 @@ bool BspLoader::EndOfScript (bool crossline) script--; scriptline = script->line; //printf ("returning to %s\n", script->filename); - return GetToken (crossline); + return getToken (crossline); } /* ============== -GetToken +getToken ============== */ -bool BspLoader::GetToken (bool crossline) +bool BspLoader::getToken (bool crossline) { char *token_p; @@ -228,7 +228,7 @@ bool BspLoader::GetToken (bool crossline) } if (script->script_p >= script->end_p) - return EndOfScript (crossline); + return isEndOfScript (crossline); // // skip space @@ -237,7 +237,7 @@ skipspace: while (*script->script_p <= 32) { if (script->script_p >= script->end_p) - return EndOfScript (crossline); + return isEndOfScript (crossline); if (*script->script_p++ == '\n') { if (!crossline) @@ -249,7 +249,7 @@ skipspace: } if (script->script_p >= script->end_p) - return EndOfScript (crossline); + return isEndOfScript (crossline); // ; # // comments if (*script->script_p == ';' || *script->script_p == '#' @@ -261,7 +261,7 @@ skipspace: } while (*script->script_p++ != '\n') if (script->script_p >= script->end_p) - return EndOfScript (crossline); + return isEndOfScript (crossline); scriptline = script->line++; goto skipspace; } @@ -281,7 +281,7 @@ skipspace: } script->script_p++; if (script->script_p >= script->end_p) - return EndOfScript (crossline); + return isEndOfScript (crossline); } script->script_p += 2; goto skipspace; @@ -324,9 +324,9 @@ skipspace: if (!strcmp (token, "$include")) { - //GetToken (false); + //getToken (false); //AddScriptToStack (token); - return false;//GetToken (crossline); + return false;//getToken (crossline); } return true; @@ -340,7 +340,7 @@ char *BspLoader::copystring(const char *s) return b; } -void BspLoader::StripTrailing( char *e ) { +void BspLoader::stripTrailing( char *e ) { char *s; s = e + strlen(e)-1; @@ -352,10 +352,10 @@ void BspLoader::StripTrailing( char *e ) { } /* ================= -ParseEpair +parseEpair ================= */ -BSPKeyValuePair *BspLoader::ParseEpair( void ) { +BSPKeyValuePair *BspLoader::parseEpair( void ) { BSPKeyValuePair *e; e = (struct BSPPair*) malloc( sizeof(BSPKeyValuePair)); @@ -365,7 +365,7 @@ BSPKeyValuePair *BspLoader::ParseEpair( void ) { //printf ("ParseEpar: token too long"); } e->key = copystring( token ); - GetToken( false ); + getToken( false ); if ( strlen(token) >= BSPMAX_VALUE-1 ) { //printf ("ParseEpar: token too long"); @@ -374,8 +374,8 @@ BSPKeyValuePair *BspLoader::ParseEpair( void ) { // strip trailing spaces that sometimes get accidentally // added in the editor - StripTrailing( e->key ); - StripTrailing( e->value ); + stripTrailing( e->key ); + stripTrailing( e->value ); return e; } @@ -383,20 +383,20 @@ BSPKeyValuePair *BspLoader::ParseEpair( void ) { /* ================ -ParseEntity +parseEntity ================ */ -bool BspLoader::ParseEntity( void ) { +bool BspLoader::parseEntity( void ) { BSPKeyValuePair *e; BSPEntity *mapent; - if ( !GetToken (true) ) { + if ( !getToken (true) ) { return false; } if ( strcmp (token, "{") ) { - //printf ("ParseEntity: { not found"); + //printf ("parseEntity: { not found"); } BSPEntity bla; @@ -413,13 +413,13 @@ bool BspLoader::ParseEntity( void ) { m_num_entities++; do { - if ( !GetToken (true) ) { - //printf("ParseEntity: EOF without closing brace"); + if ( !getToken (true) ) { + //printf("parseEntity: EOF without closing brace"); } if ( !strcmp (token, "}") ) { break; } - e = (struct BSPPair*)ParseEpair (); + e = (struct BSPPair*)parseEpair (); e->next = mapent->epairs; mapent->epairs = e; } while (1); @@ -429,18 +429,18 @@ bool BspLoader::ParseEntity( void ) { /* ================ -ParseEntities +parseEntities Parses the dentdata string into entities ================ */ -void BspLoader::ParseEntities( void ) { +void BspLoader::parseEntities( void ) { m_num_entities = 0; m_entities.clear(); - ParseFromMemory( &m_dentdata[0], m_entdatasize ); + parseFromMemory( &m_dentdata[0], m_entdatasize ); - while ( ParseEntity () ) { + while ( parseEntity () ) { } } @@ -456,7 +456,7 @@ int BspLoader::getMachineEndianness() return BSP_BIG_ENDIAN; } -short BspLoader::LittleShort (short l) +short BspLoader::isLittleShort (short l) { if (machineEndianness() == BSP_BIG_ENDIAN) { @@ -471,7 +471,7 @@ short BspLoader::LittleShort (short l) return l; } -short BspLoader::BigShort (short l) +short BspLoader::isBigShort (short l) { if (machineEndianness() == BSP_BIG_ENDIAN) { @@ -490,7 +490,7 @@ short BspLoader::BigShort (short l) } -int BspLoader::LittleLong (int l) +int BspLoader::isLittleLong (int l) { if (machineEndianness() == BSP_BIG_ENDIAN) { @@ -509,7 +509,7 @@ int BspLoader::LittleLong (int l) } -int BspLoader::BigLong (int l) +int BspLoader::isBigLong (int l) { if (machineEndianness() == BSP_BIG_ENDIAN) { @@ -529,7 +529,7 @@ int BspLoader::BigLong (int l) } -float BspLoader::LittleFloat (float l) +float BspLoader::isLittleFloat (float l) { if (machineEndianness() == BSP_BIG_ENDIAN) { @@ -548,7 +548,7 @@ float BspLoader::LittleFloat (float l) return l; } -float BspLoader::BigFloat (float l) +float BspLoader::isBigFloat (float l) { if (machineEndianness() == BSP_BIG_ENDIAN) { @@ -572,31 +572,31 @@ float BspLoader::BigFloat (float l) // -// SwapBlock +// swapBlock // If all values are 32 bits, this can be used to swap everything // -void BspLoader::SwapBlock( int *block, int sizeOfBlock ) { +void BspLoader::swapBlock( int *block, int sizeOfBlock ) { int i; sizeOfBlock >>= 2; for ( i = 0 ; i < sizeOfBlock ; i++ ) { - block[i] = LittleLong( block[i] ); + block[i] = isLittleLong( block[i] ); } } // -// CopyLump +// copyLump // -int BspLoader::CopyLump( BSPHeader *header, int lump, void *dest, int size ) { +int BspLoader::copyLump( BSPHeader *header, int lump, void *dest, int size ) { int length, ofs; length = header->lumps[lump].filelen; ofs = header->lumps[lump].fileofs; //if ( length % size ) { - // printf ("LoadBSPFile: odd lump size"); + // printf ("loadBSPFile: odd lump size"); //} memcpy( dest, (unsigned char *)header + ofs, length ); @@ -608,52 +608,52 @@ int BspLoader::CopyLump( BSPHeader *header, int lump, void *dest, int size ) { // -// SwapBSPFile +// swapBSPFile // -void BspLoader::SwapBSPFile( void ) { +void BspLoader::swapBSPFile( void ) { int i; // models - SwapBlock( (int *) &m_dmodels[0], m_nummodels * sizeof( m_dmodels[0] ) ); + swapBlock( (int *) &m_dmodels[0], m_nummodels * sizeof( m_dmodels[0] ) ); // shaders (don't swap the name) for ( i = 0 ; i < m_numShaders ; i++ ) { - m_dshaders[i].contentFlags = LittleLong( m_dshaders[i].contentFlags ); - m_dshaders[i].surfaceFlags = LittleLong( m_dshaders[i].surfaceFlags ); + m_dshaders[i].contentFlags = isLittleLong( m_dshaders[i].contentFlags ); + m_dshaders[i].surfaceFlags = isLittleLong( m_dshaders[i].surfaceFlags ); } // planes - SwapBlock( (int *)&m_dplanes[0], m_numplanes * sizeof( m_dplanes[0] ) ); + swapBlock( (int *)&m_dplanes[0], m_numplanes * sizeof( m_dplanes[0] ) ); // nodes - SwapBlock( (int *)&m_dnodes[0], m_numnodes * sizeof( m_dnodes[0] ) ); + swapBlock( (int *)&m_dnodes[0], m_numnodes * sizeof( m_dnodes[0] ) ); // leafs - SwapBlock( (int *)&m_dleafs[0], m_numleafs * sizeof( m_dleafs[0] ) ); + swapBlock( (int *)&m_dleafs[0], m_numleafs * sizeof( m_dleafs[0] ) ); // leaffaces - SwapBlock( (int *)&m_dleafsurfaces[0], m_numleafsurfaces * sizeof( m_dleafsurfaces[0] ) ); + swapBlock( (int *)&m_dleafsurfaces[0], m_numleafsurfaces * sizeof( m_dleafsurfaces[0] ) ); // leafbrushes - SwapBlock( (int *)&m_dleafbrushes[0], m_numleafbrushes * sizeof( m_dleafbrushes[0] ) ); + swapBlock( (int *)&m_dleafbrushes[0], m_numleafbrushes * sizeof( m_dleafbrushes[0] ) ); // brushes - SwapBlock( (int *)&m_dbrushes[0], m_numbrushes * sizeof( m_dbrushes[0] ) ); + swapBlock( (int *)&m_dbrushes[0], m_numbrushes * sizeof( m_dbrushes[0] ) ); // brushsides - SwapBlock( (int *)&m_dbrushsides[0], m_numbrushsides * sizeof( m_dbrushsides[0] ) ); + swapBlock( (int *)&m_dbrushsides[0], m_numbrushsides * sizeof( m_dbrushsides[0] ) ); // vis - ((int *)&m_visBytes)[0] = LittleLong( ((int *)&m_visBytes)[0] ); - ((int *)&m_visBytes)[1] = LittleLong( ((int *)&m_visBytes)[1] ); + ((int *)&m_visBytes)[0] = isLittleLong( ((int *)&m_visBytes)[0] ); + ((int *)&m_visBytes)[1] = isLittleLong( ((int *)&m_visBytes)[1] ); // drawindexes - SwapBlock( (int *)&m_drawIndexes[0], m_numDrawIndexes * sizeof( m_drawIndexes[0] ) ); + swapBlock( (int *)&m_drawIndexes[0], m_numDrawIndexes * sizeof( m_drawIndexes[0] ) ); // drawsurfs - SwapBlock( (int *)&m_drawSurfaces[0], m_numDrawSurfaces * sizeof( m_drawSurfaces[0] ) ); + swapBlock( (int *)&m_drawSurfaces[0], m_numDrawSurfaces * sizeof( m_drawSurfaces[0] ) ); } @@ -668,17 +668,17 @@ bool BspLoader::findVectorByName(float* outvec,const char* name) bool found = false; - ParseEntities(); + parseEntities(); for ( int i = 1; i < m_num_entities; i++ ) { - cl = ValueForKey (&m_entities[i], "classname"); + cl = getValueForKey (&m_entities[i], "classname"); if ( !strcmp( cl, "info_player_start" ) ) { - GetVectorForKey( &m_entities[i], "origin", origin ); + getVectorForKey( &m_entities[i], "origin", origin ); found = true; break; } if ( !strcmp( cl, "info_player_deathmatch" ) ) { - GetVectorForKey( &m_entities[i], "origin", origin ); + getVectorForKey( &m_entities[i], "origin", origin ); found = true; break; } @@ -703,7 +703,7 @@ const BSPEntity * BspLoader::getEntityByValue( const char* name, const char* val const BSPEntity& ent = m_entities[i]; - const char* cl = ValueForKey (&m_entities[i], name); + const char* cl = getValueForKey (&m_entities[i], name); if ( !strcmp( cl, value ) ) { entity = &ent; break; diff --git a/Demos/BspDemo/BspLoader.h b/Demos/BspDemo/BspLoader.h index 36874f051..f2ceed470 100644 --- a/Demos/BspDemo/BspLoader.h +++ b/Demos/BspDemo/BspLoader.h @@ -184,15 +184,15 @@ class BspLoader printf("Machine is Little Endian\n"); } } - bool LoadBSPFile( void* memoryBuffer); + bool loadBSPFile( void* memoryBuffer); - const char* ValueForKey( const BSPEntity *ent, const char *key ) const; + const char* getValueForKey( const BSPEntity *ent, const char *key ) const; - bool GetVectorForKey( const BSPEntity *ent, const char *key, BSPVector3 vec ); + bool getVectorForKey( const BSPEntity *ent, const char *key, BSPVector3 vec ); - float FloatForKey( const BSPEntity *ent, const char *key ); + float getFloatForKey( const BSPEntity *ent, const char *key ); - void ParseEntities( void ); + void parseEntities( void ); bool findVectorByName(float* outvec,const char* name); @@ -201,35 +201,35 @@ class BspLoader protected: - void ParseFromMemory (char *buffer, int size); + void parseFromMemory (char *buffer, int size); - bool EndOfScript (bool crossline); + bool isEndOfScript (bool crossline); - bool GetToken (bool crossline); + bool getToken (bool crossline); char *copystring(const char *s); - void StripTrailing( char *e ); + void stripTrailing( char *e ); - BSPKeyValuePair * ParseEpair( void ); + BSPKeyValuePair * parseEpair( void ); - bool ParseEntity( void ); + bool parseEntity( void ); - short LittleShort (short l); - int LittleLong (int l); - float LittleFloat (float l); + short isLittleShort (short l); + int isLittleLong (int l); + float isLittleFloat (float l); - int BigLong (int l); - short BigShort (short l); - float BigFloat (float l); + int isBigLong (int l); + short isBigShort (short l); + float isBigFloat (float l); - void SwapBlock( int *block, int sizeOfBlock ); + void swapBlock( int *block, int sizeOfBlock ); - int CopyLump( BSPHeader *header, int lump, void *dest, int size ); + int copyLump( BSPHeader *header, int lump, void *dest, int size ); - void SwapBSPFile( void ); + void swapBSPFile( void ); diff --git a/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp b/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp index 6c4a5ec99..f096690c8 100644 --- a/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp +++ b/Demos/CcdPhysicsDemo/CcdPhysicsDemo.cpp @@ -29,7 +29,7 @@ subject to the following restrictions: #include //printf debugging float deltaTime = 1.f/60.f; - +float gCollisionMargin = 0.05f; #include "CcdPhysicsDemo.h" #include "GL_ShapeDrawer.h" @@ -77,7 +77,8 @@ btCollisionShape* shapePtr[numShapes] = new btBoxShape (btVector3(50,10,50)), #endif - new btBoxShape (btVector3(CUBE_HALF_EXTENTS,CUBE_HALF_EXTENTS,CUBE_HALF_EXTENTS)), + new btCylinderShape (btVector3(CUBE_HALF_EXTENTS-gCollisionMargin,CUBE_HALF_EXTENTS-gCollisionMargin,CUBE_HALF_EXTENTS-gCollisionMargin)), + //new btBoxShape (btVector3(CUBE_HALF_EXTENTS,CUBE_HALF_EXTENTS,CUBE_HALF_EXTENTS)), new btSphereShape (CUBE_HALF_EXTENTS- 0.05f), //new btConeShape(CUBE_HALF_EXTENTS,2.f*CUBE_HALF_EXTENTS), @@ -109,7 +110,7 @@ int main(int argc,char** argv) ccdDemo->setCameraDistance(26.f); - return glutmain(argc, argv,640,480,"Bullet Physics Demo. http://www.continuousphysics.com/Bullet/phpBB2/",ccdDemo); + return glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bullet.sf.net",ccdDemo); } @@ -190,16 +191,16 @@ void CcdPhysicsDemo::clientResetScene() if ((getDebugMode() & btIDebugDraw::DBG_NoHelpText)) { - if (ctrl->GetRigidBody()->GetCollisionShape()->GetShapeType() != SPHERE_SHAPE_PROXYTYPE) + if (ctrl->getRigidBody()->getCollisionShape()->getShapeType() != SPHERE_SHAPE_PROXYTYPE) { - ctrl->GetRigidBody()->SetCollisionShape(shapePtr[2]); + ctrl->getRigidBody()->SetCollisionShape(shapePtr[2]); } else { - ctrl->GetRigidBody()->SetCollisionShape(shapePtr[1]); + ctrl->getRigidBody()->SetCollisionShape(shapePtr[1]); } - btBroadphaseProxy* bpproxy = ctrl->GetRigidBody()->m_broadphaseHandle; - m_physicsEnvironmentPtr->GetBroadphase()->CleanProxyFromPairs(bpproxy); + btBroadphaseProxy* bpproxy = ctrl->getRigidBody()->m_broadphaseHandle; + m_physicsEnvironmentPtr->getBroadphase()->cleanProxyFromPairs(bpproxy); } //stack them @@ -245,7 +246,7 @@ void CcdPhysicsDemo::initPhysics() // btOverlappingPairCache* broadphase = new btSimpleBroadphase; #ifdef REGISTER_CUSTOM_COLLISION_ALGORITHM - dispatcher->RegisterCollisionCreateFunc(SPHERE_SHAPE_PROXYTYPE,SPHERE_SHAPE_PROXYTYPE,new btSphereSphereCollisionAlgorithm::CreateFunc); + dispatcher->registerCollisionCreateFunc(SPHERE_SHAPE_PROXYTYPE,SPHERE_SHAPE_PROXYTYPE,new btSphereSphereCollisionAlgorithm::CreateFunc); #endif //REGISTER_CUSTOM_COLLISION_ALGORITHM btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver; @@ -255,7 +256,7 @@ void CcdPhysicsDemo::initPhysics() #ifdef USER_DEFINED_FRICTION_MODEL btSequentialImpulseConstraintSolver* solver = (btSequentialImpulseConstraintSolver*) m_physicsEnvironmentPtr->GetConstraintSolver(); - //solver->SetContactSolverFunc(ContactSolverFunc func,USER_CONTACT_SOLVER_TYPE1,DEFAULT_CONTACT_SOLVER_TYPE); + //solver->setContactSolverFunc(ContactSolverFunc func,USER_CONTACT_SOLVER_TYPE1,DEFAULT_CONTACT_SOLVER_TYPE); solver->SetFrictionSolverFunc(myFrictionModel,USER_CONTACT_SOLVER_TYPE1,DEFAULT_CONTACT_SOLVER_TYPE); solver->SetFrictionSolverFunc(myFrictionModel,DEFAULT_CONTACT_SOLVER_TYPE,USER_CONTACT_SOLVER_TYPE1); solver->SetFrictionSolverFunc(myFrictionModel,USER_CONTACT_SOLVER_TYPE1,USER_CONTACT_SOLVER_TYPE1); @@ -288,15 +289,15 @@ void CcdPhysicsDemo::initPhysics() btTransform ident; ident.setIdentity(); ident.setOrigin(btVector3(0,0,0)); - compoundShape->AddChildShape(ident,oldShape);// + compoundShape->addChildShape(ident,oldShape);// ident.setOrigin(btVector3(0,0,2)); - compoundShape->AddChildShape(ident,new btSphereShape(0.9));// + compoundShape->addChildShape(ident,new btSphereShape(0.9));// } for (i=0;iSetMargin(0.05f); + shape->setMargin(gCollisionMargin); bool isDyna = i>0; @@ -332,9 +333,9 @@ void CcdPhysicsDemo::initPhysics() if (!isDyna) mass = 0.f; - btRigidBody* body = LocalCreateRigidBody(isDyna,mass,trans,shape); + btRigidBody* body = localCreateRigidBody(isDyna,mass,trans,shape); - m_dynamicsWorld->AddCollisionObject(body); + m_dynamicsWorld->addCollisionObject(body); // Only do CCD if motion in one timestep (1.f/60.f) exceeds CUBE_HALF_EXTENTS body->m_ccdSquareMotionTreshold = CUBE_HALF_EXTENTS; @@ -344,7 +345,7 @@ void CcdPhysicsDemo::initPhysics() #ifdef USER_DEFINED_FRICTION_MODEL ///Advanced use: override the friction solver - ctrl->GetRigidBody()->m_frictionSolverType = USER_CONTACT_SOLVER_TYPE1; + ctrl->getRigidBody()->m_frictionSolverType = USER_CONTACT_SOLVER_TYPE1; #endif //USER_DEFINED_FRICTION_MODEL } diff --git a/Demos/ColladaDemo/ColladaConverter.cpp b/Demos/ColladaDemo/ColladaConverter.cpp index 8caf5f355..d3340776d 100644 --- a/Demos/ColladaDemo/ColladaConverter.cpp +++ b/Demos/ColladaDemo/ColladaConverter.cpp @@ -185,20 +185,20 @@ bool ColladaConverter::convert() printf(" X is Up Data and Hiearchies must be converted!\n" ); printf(" Conversion to X axis Up isn't currently supported!\n" ); printf(" COLLADA_RT defaulting to Y Up \n" ); - SetGravity(btVector3(-10,0,0)); - SetCameraInfo(btVector3(1,0,0),1); + setGravity(btVector3(-10,0,0)); + setCameraInfo(btVector3(1,0,0),1); break; case UPAXISTYPE_Y_UP: printf(" Y Axis is Up for this file \n" ); printf(" COLLADA_RT set to Y Up \n" ); - SetGravity(btVector3(0,-10,0)); - SetCameraInfo(btVector3(0,1,0),0); + setGravity(btVector3(0,-10,0)); + setCameraInfo(btVector3(0,1,0),0); break; case UPAXISTYPE_Z_UP: printf(" Z Axis is Up for this file \n" ); printf(" All Geometry and Hiearchies must be converted!\n" ); - SetGravity(btVector3(0,0,-10)); + setGravity(btVector3(0,0,-10)); break; default: @@ -294,7 +294,7 @@ bool ColladaConverter::convert() const domFloat3 grav = physicsSceneRef->getTechnique_common()->getGravity()->getValue(); printf("gravity set to %f,%f,%f\n",grav.get(0),grav.get(1),grav.get(2)); - SetGravity(btVector3(grav.get(0),grav.get(1),grav.get(2))); + setGravity(btVector3(grav.get(0),grav.get(1),grav.get(2))); } } @@ -481,7 +481,7 @@ bool ColladaConverter::convert() ConstraintInput cInput; cInput.m_instance_physicsModelRef = instance_physicsModelRef; cInput.m_model = model; - PrepareConstraints(cInput); + prepareConstraints(cInput); } //also don't forget the model's 'instance_physics_models! @@ -496,7 +496,7 @@ bool ColladaConverter::convert() ConstraintInput cInput; cInput.m_instance_physicsModelRef = instancePhysicsModelRef; cInput.m_model = model; - PrepareConstraints(cInput); + prepareConstraints(cInput); } @@ -509,7 +509,7 @@ bool ColladaConverter::convert() } -void ColladaConverter::PrepareConstraints(ConstraintInput& input) +void ColladaConverter::prepareConstraints(ConstraintInput& input) { domInstance_physics_modelRef instance_physicsModelRef = input.m_instance_physicsModelRef; domPhysics_modelRef model = input.m_model; @@ -699,7 +699,7 @@ void ColladaConverter::PreparePhysicsObject(struct btRigidBodyInput& input, bool - CcdPhysicsController* ctrl = CreatePhysicsObject(isDynamics,mass,startTransform,colShape); + CcdPhysicsController* ctrl = createPhysicsObject(isDynamics,mass,startTransform,colShape); if (ctrl) { //for bodyName lookup in constraints @@ -764,7 +764,7 @@ bool ColladaConverter::saveAs(const char* filename) } { - btQuaternion quat = m_physObjects[i]->GetRigidBody()->getCenterOfMassTransform().getRotation(); + btQuaternion quat = m_physObjects[i]->getRigidBody()->getCenterOfMassTransform().getRotation(); btVector3 axis(quat.getX(),quat.getY(),quat.getZ()); axis[3] = 0.f; //check for axis length @@ -1035,7 +1035,7 @@ void ColladaConverter::ConvertRigidBodyRef( btRigidBodyInput& rbInput,btRigidBod k+=meshPart.m_triangleIndexStride; verts[i].setValue(fl0,fl1,fl2); } - trimesh->AddTriangle(verts[0],verts[1],verts[2]); + trimesh->addTriangle(verts[0],verts[1],verts[2]); } } } @@ -1051,7 +1051,7 @@ void ColladaConverter::ConvertRigidBodyRef( btRigidBodyInput& rbInput,btRigidBod //int m_vertexStride;//use the accessor for this //}; - //tindexArray->AddIndexedMesh(meshPart); + //tindexArray->addIndexedMesh(meshPart); if (rbOutput.m_isDynamics) { printf("moving concave not supported, transformed into convex\n"); @@ -1144,7 +1144,7 @@ void ColladaConverter::ConvertRigidBodyRef( btRigidBodyInput& rbInput,btRigidBod domFloat fl2 = listFloats.get(k+2); //printf("float %f %f %f\n",fl0,fl1,fl2); - convexHullShape->AddPoint(btPoint3(fl0,fl1,fl2)); + convexHullShape->addPoint(btPoint3(fl0,fl1,fl2)); } } @@ -1192,7 +1192,7 @@ void ColladaConverter::ConvertRigidBodyRef( btRigidBodyInput& rbInput,btRigidBod domFloat fl2 = listFloats.get(k+2); //printf("float %f %f %f\n",fl0,fl1,fl2); - convexHullShape->AddPoint(btPoint3(fl0,fl1,fl2)); + convexHullShape->addPoint(btPoint3(fl0,fl1,fl2)); } } @@ -1205,10 +1205,10 @@ void ColladaConverter::ConvertRigidBodyRef( btRigidBodyInput& rbInput,btRigidBod } - if (convexHullShape->GetNumVertices()) + if (convexHullShape->getNumVertices()) { rbOutput.m_colShape = convexHullShape; - printf("created convexHullShape with %i points\n",convexHullShape->GetNumVertices()); + printf("created convexHullShape with %i points\n",convexHullShape->getNumVertices()); } else { delete convexHullShape; @@ -1251,7 +1251,7 @@ void ColladaConverter::ConvertRigidBodyRef( btRigidBodyInput& rbInput,btRigidBod ); } - rbOutput.m_compoundShape->AddChildShape(localTransform,rbOutput.m_colShape); + rbOutput.m_compoundShape->addChildShape(localTransform,rbOutput.m_colShape); rbOutput.m_colShape = 0; } } diff --git a/Demos/ColladaDemo/ColladaConverter.h b/Demos/ColladaDemo/ColladaConverter.h index 554e5c7bf..f1abf71d3 100644 --- a/Demos/ColladaDemo/ColladaConverter.h +++ b/Demos/ColladaDemo/ColladaConverter.h @@ -46,7 +46,7 @@ protected: void PreparePhysicsObject(struct btRigidBodyInput& input, bool isDynamics, float mass,btCollisionShape* colShape); - void PrepareConstraints(ConstraintInput& input); + void prepareConstraints(ConstraintInput& input); void ConvertRigidBodyRef( struct btRigidBodyInput& , struct btRigidBodyOutput& output ); @@ -76,14 +76,14 @@ public: const btVector3& angularMaxLimits ) = 0; - virtual CcdPhysicsController* CreatePhysicsObject(bool isDynamic, + virtual CcdPhysicsController* createPhysicsObject(bool isDynamic, float mass, const btTransform& startTransform, btCollisionShape* shape) = 0; - virtual void SetGravity(const btVector3& gravity) = 0; + virtual void setGravity(const btVector3& gravity) = 0; - virtual void SetCameraInfo(const btVector3& up, int forwardAxis) = 0; + virtual void setCameraInfo(const btVector3& up, int forwardAxis) = 0; }; diff --git a/Demos/ColladaDemo/ColladaDemo.cpp b/Demos/ColladaDemo/ColladaDemo.cpp index 8984bf47f..350c2afdd 100644 --- a/Demos/ColladaDemo/ColladaDemo.cpp +++ b/Demos/ColladaDemo/ColladaDemo.cpp @@ -58,7 +58,7 @@ class MyColladaConverter : public ColladaConverter const btVector3& angularMaxLimits ) { - return m_demoApp->GetPhysicsEnvironment()->createUniversalD6Constraint( + return m_demoApp->getPhysicsEnvironment()->createUniversalD6Constraint( ctrlRef,ctrlOther, localAttachmentFrameRef, localAttachmentOther, @@ -69,21 +69,21 @@ class MyColladaConverter : public ColladaConverter ); } - virtual CcdPhysicsController* CreatePhysicsObject(bool isDynamic, + virtual CcdPhysicsController* createPhysicsObject(bool isDynamic, float mass, const btTransform& startTransform, btCollisionShape* shape) { - CcdPhysicsController* ctrl = m_demoApp->LocalCreatePhysicsObject(isDynamic, mass, startTransform,shape); + CcdPhysicsController* ctrl = m_demoApp->localCreatePhysicsObject(isDynamic, mass, startTransform,shape); return ctrl; } - virtual void SetGravity(const btVector3& grav) + virtual void setGravity(const btVector3& grav) { - m_demoApp->GetPhysicsEnvironment()->setGravity(grav.getX(),grav.getY(),grav.getZ()); + m_demoApp->getPhysicsEnvironment()->setGravity(grav.getX(),grav.getY(),grav.getZ()); } - virtual void SetCameraInfo(const btVector3& camUp,int forwardAxis) + virtual void setCameraInfo(const btVector3& camUp,int forwardAxis) { m_demoApp->setCameraUp(camUp); m_demoApp->setCameraForwardAxis(forwardAxis); diff --git a/Demos/CollisionDemo/CollisionDemo.cpp b/Demos/CollisionDemo/CollisionDemo.cpp index 49b9d90a4..51473a81c 100644 --- a/Demos/CollisionDemo/CollisionDemo.cpp +++ b/Demos/CollisionDemo/CollisionDemo.cpp @@ -122,7 +122,7 @@ void CollisionDemo::displayCallback(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glDisable(GL_LIGHTING); - //GL_ShapeDrawer::DrawCoordSystem(); + //GL_ShapeDrawer::drawCoordSystem(); float m[16]; int i; @@ -130,14 +130,14 @@ void CollisionDemo::displayCallback(void) { btGjkPairDetector convexConvex(shapePtr[0],shapePtr[1],&sGjkSimplexSolver,0); btVector3 seperatingAxis(0.00000000f,0.059727669f,0.29259586f); - convexConvex.SetCachedSeperatingAxis(seperatingAxis); + convexConvex.setCachedSeperatingAxis(seperatingAxis); btPointCollector gjkOutput; btGjkPairDetector::ClosestPointInput input; input.m_transformA = tr[0]; input.m_transformB = tr[1]; - convexConvex.GetClosestPoints(input ,gjkOutput,0); + convexConvex.getClosestPoints(input ,gjkOutput,0); if (gjkOutput.m_hasResult) { @@ -159,23 +159,23 @@ void CollisionDemo::displayCallback(void) { tr[i].getOpenGLMatrix( m ); - GL_ShapeDrawer::DrawOpenGL(m,shapePtr[i],btVector3(1,1,1),getDebugMode()); + GL_ShapeDrawer::drawOpenGL(m,shapePtr[i],btVector3(1,1,1),getDebugMode()); } - simplex.SetSimplexSolver(&sGjkSimplexSolver); + simplex.setSimplexSolver(&sGjkSimplexSolver); btPoint3 ybuf[4],pbuf[4],qbuf[4]; int numpoints = sGjkSimplexSolver.getSimplex(pbuf,qbuf,ybuf); - simplex.Reset(); + simplex.reset(); for (i=0;iAddCollisionObject(&objects[0]); - collisionWorld->AddCollisionObject(&objects[1]); + collisionWorld->addCollisionObject(&objects[0]); + collisionWorld->addCollisionObject(&objects[1]); } @@ -118,30 +118,30 @@ void CollisionInterfaceDemo::displayCallback(void) { glDisable(GL_LIGHTING); if (collisionWorld) - collisionWorld->PerformDiscreteCollisionDetection(); + collisionWorld->performDiscreteCollisionDetection(); int i; ///one way to draw all the contact points is iterating over contact manifolds / points: - int numManifolds = collisionWorld->GetDispatcher()->GetNumManifolds(); + int numManifolds = collisionWorld->getDispatcher()->getNumManifolds(); for (i=0;iGetDispatcher()->GetManifoldByIndexInternal(i); - btCollisionObject* obA = static_cast(contactManifold->GetBody0()); - btCollisionObject* obB = static_cast(contactManifold->GetBody1()); - contactManifold->RefreshContactPoints(obA->m_worldTransform,obB->m_worldTransform); + btPersistentManifold* contactManifold = collisionWorld->getDispatcher()->getManifoldByIndexInternal(i); + btCollisionObject* obA = static_cast(contactManifold->getBody0()); + btCollisionObject* obB = static_cast(contactManifold->getBody1()); + contactManifold->refreshContactPoints(obA->m_worldTransform,obB->m_worldTransform); - int numContacts = contactManifold->GetNumContacts(); + int numContacts = contactManifold->getNumContacts(); for (int j=0;jGetContactPoint(j); + btManifoldPoint& pt = contactManifold->getContactPoint(j); glBegin(GL_LINES); glColor3f(1, 0, 1); - btVector3 ptA = pt.GetPositionWorldOnA(); - btVector3 ptB = pt.GetPositionWorldOnB(); + btVector3 ptA = pt.getPositionWorldOnA(); + btVector3 ptB = pt.getPositionWorldOnB(); glVertex3d(ptA.x(),ptA.y(),ptA.z()); glVertex3d(ptB.x(),ptB.y(),ptB.z()); @@ -149,10 +149,10 @@ void CollisionInterfaceDemo::displayCallback(void) { } //you can un-comment out this line, and then all points are removed - //contactManifold->ClearManifold(); + //contactManifold->clearManifold(); } - //GL_ShapeDrawer::DrawCoordSystem(); + //GL_ShapeDrawer::drawCoordSystem(); float m[16]; @@ -162,7 +162,7 @@ void CollisionInterfaceDemo::displayCallback(void) { { objects[i].m_worldTransform.getOpenGLMatrix( m ); - GL_ShapeDrawer::DrawOpenGL(m,objects[i].m_collisionShape,btVector3(1,1,1),getDebugMode()); + GL_ShapeDrawer::drawOpenGL(m,objects[i].m_collisionShape,btVector3(1,1,1),getDebugMode()); } diff --git a/Demos/ConcaveDemo/ConcavePhysicsDemo.cpp b/Demos/ConcaveDemo/ConcavePhysicsDemo.cpp index d6891f256..be64728f3 100644 --- a/Demos/ConcaveDemo/ConcavePhysicsDemo.cpp +++ b/Demos/ConcaveDemo/ConcavePhysicsDemo.cpp @@ -168,16 +168,16 @@ void ConcaveDemo::initPhysics() startTransform.setIdentity(); startTransform.setOrigin(btVector3(0,-2,0)); - CcdPhysicsController* staticTrimesh = LocalCreatePhysicsObject(isDynamic, mass, startTransform,trimeshShape); + CcdPhysicsController* staticTrimesh = localCreatePhysicsObject(isDynamic, mass, startTransform,trimeshShape); //enable custom material callback - staticTrimesh->GetRigidBody()->m_collisionFlags |= btCollisionObject::customMaterialCallback; + staticTrimesh->getRigidBody()->m_collisionFlags |= btCollisionObject::customMaterialCallback; { for (int i=0;i<10;i++) { btCollisionShape* boxShape = new btBoxShape(btVector3(1,1,1)); startTransform.setOrigin(btVector3(2*i,1,1)); - LocalCreatePhysicsObject(true, 1, startTransform,boxShape); + localCreatePhysicsObject(true, 1, startTransform,boxShape); } } m_physicsEnvironmentPtr->setGravity(-1,-10,1); diff --git a/Demos/ConstraintDemo/ConstraintDemo.cpp b/Demos/ConstraintDemo/ConstraintDemo.cpp index c605dbb7c..0d065d27d 100644 --- a/Demos/ConstraintDemo/ConstraintDemo.cpp +++ b/Demos/ConstraintDemo/ConstraintDemo.cpp @@ -74,10 +74,10 @@ void ConstraintDemo::initPhysics() bool isDynamic = false; float mass = 1.f; - CcdPhysicsController* ctrl0 = LocalCreatePhysicsObject( isDynamic,mass,trans,shape); + CcdPhysicsController* ctrl0 = localCreatePhysicsObject( isDynamic,mass,trans,shape); trans.setOrigin(btVector3(2*CUBE_HALF_EXTENTS,20,0)); isDynamic = true; - CcdPhysicsController* ctrl1 = LocalCreatePhysicsObject( isDynamic,mass,trans,shape); + CcdPhysicsController* ctrl1 = localCreatePhysicsObject( isDynamic,mass,trans,shape); clientResetScene(); diff --git a/Demos/ContinuousConvexCollision/ContinuousConvexCollisionDemo.cpp b/Demos/ContinuousConvexCollision/ContinuousConvexCollisionDemo.cpp index b412e0df3..441ab491c 100644 --- a/Demos/ContinuousConvexCollision/ContinuousConvexCollisionDemo.cpp +++ b/Demos/ContinuousConvexCollision/ContinuousConvexCollisionDemo.cpp @@ -110,12 +110,12 @@ void btContinuousConvexCollisionDemo::initPhysics() shapePtr[0] = boxA; shapePtr[1] = boxB; - shapePtr[0]->SetMargin(0.01f); - shapePtr[1]->SetMargin(0.01f); + shapePtr[0]->setMargin(0.01f); + shapePtr[1]->setMargin(0.01f); for (int i=0;im_fraction,hitTrans); + btTransformUtil::integrateTransform(fromTrans[0],linVels[0],angVels[0],rayResultPtr->m_fraction,hitTrans); hitTrans.getOpenGLMatrix(m); - GL_ShapeDrawer::DrawOpenGL(m,shapePtr[0],btVector3(0,1,0),getDebugMode()); + GL_ShapeDrawer::drawOpenGL(m,shapePtr[0],btVector3(0,1,0),getDebugMode()); - btTransformUtil::IntegrateTransform(fromTrans[i],linVels[i],angVels[i],rayResultPtr->m_fraction,hitTrans); + btTransformUtil::integrateTransform(fromTrans[i],linVels[i],angVels[i],rayResultPtr->m_fraction,hitTrans); hitTrans.getOpenGLMatrix(m); - GL_ShapeDrawer::DrawOpenGL(m,shapePtr[i],btVector3(0,1,1),getDebugMode()); + GL_ShapeDrawer::drawOpenGL(m,shapePtr[i],btVector3(0,1,1),getDebugMode()); } diff --git a/Demos/ConvexDecompositionDemo/ConvexDecompositionDemo.cpp b/Demos/ConvexDecompositionDemo/ConvexDecompositionDemo.cpp index f888be7e4..f9adcae6e 100644 --- a/Demos/ConvexDecompositionDemo/ConvexDecompositionDemo.cpp +++ b/Demos/ConvexDecompositionDemo/ConvexDecompositionDemo.cpp @@ -99,7 +99,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename) startTransform.setIdentity(); startTransform.setOrigin(btVector3(0,-4,0)); - LocalCreatePhysicsObject(false,0,startTransform,new btBoxShape(btVector3(30,2,30))); + localCreatePhysicsObject(false,0,startTransform,new btBoxShape(btVector3(30,2,30))); class MyConvexDecomposition : public ConvexDecomposition::ConvexDecompInterface { @@ -184,7 +184,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename) vertex1 -= centroid; vertex2 -= centroid; - trimesh->AddTriangle(vertex0,vertex1,vertex2); + trimesh->addTriangle(vertex0,vertex1,vertex2); index0+=mBaseCount; index1+=mBaseCount; @@ -200,7 +200,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename) btTransform trans; trans.setIdentity(); trans.setOrigin(centroid); - m_convexDemo->LocalCreatePhysicsObject(isDynamic, mass, trans,convexShape); + m_convexDemo->localCreatePhysicsObject(isDynamic, mass, trans,convexShape); mBaseCount+=result.mHullVcount; // advance the 'base index' counter. @@ -234,7 +234,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename) vertex1 *= localScaling; vertex2 *= localScaling; - trimesh->AddTriangle(vertex0,vertex1,vertex2); + trimesh->addTriangle(vertex0,vertex1,vertex2); } btCollisionShape* convexShape = new btConvexTriangleMeshShape(trimesh); @@ -245,7 +245,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename) startTransform.setIdentity(); startTransform.setOrigin(btVector3(20,2,0)); - LocalCreatePhysicsObject(isDynamic, mass, startTransform,convexShape); + localCreatePhysicsObject(isDynamic, mass, startTransform,convexShape); } diff --git a/Demos/ConvexHullDistance/ConvexHullDistanceDemo.cpp b/Demos/ConvexHullDistance/ConvexHullDistanceDemo.cpp index 394cb6d0f..cc5ff807d 100644 --- a/Demos/ConvexHullDistance/ConvexHullDistanceDemo.cpp +++ b/Demos/ConvexHullDistance/ConvexHullDistanceDemo.cpp @@ -107,7 +107,7 @@ void clientDisplay(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glDisable(GL_LIGHTING); - //GL_ShapeDrawer::DrawCoordSystem(); + //GL_ShapeDrawer::drawCoordSystem(); float m[16]; int i; @@ -115,14 +115,14 @@ void clientDisplay(void) { btGjkPairDetector convexConvex(shapePtr[0],shapePtr[1],&sGjkSimplexSolver,0); btVector3 seperatingAxis(0.00000000f,0.059727669f,0.29259586f); - convexConvex.SetCachedSeperatingAxis(seperatingAxis); + convexConvex.setCachedSeperatingAxis(seperatingAxis); btPointCollector gjkOutput; btGjkPairDetector::ClosestPointInput input; input.m_transformA = tr[0]; input.m_transformB = tr[1]; - convexConvex.GetClosestPoints(input ,gjkOutput,0); + convexConvex.getClosestPoints(input ,gjkOutput,0); if (gjkOutput.m_hasResult) { @@ -142,23 +142,23 @@ void clientDisplay(void) { tr[i].getOpenGLMatrix( m ); - GL_ShapeDrawer::DrawOpenGL(m,shapePtr[i],btVector3(1,1,1),getDebugMode()); + GL_ShapeDrawer::drawOpenGL(m,shapePtr[i],btVector3(1,1,1),getDebugMode()); } - simplex.SetSimplexSolver(&sGjkSimplexSolver); + simplex.setSimplexSolver(&sGjkSimplexSolver); btPoint3 ybuf[4],pbuf[4],qbuf[4]; int numpoints = sGjkSimplexSolver.getSimplex(pbuf,qbuf,ybuf); - simplex.Reset(); + simplex.reset(); for (i=0;iSetMargin( 0.05 ); + // g_pConvexShapes[ shapeIndex ]->setMargin( 0.05 ); // g_convexShapesTransform[ shapeIndex ].setIdentity(); @@ -123,7 +123,7 @@ bool createBoxShape( int shapeIndex ) //{ // g_pConvexShapes[ shapeIndex ] = new btBoxShape( btVector3( 25, 10, 25 ) ); - // g_pConvexShapes[ shapeIndex ]->SetMargin( 0.05 ); + // g_pConvexShapes[ shapeIndex ]->setMargin( 0.05 ); // //btMatrix3x3 basis( 0.658257, 0.675022, -0.333709, // // -0.333120, 0.658556, 0.675023, @@ -138,7 +138,7 @@ bool createBoxShape( int shapeIndex ) g_pConvexShapes[ shapeIndex ] = new btBoxShape( btVector3( 1, 1, 1 ) ); - g_pConvexShapes[ shapeIndex ]->SetMargin( 1e-1 ); + g_pConvexShapes[ shapeIndex ]->setMargin( 1e-1 ); g_convexShapesTransform[ shapeIndex ].setIdentity(); @@ -151,7 +151,7 @@ bool createSphereShape( int shapeIndex ) { g_pConvexShapes[ shapeIndex ] = new btSphereShape( g_sphereRadius ); - g_pConvexShapes[ shapeIndex ]->SetMargin( 1e-1 ); + g_pConvexShapes[ shapeIndex ]->setMargin( 1e-1 ); g_convexShapesTransform[ shapeIndex ].setIdentity(); g_convexShapesTransform[ shapeIndex ].setOrigin( randomPosition( g_sceneVolumeMin, g_sceneVolumeMax ) ); @@ -196,7 +196,7 @@ bool calcPenDepth() btScalar squaredDistance = SIMD_INFINITY; btScalar delta = 0.f; - const btScalar margin = g_pConvexShapes[ 0 ]->GetMargin() + g_pConvexShapes[ 1 ]->GetMargin(); + const btScalar margin = g_pConvexShapes[ 0 ]->getMargin() + g_pConvexShapes[ 1 ]->getMargin(); const btScalar marginSqrd = margin * margin; btScalar maxRelErrorSqrd = 1e-3 * 1e-3; @@ -210,8 +210,8 @@ bool calcPenDepth() btVector3 seperatingAxisInA = -v * g_convexShapesTransform[ 0 ].getBasis(); btVector3 seperatingAxisInB = v * g_convexShapesTransform[ 1 ].getBasis(); - btVector3 pInA = g_pConvexShapes[ 0 ]->LocalGetSupportingVertexWithoutMargin( seperatingAxisInA ); - btVector3 qInB = g_pConvexShapes[ 1 ]->LocalGetSupportingVertexWithoutMargin( seperatingAxisInB ); + btVector3 pInA = g_pConvexShapes[ 0 ]->localGetSupportingVertexWithoutMargin( seperatingAxisInA ); + btVector3 qInB = g_pConvexShapes[ 1 ]->localGetSupportingVertexWithoutMargin( seperatingAxisInB ); btPoint3 pWorld = g_convexShapesTransform[ 0 ]( pInA ); btPoint3 qWorld = g_convexShapesTransform[ 1 ]( qInB ); @@ -234,8 +234,8 @@ bool calcPenDepth() assert( ( squaredDistance > 0 ) && "squaredDistance is zero!" ); btScalar vLength = sqrt( squaredDistance ); - g_wWitnesses[ 0 ] -= v * ( g_pConvexShapes[ 0 ]->GetMargin() / vLength ); - g_wWitnesses[ 1 ] += v * ( g_pConvexShapes[ 1 ]->GetMargin() / vLength ); + g_wWitnesses[ 0 ] -= v * ( g_pConvexShapes[ 0 ]->getMargin() / vLength ); + g_wWitnesses[ 1 ] += v * ( g_pConvexShapes[ 1 ]->getMargin() / vLength ); return true; } @@ -251,8 +251,8 @@ bool calcPenDepth() assert( ( squaredDistance > 0 ) && "squaredDistance is zero!" ); btScalar vLength = sqrt( squaredDistance ); - g_wWitnesses[ 0 ] -= v * ( g_pConvexShapes[ 0 ]->GetMargin() / vLength ); - g_wWitnesses[ 1 ] += v * ( g_pConvexShapes[ 1 ]->GetMargin() / vLength ); + g_wWitnesses[ 0 ] -= v * ( g_pConvexShapes[ 0 ]->getMargin() / vLength ); + g_wWitnesses[ 1 ] += v * ( g_pConvexShapes[ 1 ]->getMargin() / vLength ); return true; } @@ -271,8 +271,8 @@ bool calcPenDepth() assert( ( squaredDistance > 0 ) && "squaredDistance is zero!" ); btScalar vLength = sqrt( squaredDistance ); - g_wWitnesses[ 0 ] -= v * ( g_pConvexShapes[ 0 ]->GetMargin() / vLength ); - g_wWitnesses[ 1 ] += v * ( g_pConvexShapes[ 1 ]->GetMargin() / vLength ); + g_wWitnesses[ 0 ] -= v * ( g_pConvexShapes[ 0 ]->getMargin() / vLength ); + g_wWitnesses[ 1 ] += v * ( g_pConvexShapes[ 1 ]->getMargin() / vLength ); return true; } @@ -284,7 +284,7 @@ bool calcPenDepth() } } - return epaPenDepthSolver.CalcPenDepth( simplexSolver, g_pConvexShapes[ 0 ], g_pConvexShapes[ 1 ], + return epaPenDepthSolver.calcPenDepth( simplexSolver, g_pConvexShapes[ 0 ], g_pConvexShapes[ 1 ], g_convexShapesTransform[ 0 ], g_convexShapesTransform[ 1 ], v, g_wWitnesses[ 0 ], g_wWitnesses[ 1 ], 0 ); } @@ -311,11 +311,11 @@ void drawShape( int shapeIndex ) glMultMatrixf( m ); - if ( g_pConvexShapes[ shapeIndex ]->GetShapeType() == BOX_SHAPE_PROXYTYPE ) + if ( g_pConvexShapes[ shapeIndex ]->getShapeType() == BOX_SHAPE_PROXYTYPE ) { - glutWireCube( ( ( btBoxShape* ) g_pConvexShapes[ shapeIndex ] )->GetHalfExtents().x() * 2 ); + glutWireCube( ( ( btBoxShape* ) g_pConvexShapes[ shapeIndex ] )->getHalfExtents().x() * 2 ); } - else if ( g_pConvexShapes[ shapeIndex ]->GetShapeType() == SPHERE_SHAPE_PROXYTYPE ) + else if ( g_pConvexShapes[ shapeIndex ]->getShapeType() == SPHERE_SHAPE_PROXYTYPE ) { glutWireSphere( 1, 16, 16 ); } @@ -370,7 +370,7 @@ void clientDisplay(void) { glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glDisable( GL_LIGHTING ); - GL_ShapeDrawer::DrawCoordSystem(); + GL_ShapeDrawer::drawCoordSystem(); glMatrixMode( GL_MODELVIEW ); diff --git a/Demos/ForkLiftDemo/ForkLiftDemo.cpp b/Demos/ForkLiftDemo/ForkLiftDemo.cpp index 7061dcad7..2094e3ac8 100644 --- a/Demos/ForkLiftDemo/ForkLiftDemo.cpp +++ b/Demos/ForkLiftDemo/ForkLiftDemo.cpp @@ -185,12 +185,12 @@ const float TRIANGLE_SIZE=20.f; tr.setOrigin(btVector3(0,-20.f,0)); //create ground object - LocalCreatePhysicsObject(false,0,tr,groundShape); + localCreatePhysicsObject(false,0,tr,groundShape); btCollisionShape* chassisShape = new btBoxShape(btVector3(1.f,0.5f,2.f)); tr.setOrigin(btVector3(0,0.f,0)); - m_carChassis = LocalCreatePhysicsObject(true,800,tr,chassisShape); + m_carChassis = localCreatePhysicsObject(true,800,tr,chassisShape); clientResetScene(); @@ -207,7 +207,7 @@ const float TRIANGLE_SIZE=20.f; 0,0,0); ///never deactivate the vehicle - m_carChassis->GetRigidBody()->SetActivationState(DISABLE_DEACTIVATION); + m_carChassis->getRigidBody()->SetActivationState(DISABLE_DEACTIVATION); gVehicleConstraint = m_physicsEnvironmentPtr->getVehicleConstraint(constraintId); @@ -218,25 +218,25 @@ const float TRIANGLE_SIZE=20.f; int upIndex = 1; int forwardIndex = 2; - gVehicleConstraint->SetCoordinateSystem(rightIndex,upIndex,forwardIndex); + gVehicleConstraint->setCoordinateSystem(rightIndex,upIndex,forwardIndex); - gVehicleConstraint->AddWheel(&wheelMotionState[0], + gVehicleConstraint->addWheel(&wheelMotionState[0], (PHY__Vector3&)connectionPointCS0, (PHY__Vector3&)wheelDirectionCS0,(PHY__Vector3&)wheelAxleCS,suspensionRestLength,wheelRadius,isFrontWheel); connectionPointCS0 = btVector3(-CUBE_HALF_EXTENTS+(0.3*wheelWidth),0,2*CUBE_HALF_EXTENTS-wheelRadius); - gVehicleConstraint->AddWheel(&wheelMotionState[1], + gVehicleConstraint->addWheel(&wheelMotionState[1], (PHY__Vector3&)connectionPointCS0, (PHY__Vector3&)wheelDirectionCS0,(PHY__Vector3&)wheelAxleCS,suspensionRestLength,wheelRadius,isFrontWheel); connectionPointCS0 = btVector3(-CUBE_HALF_EXTENTS+(0.3*wheelWidth),0,-2*CUBE_HALF_EXTENTS+wheelRadius); isFrontWheel = false; - gVehicleConstraint->AddWheel(&wheelMotionState[2], + gVehicleConstraint->addWheel(&wheelMotionState[2], (PHY__Vector3&)connectionPointCS0, (PHY__Vector3&)wheelDirectionCS0,(PHY__Vector3&)wheelAxleCS,suspensionRestLength,wheelRadius,isFrontWheel); connectionPointCS0 = btVector3(CUBE_HALF_EXTENTS-(0.3*wheelWidth),0,-2*CUBE_HALF_EXTENTS+wheelRadius); - gVehicleConstraint->AddWheel(&wheelMotionState[3], + gVehicleConstraint->addWheel(&wheelMotionState[3], (PHY__Vector3&)connectionPointCS0, (PHY__Vector3&)wheelDirectionCS0,(PHY__Vector3&)wheelAxleCS,suspensionRestLength,wheelRadius,isFrontWheel); @@ -276,7 +276,7 @@ void ForkLiftDemo::renderme() { updateCamera(); - debugDrawer.SetDebugMode(getDebugMode()); + debugDrawer.setDebugMode(getDebugMode()); float m[16]; int i; @@ -287,7 +287,7 @@ void ForkLiftDemo::renderme() { //draw wheels (cylinders) wheelMotionState[i].m_worldTransform.getOpenGLMatrix(m); - GL_ShapeDrawer::DrawOpenGL(m,&wheelShape,wheelColor,getDebugMode()); + GL_ShapeDrawer::drawOpenGL(m,&wheelShape,wheelColor,getDebugMode()); } DemoApplication::renderme(); @@ -301,14 +301,14 @@ void ForkLiftDemo::clientMoveAndDisplay() { int steerWheelIndex = 2; - gVehicleConstraint->ApplyEngineForce(gEngineForce,steerWheelIndex); + gVehicleConstraint->applyEngineForce(gEngineForce,steerWheelIndex); steerWheelIndex = 3; - gVehicleConstraint->ApplyEngineForce(gEngineForce,steerWheelIndex); + gVehicleConstraint->applyEngineForce(gEngineForce,steerWheelIndex); steerWheelIndex = 0; - gVehicleConstraint->SetSteeringValue(gVehicleSteering,steerWheelIndex); + gVehicleConstraint->setSteeringValue(gVehicleSteering,steerWheelIndex); steerWheelIndex = 1; - gVehicleConstraint->SetSteeringValue(gVehicleSteering,steerWheelIndex); + gVehicleConstraint->setSteeringValue(gVehicleSteering,steerWheelIndex); } @@ -414,7 +414,7 @@ void ForkLiftDemo::updateCamera() glLoadIdentity(); //look at the vehicle - m_cameraTargetPosition = m_carChassis->GetRigidBody()->m_worldTransform.getOrigin(); + m_cameraTargetPosition = m_carChassis->getRigidBody()->m_worldTransform.getOrigin(); //interpolate the camera height m_cameraPosition[1] = (15.0*m_cameraPosition[1] + m_cameraTargetPosition[1] + m_cameraHeight)/16.0; diff --git a/Demos/GjkConvexCastDemo/LinearConvexCastDemo.cpp b/Demos/GjkConvexCastDemo/LinearConvexCastDemo.cpp index 67b9e41cc..6c77391b3 100644 --- a/Demos/GjkConvexCastDemo/LinearConvexCastDemo.cpp +++ b/Demos/GjkConvexCastDemo/LinearConvexCastDemo.cpp @@ -96,18 +96,18 @@ void LinearConvexCastDemo::initPhysics() btBoxShape* boxA = new btBoxShape(boxHalfExtentsA); /* btBU_Simplex1to4 boxB; - boxB.AddVertex(btPoint3(-5,0,-5)); - boxB.AddVertex(btPoint3(5,0,-5)); - boxB.AddVertex(btPoint3(0,0,5)); - boxB.AddVertex(btPoint3(0,5,0)); + boxB.addVertex(btPoint3(-5,0,-5)); + boxB.addVertex(btPoint3(5,0,-5)); + boxB.addVertex(btPoint3(0,0,5)); + boxB.addVertex(btPoint3(0,5,0)); */ btBoxShape* boxB = new btBoxShape(boxHalfExtentsB); shapePtr[0] = boxA; shapePtr[1] = boxB; - shapePtr[0]->SetMargin(0.01f); - shapePtr[1]->SetMargin(0.01f); + shapePtr[0]->setMargin(0.01f); + shapePtr[1]->setMargin(0.01f); btTransform tr; tr.setIdentity(); @@ -137,7 +137,7 @@ void LinearConvexCastDemo::displayCallback(void) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glDisable(GL_LIGHTING); - //GL_ShapeDrawer::DrawCoordSystem(); + //GL_ShapeDrawer::drawCoordSystem(); float m[16]; int i; @@ -145,7 +145,7 @@ void LinearConvexCastDemo::displayCallback(void) for (i=0;iDrawString(str); + ((BMF_BitmapFont*)font)->drawString(str); return 1; } @@ -141,22 +141,22 @@ int BMF_GetCharacterWidth(BMF_Font* font, char c) int BMF_GetStringWidth(BMF_Font* font, char* str) { if (!font) return 0; - return ((BMF_BitmapFont*)font)->GetStringWidth(str); + return ((BMF_BitmapFont*)font)->getStringWidth(str); } void BMF_GetBoundingBox(BMF_Font* font, int *xmin_r, int *ymin_r, int *xmax_r, int *ymax_r) { if (!font) return; - ((BMF_BitmapFont*)font)->GetBoundingBox(*xmin_r, *ymin_r, *xmax_r, *ymax_r); + ((BMF_BitmapFont*)font)->getBoundingBox(*xmin_r, *ymin_r, *xmax_r, *ymax_r); } int BMF_GetFontTexture(BMF_Font* font) { if (!font) return -1; - return ((BMF_BitmapFont*)font)->GetTexture(); + return ((BMF_BitmapFont*)font)->getTexture(); } void BMF_DrawStringTexture(BMF_Font* font, char *string, float x, float y, float z) { if (!font) return; - ((BMF_BitmapFont*)font)->DrawStringTexture(string, x, y, z); + ((BMF_BitmapFont*)font)->drawStringTexture(string, x, y, z); } diff --git a/Demos/OpenGL/BMF_Api.h b/Demos/OpenGL/BMF_Api.h index 0df762999..2bb3a7abf 100644 --- a/Demos/OpenGL/BMF_Api.h +++ b/Demos/OpenGL/BMF_Api.h @@ -98,7 +98,7 @@ void BMF_GetBoundingBox(BMF_Font* font, int *xmin_r, int *ymin_r, int *xmax_r, i /** * Convert the given @a font to a texture, and return the GL texture * ID of the texture. If the texture ID is bound, text can - * be drawn using the texture by calling DrawStringTexture. + * be drawn using the texture by calling drawStringTexture. * * @param font The font to create the texture from. * @return The GL texture ID of the new texture, or -1 if unable @@ -109,7 +109,7 @@ int BMF_GetFontTexture(BMF_Font* font); /** * Draw the given @a str at the point @a x, @a y, @a z, using * texture coordinates. This assumes that an appropriate texture - * has been bound, see BMF_BitmapFont::GetTexture(). The string + * has been bound, see BMF_BitmapFont::getTexture(). The string * is drawn along the positive X axis. * * @param font The font to draw with. diff --git a/Demos/OpenGL/BMF_BitmapFont.cpp b/Demos/OpenGL/BMF_BitmapFont.cpp index f50d1894b..4098b214c 100644 --- a/Demos/OpenGL/BMF_BitmapFont.cpp +++ b/Demos/OpenGL/BMF_BitmapFont.cpp @@ -64,7 +64,7 @@ BMF_BitmapFont::~BMF_BitmapFont(void) } -void BMF_BitmapFont::DrawString(const char* str) +void BMF_BitmapFont::drawString(const char* str) { if (!str) return; @@ -93,7 +93,7 @@ void BMF_BitmapFont::DrawString(const char* str) } -int BMF_BitmapFont::GetStringWidth(char* str) +int BMF_BitmapFont::getStringWidth(char* str) { unsigned char c; int length = 0; @@ -105,7 +105,7 @@ int BMF_BitmapFont::GetStringWidth(char* str) return length; } -void BMF_BitmapFont::GetBoundingBox(int & xMin, int & yMin, int & xMax, int & yMax) +void BMF_BitmapFont::getBoundingBox(int & xMin, int & yMin, int & xMax, int & yMax) { xMin = m_fontData->xmin; yMin = m_fontData->ymin; @@ -113,7 +113,7 @@ void BMF_BitmapFont::GetBoundingBox(int & xMin, int & yMin, int & xMax, int & yM yMax = m_fontData->ymax; } -int BMF_BitmapFont::GetTexture() +int BMF_BitmapFont::getTexture() { int fWidth = m_fontData->xmax - m_fontData->xmin; int fHeight = m_fontData->ymax - m_fontData->ymin; @@ -174,7 +174,7 @@ int BMF_BitmapFont::GetTexture() return texId; } -void BMF_BitmapFont::DrawStringTexture(char *str, float x, float y, float z) +void BMF_BitmapFont::drawStringTexture(char *str, float x, float y, float z) { unsigned char c; float pos = 0; diff --git a/Demos/OpenGL/BMF_BitmapFont.h b/Demos/OpenGL/BMF_BitmapFont.h index 237fab40b..00354f4a3 100644 --- a/Demos/OpenGL/BMF_BitmapFont.h +++ b/Demos/OpenGL/BMF_BitmapFont.h @@ -58,9 +58,9 @@ public: * Draws a string at the current raster position. * @param str The string to draw. */ - void DrawString(const char* str); + void drawString(const char* str); - void DrawStringMemory(char* str); + void drawStringMemory(char* str); /** @@ -68,7 +68,7 @@ public: * @param str The string to draw. * @return The width of the string. */ - int GetStringWidth(char* str); + int getStringWidth(char* str); /** * Returns the bounding box of the font. The width and @@ -77,22 +77,22 @@ public: * box represent the extent of the font and its positioning * about the origin. */ - void GetBoundingBox(int & xMin, int & yMin, int & xMax, int & yMax); + void getBoundingBox(int & xMin, int & yMin, int & xMax, int & yMax); /** * Convert the font to a texture, and return the GL texture * ID of the texture. If the texture ID is bound, text can - * be drawn using the texture by calling DrawStringTexture. + * be drawn using the texture by calling drawStringTexture. * * @return The GL texture ID of the new texture, or -1 if unable * to create. */ - int GetTexture(); + int getTexture(); /** * Draw the given @a string at the point @a x, @a y, @a z, using * texture coordinates. This assumes that an appropriate texture - * has been bound, see BMF_BitmapFont::GetTexture(). The string + * has been bound, see BMF_BitmapFont::getTexture(). The string * is drawn along the positive X axis. * * @param string The c-string to draw. @@ -100,7 +100,7 @@ public: * @param y The y coordinate to start drawing at. * @param z The z coordinate to start drawing at. */ - void DrawStringTexture(char* string, float x, float y, float z); + void drawStringTexture(char* string, float x, float y, float z); protected: /** Pointer to the font data. */ diff --git a/Demos/OpenGL/DebugCastResult.h b/Demos/OpenGL/DebugCastResult.h index 53f40f176..48588b78a 100644 --- a/Demos/OpenGL/DebugCastResult.h +++ b/Demos/OpenGL/DebugCastResult.h @@ -46,7 +46,7 @@ struct btDebugCastResult : public btConvexCast::CastResult { } - virtual void DrawCoordSystem(const btTransform& tr) + virtual void drawCoordSystem(const btTransform& tr) { float m[16]; tr.getOpenGLMatrix(m); @@ -71,9 +71,9 @@ struct btDebugCastResult : public btConvexCast::CastResult float m[16]; btTransform hitTrans; - btTransformUtil::IntegrateTransform(m_fromTrans,m_linVel,m_angVel,fraction,hitTrans); + btTransformUtil::integrateTransform(m_fromTrans,m_linVel,m_angVel,fraction,hitTrans); hitTrans.getOpenGLMatrix(m); - GL_ShapeDrawer::DrawOpenGL(m,m_shape,btVector3(1,0,0),btIDebugDraw::DBG_NoDebug); + GL_ShapeDrawer::drawOpenGL(m,m_shape,btVector3(1,0,0),btIDebugDraw::DBG_NoDebug); } }; diff --git a/Demos/OpenGL/DemoApplication.cpp b/Demos/OpenGL/DemoApplication.cpp index dfb0e2a99..9f6b372ec 100644 --- a/Demos/OpenGL/DemoApplication.cpp +++ b/Demos/OpenGL/DemoApplication.cpp @@ -397,8 +397,8 @@ void DemoApplication::shootBox(const btVector3& destination) startTransform.setOrigin(camPos); btCollisionShape* boxShape = new btBoxShape(btVector3(1.f,1.f,1.f)); - btRigidBody* body = this->LocalCreateRigidBody(isDynamic, mass, startTransform,boxShape); - m_dynamicsWorld->AddCollisionObject(body); + btRigidBody* body = this->localCreateRigidBody(isDynamic, mass, startTransform,boxShape); + m_dynamicsWorld->addCollisionObject(body); btVector3 linVel(destination[0]-camPos[0],destination[1]-camPos[1],destination[2]-camPos[2]); linVel.normalize(); @@ -420,7 +420,7 @@ void DemoApplication::shootBox(const btVector3& destination) startTransform.setOrigin(camPos); btCollisionShape* boxShape = new btBoxShape(btVector3(1.f,1.f,1.f)); - CcdPhysicsController* newBox = LocalCreatePhysicsObject(isDynamic, mass, startTransform,boxShape); + CcdPhysicsController* newBox = localCreatePhysicsObject(isDynamic, mass, startTransform,boxShape); btVector3 linVel(destination[0]-camPos[0],destination[1]-camPos[1],destination[2]-camPos[2]); linVel.normalize(); @@ -440,7 +440,7 @@ float gOldPickingDist = 0.f; btRigidBody* pickedBody = 0;//for deactivation state -btVector3 DemoApplication::GetRayTo(int x,int y) +btVector3 DemoApplication::getRayTo(int x,int y) { float top = 1.f; @@ -482,7 +482,7 @@ void DemoApplication::mouseFunc(int button, int state, int x, int y) //printf("button %i, state %i, x=%i,y=%i\n",button,state,x,y); //button 0, state 0 means left mouse down - btVector3 rayTo = GetRayTo(x,y); + btVector3 rayTo = getRayTo(x,y); switch (button) { @@ -508,7 +508,7 @@ void DemoApplication::mouseFunc(int button, int state, int x, int y) float normal[3]; btCollisionWorld::ClosestRayResultCallback rayCallback(m_cameraPosition,rayTo); - m_dynamicsWorld->RayTest(m_cameraPosition,rayTo,rayCallback); + m_dynamicsWorld->rayTest(m_cameraPosition,rayTo,rayCallback); if (rayCallback.HasHit()) { @@ -539,7 +539,7 @@ void DemoApplication::mouseFunc(int button, int state, int x, int y) if (hitObj) { CcdPhysicsController* physCtrl = static_cast(hitObj); - btRigidBody* body = physCtrl->GetRigidBody(); + btRigidBody* body = physCtrl->getRigidBody(); if (body) { body->SetActivationState(ACTIVE_TAG); @@ -576,7 +576,7 @@ void DemoApplication::mouseFunc(int button, int state, int x, int y) float hit[3]; float normal[3]; btCollisionWorld::ClosestRayResultCallback rayCallback(m_cameraPosition,rayTo); - m_dynamicsWorld->RayTest(m_cameraPosition,rayTo,rayCallback); + m_dynamicsWorld->rayTest(m_cameraPosition,rayTo,rayCallback); if (rayCallback.HasHit()) { @@ -621,7 +621,7 @@ void DemoApplication::mouseFunc(int button, int state, int x, int y) { CcdPhysicsController* physCtrl = static_cast(hitObj); - btRigidBody* body = physCtrl->GetRigidBody(); + btRigidBody* body = physCtrl->getRigidBody(); if (body && !body->IsStatic()) { @@ -704,14 +704,14 @@ void DemoApplication::mouseMotionFunc(int x,int y) { //keep it at the same picking distance - btVector3 newRayTo = GetRayTo(x,y); + btVector3 newRayTo = getRayTo(x,y); btVector3 eyePos(m_cameraPosition[0],m_cameraPosition[1],m_cameraPosition[2]); btVector3 dir = newRayTo-eyePos; dir.normalize(); dir *= gOldPickingDist; btVector3 newPos = eyePos + dir; - p2p->SetPivotB(newPos); + p2p->setPivotB(newPos); } } @@ -726,14 +726,14 @@ void DemoApplication::mouseMotionFunc(int x,int y) { //keep it at the same picking distance - btVector3 newRayTo = GetRayTo(x,y); + btVector3 newRayTo = getRayTo(x,y); btVector3 eyePos(m_cameraPosition[0],m_cameraPosition[1],m_cameraPosition[2]); btVector3 dir = newRayTo-eyePos; dir.normalize(); dir *= gOldPickingDist; btVector3 newPos = eyePos + dir; - p2p->SetPivotB(newPos); + p2p->setPivotB(newPos); } } @@ -741,11 +741,11 @@ void DemoApplication::mouseMotionFunc(int x,int y) -btRigidBody* DemoApplication::LocalCreateRigidBody(bool isDynamic, float mass, const btTransform& startTransform,btCollisionShape* shape) +btRigidBody* DemoApplication::localCreateRigidBody(bool isDynamic, float mass, const btTransform& startTransform,btCollisionShape* shape) { btVector3 localInertia(0,0,0); if (isDynamic) - shape->CalculateLocalInertia(mass,localInertia); + shape->calculateLocalInertia(mass,localInertia); btMassProps massProps(0.f,localInertia); @@ -765,7 +765,7 @@ btRigidBody* DemoApplication::LocalCreateRigidBody(bool isDynamic, float mass, c ///Very basic import -CcdPhysicsController* DemoApplication::LocalCreatePhysicsObject(bool isDynamic, float mass, const btTransform& startTransform,btCollisionShape* shape) +CcdPhysicsController* DemoApplication::localCreatePhysicsObject(bool isDynamic, float mass, const btTransform& startTransform,btCollisionShape* shape) { startTransforms[numObjects] = startTransform; @@ -779,7 +779,7 @@ CcdPhysicsController* DemoApplication::LocalCreatePhysicsObject(bool isDynamic, int i = numObjects; { gShapePtr[i] = shape; - gShapePtr[i]->SetMargin(0.05f); + gShapePtr[i]->setMargin(0.05f); btQuaternion orn = startTransform.getRotation(); @@ -806,7 +806,7 @@ CcdPhysicsController* DemoApplication::LocalCreatePhysicsObject(bool isDynamic, if (isDynamic) { - gShapePtr[i]->CalculateLocalInertia(ccdObjectCi.m_mass,localInertia); + gShapePtr[i]->calculateLocalInertia(ccdObjectCi.m_mass,localInertia); } ccdObjectCi.m_localInertiaTensor = localInertia; @@ -816,10 +816,10 @@ CcdPhysicsController* DemoApplication::LocalCreatePhysicsObject(bool isDynamic, physObjects[i]= new CcdPhysicsController( ccdObjectCi); // Only do CCD if motion in one timestep (1.f/60.f) exceeds CUBE_HALF_EXTENTS - physObjects[i]->GetRigidBody()->m_ccdSquareMotionTreshold = 0.f; + physObjects[i]->getRigidBody()->m_ccdSquareMotionTreshold = 0.f; //Experimental: better estimation of CCD Time of Impact: - //physObjects[i]->GetRigidBody()->m_ccdSweptShereRadius = 0.5*CUBE_HALF_EXTENTS; + //physObjects[i]->getRigidBody()->m_ccdSweptShereRadius = 0.5*CUBE_HALF_EXTENTS; m_physicsEnvironmentPtr->addCcdPhysicsController( physObjects[i]); @@ -837,11 +837,11 @@ void DemoApplication::renderme() if (m_dynamicsWorld) { - int numObjects = m_dynamicsWorld->GetNumCollisionObjects(); + int numObjects = m_dynamicsWorld->getNumCollisionObjects(); btVector3 wireColor(1,0,0); for (int i=0;iGetCollisionObjectArray()[i]; + btCollisionObject* colObj = m_dynamicsWorld->getCollisionObjectArray()[i]; colObj->m_worldTransform.getOpenGLMatrix(m); btVector3 wireColor(1.f,1.0f,0.5f); //wants deactivation @@ -871,7 +871,7 @@ void DemoApplication::renderme() } } - GL_ShapeDrawer::DrawOpenGL(m,colObj->m_collisionShape,wireColor,getDebugMode()); + GL_ShapeDrawer::drawOpenGL(m,colObj->m_collisionShape,wireColor,getDebugMode()); } } @@ -909,7 +909,7 @@ void DemoApplication::renderme() { CcdPhysicsController* ctrl = m_physicsEnvironmentPtr->GetPhysicsController(i); - btRigidBody* body = ctrl->GetRigidBody(); + btRigidBody* body = ctrl->getRigidBody(); body->m_worldTransform.getOpenGLMatrix( m ); @@ -919,7 +919,7 @@ void DemoApplication::renderme() wireColor = btVector3(0.f,0.0f,1.f); } ///color differently for active, sleeping, wantsdeactivation states - if (ctrl->GetRigidBody()->GetActivationState() == 1) //active + if (ctrl->getRigidBody()->GetActivationState() == 1) //active { if (i & 1) { @@ -929,7 +929,7 @@ void DemoApplication::renderme() wireColor += btVector3 (.5f,0.f,0.f); } } - if (ctrl->GetRigidBody()->GetActivationState() == 2) //ISLAND_SLEEPING + if (ctrl->getRigidBody()->GetActivationState() == 2) //ISLAND_SLEEPING { if (i & 1) { @@ -941,8 +941,8 @@ void DemoApplication::renderme() } char extraDebug[125]; - sprintf(extraDebug,"Island:%i, Body:%i",ctrl->GetRigidBody()->m_islandTag1,ctrl->GetRigidBody()->m_debugBodyId); - ctrl->GetRigidBody()->GetCollisionShape()->SetExtraDebugInfo(extraDebug); + sprintf(extraDebug,"Island:%i, Body:%i",ctrl->getRigidBody()->m_islandTag1,ctrl->getRigidBody()->m_debugBodyId); + ctrl->getRigidBody()->getCollisionShape()->setExtraDebugInfo(extraDebug); float vec[16]; btTransform ident; @@ -950,7 +950,7 @@ void DemoApplication::renderme() ident.getOpenGLMatrix(vec); - GL_ShapeDrawer::DrawOpenGL(m,ctrl->GetRigidBody()->GetCollisionShape(),wireColor,getDebugMode()); + GL_ShapeDrawer::drawOpenGL(m,ctrl->getRigidBody()->getCollisionShape(),wireColor,getDebugMode()); diff --git a/Demos/OpenGL/DemoApplication.h b/Demos/OpenGL/DemoApplication.h index 503f98884..a76767458 100644 --- a/Demos/OpenGL/DemoApplication.h +++ b/Demos/OpenGL/DemoApplication.h @@ -99,7 +99,7 @@ class DemoApplication m_debugMode = mode; } - CcdPhysicsEnvironment* GetPhysicsEnvironment() + CcdPhysicsEnvironment* getPhysicsEnvironment() { return m_physicsEnvironmentPtr; } @@ -142,11 +142,11 @@ class DemoApplication ///Demo functions void shootBox(const btVector3& destination); - btVector3 GetRayTo(int x,int y); + btVector3 getRayTo(int x,int y); - CcdPhysicsController* LocalCreatePhysicsObject(bool isDynamic, float mass, const btTransform& startTransform,btCollisionShape* shape); + CcdPhysicsController* localCreatePhysicsObject(bool isDynamic, float mass, const btTransform& startTransform,btCollisionShape* shape); - btRigidBody* LocalCreateRigidBody(bool isDynamic, float mass, const btTransform& startTransform,btCollisionShape* shape); + btRigidBody* localCreateRigidBody(bool isDynamic, float mass, const btTransform& startTransform,btCollisionShape* shape); ///callback methods by glut diff --git a/Demos/OpenGL/GLDebugDrawer.cpp b/Demos/OpenGL/GLDebugDrawer.cpp index 605b49ad5..b616198d5 100644 --- a/Demos/OpenGL/GLDebugDrawer.cpp +++ b/Demos/OpenGL/GLDebugDrawer.cpp @@ -22,7 +22,7 @@ GLDebugDrawer::GLDebugDrawer() { } -void GLDebugDrawer::DrawLine(const btVector3& from,const btVector3& to,const btVector3& color) +void GLDebugDrawer::drawLine(const btVector3& from,const btVector3& to,const btVector3& color) { if (m_debugMode > 0) { @@ -34,13 +34,13 @@ void GLDebugDrawer::DrawLine(const btVector3& from,const btVector3& to,const btV } } -void GLDebugDrawer::SetDebugMode(int debugMode) +void GLDebugDrawer::setDebugMode(int debugMode) { m_debugMode = debugMode; } -void GLDebugDrawer::DrawContactPoint(const btVector3& pointOnB,const btVector3& normalOnB,float distance,int lifeTime,const btVector3& color) +void GLDebugDrawer::drawContactPoint(const btVector3& pointOnB,const btVector3& normalOnB,float distance,int lifeTime,const btVector3& color) { if (m_debugMode & btIDebugDraw::DBG_DrawContactPoints) { diff --git a/Demos/OpenGL/GLDebugDrawer.h b/Demos/OpenGL/GLDebugDrawer.h index 7904cbdfa..1aa89a683 100644 --- a/Demos/OpenGL/GLDebugDrawer.h +++ b/Demos/OpenGL/GLDebugDrawer.h @@ -13,13 +13,13 @@ public: GLDebugDrawer(); - virtual void DrawLine(const btVector3& from,const btVector3& to,const btVector3& color); + virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& color); - virtual void DrawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,float distance,int lifeTime,const btVector3& color); + virtual void drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,float distance,int lifeTime,const btVector3& color); - virtual void SetDebugMode(int debugMode); + virtual void setDebugMode(int debugMode); - virtual int GetDebugMode() const { return m_debugMode;} + virtual int getDebugMode() const { return m_debugMode;} }; diff --git a/Demos/OpenGL/GL_ShapeDrawer.cpp b/Demos/OpenGL/GL_ShapeDrawer.cpp index 26b7f3fb2..0ea9b0d5e 100644 --- a/Demos/OpenGL/GL_ShapeDrawer.cpp +++ b/Demos/OpenGL/GL_ShapeDrawer.cpp @@ -44,7 +44,7 @@ subject to the following restrictions: #include "BMF_Api.h" #include //printf debugging -void GL_ShapeDrawer::DrawCoordSystem() { +void GL_ShapeDrawer::drawCoordSystem() { glBegin(GL_LINES); glColor3f(1, 0, 0); glVertex3d(0, 0, 0); @@ -67,7 +67,7 @@ class GlDrawcallback : public btTriangleCallback { public: - virtual void ProcessTriangle(btVector3* triangle,int partId, int triangleIndex) + virtual void processTriangle(btVector3* triangle,int partId, int triangleIndex) { glBegin(GL_LINES); glColor3f(1, 0, 0); @@ -87,7 +87,7 @@ public: class TriangleGlDrawcallback : public btInternalTriangleIndexCallback { public: - virtual void InternalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) + virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) { glBegin(GL_TRIANGLES);//LINES); glColor3f(1, 0, 0); @@ -104,28 +104,28 @@ public: }; -void GL_ShapeDrawer::DrawOpenGL(float* m, const btCollisionShape* shape, const btVector3& color,int debugMode) +void GL_ShapeDrawer::drawOpenGL(float* m, const btCollisionShape* shape, const btVector3& color,int debugMode) { glPushMatrix(); glMultMatrixf(m); - if (shape->GetShapeType() == COMPOUND_SHAPE_PROXYTYPE) + if (shape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE) { const btCompoundShape* compoundShape = static_cast(shape); - for (int i=compoundShape->GetNumChildShapes()-1;i>=0;i--) + for (int i=compoundShape->getNumChildShapes()-1;i>=0;i--) { - btTransform childTrans = compoundShape->GetChildTransform(i); - const btCollisionShape* colShape = compoundShape->GetChildShape(i); + btTransform childTrans = compoundShape->getChildTransform(i); + const btCollisionShape* colShape = compoundShape->getChildShape(i); float childMat[16]; childTrans.getOpenGLMatrix(childMat); - DrawOpenGL(childMat,colShape,color,debugMode); + drawOpenGL(childMat,colShape,color,debugMode); } } else { - //DrawCoordSystem(); + //drawCoordSystem(); //glPushMatrix(); glEnable(GL_COLOR_MATERIAL); @@ -137,12 +137,12 @@ void GL_ShapeDrawer::DrawOpenGL(float* m, const btCollisionShape* shape, const b if (!(debugMode & btIDebugDraw::DBG_DrawWireframe)) { - switch (shape->GetShapeType()) + switch (shape->getShapeType()) { case BOX_SHAPE_PROXYTYPE: { const btBoxShape* boxShape = static_cast(shape); - btVector3 halfExtent = boxShape->GetHalfExtents(); + btVector3 halfExtent = boxShape->getHalfExtents(); glScaled(2*halfExtent[0], 2*halfExtent[1], 2*halfExtent[2]); glutSolidCube(1.0); useWireframeFallback = false; @@ -160,7 +160,7 @@ void GL_ShapeDrawer::DrawOpenGL(float* m, const btCollisionShape* shape, const b case SPHERE_SHAPE_PROXYTYPE: { const btSphereShape* sphereShape = static_cast(shape); - float radius = sphereShape->GetMargin();//radius doesn't include the margin, so draw with margin + float radius = sphereShape->getMargin();//radius doesn't include the margin, so draw with margin glutSolidSphere(radius,10,10); useWireframeFallback = false; break; @@ -169,8 +169,8 @@ void GL_ShapeDrawer::DrawOpenGL(float* m, const btCollisionShape* shape, const b case CONE_SHAPE_PROXYTYPE: { const btConeShape* coneShape = static_cast(shape); - float radius = coneShape->GetRadius();//+coneShape->GetMargin(); - float height = coneShape->GetHeight();//+coneShape->GetMargin(); + float radius = coneShape->getRadius();//+coneShape->getMargin(); + float height = coneShape->getHeight();//+coneShape->getMargin(); //glRotatef(-90.0, 1.0, 0.0, 0.0); glTranslatef(0.0, 0.0, -0.5*height); glutSolidCone(radius,height,10,10); @@ -188,11 +188,11 @@ void GL_ShapeDrawer::DrawOpenGL(float* m, const btCollisionShape* shape, const b case CYLINDER_SHAPE_PROXYTYPE: { const btCylinderShape* cylinder = static_cast(shape); - int upAxis = cylinder->GetUpAxis(); + int upAxis = cylinder->getUpAxis(); GLUquadricObj *quadObj = gluNewQuadric(); - float radius = cylinder->GetRadius(); - float halfHeight = cylinder->GetHalfExtents()[upAxis]; + float radius = cylinder->getRadius(); + float halfHeight = cylinder->getHalfExtents()[upAxis]; glPushMatrix(); switch (upAxis) @@ -244,7 +244,7 @@ void GL_ShapeDrawer::DrawOpenGL(float* m, const btCollisionShape* shape, const b if (useWireframeFallback) { /// for polyhedral shapes - if (shape->IsPolyhedral()) + if (shape->isPolyhedral()) { btPolyhedralConvexShape* polyshape = (btPolyhedralConvexShape*) shape; @@ -253,10 +253,10 @@ void GL_ShapeDrawer::DrawOpenGL(float* m, const btCollisionShape* shape, const b int i; - for (i=0;iGetNumEdges();i++) + for (i=0;igetNumEdges();i++) { btPoint3 a,b; - polyshape->GetEdge(i,a,b); + polyshape->getEdge(i,a,b); glVertex3f(a.getX(),a.getY(),a.getZ()); glVertex3f(b.getX(),b.getY(),b.getZ()); @@ -269,24 +269,24 @@ void GL_ShapeDrawer::DrawOpenGL(float* m, const btCollisionShape* shape, const b if (debugMode==btIDebugDraw::DBG_DrawFeaturesText) { glRasterPos3f(0.0, 0.0, 0.0); - BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),polyshape->GetExtraDebugInfo()); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),polyshape->getExtraDebugInfo()); glColor3f(1.f, 1.f, 1.f); - for (i=0;iGetNumVertices();i++) + for (i=0;igetNumVertices();i++) { btPoint3 vtx; - polyshape->GetVertex(i,vtx); + polyshape->getVertex(i,vtx); glRasterPos3f(vtx.x(), vtx.y(), vtx.z()); char buf[12]; sprintf(buf," %d",i); BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf); } - for (i=0;iGetNumPlanes();i++) + for (i=0;igetNumPlanes();i++) { btVector3 normal; btPoint3 vtx; - polyshape->GetPlane(normal,vtx,i); + polyshape->getPlane(normal,vtx,i); btScalar d = vtx.dot(normal); glRasterPos3f(normal.x()*d, normal.y()*d, normal.z()*d); @@ -301,7 +301,7 @@ void GL_ShapeDrawer::DrawOpenGL(float* m, const btCollisionShape* shape, const b } } - if (shape->GetShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE) + if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE) { btTriangleMeshShape* concaveMesh = (btTriangleMeshShape*) shape; //btVector3 aabbMax(1e30f,1e30f,1e30f); @@ -313,12 +313,12 @@ void GL_ShapeDrawer::DrawOpenGL(float* m, const btCollisionShape* shape, const b GlDrawcallback drawCallback; - concaveMesh->ProcessAllTriangles(&drawCallback,aabbMin,aabbMax); + concaveMesh->processAllTriangles(&drawCallback,aabbMin,aabbMax); } - if (shape->GetShapeType() == CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE) + if (shape->getShapeType() == CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE) { btConvexTriangleMeshShape* convexMesh = (btConvexTriangleMeshShape*) shape; @@ -326,7 +326,7 @@ void GL_ShapeDrawer::DrawOpenGL(float* m, const btCollisionShape* shape, const b btVector3 aabbMax(1e30f,1e30f,1e30f); btVector3 aabbMin(-1e30f,-1e30f,-1e30f); TriangleGlDrawcallback drawCallback; - convexMesh->GetStridingMesh()->InternalProcessAllTriangles(&drawCallback,aabbMin,aabbMax); + convexMesh->getStridingMesh()->InternalProcessAllTriangles(&drawCallback,aabbMin,aabbMax); } @@ -335,12 +335,12 @@ void GL_ShapeDrawer::DrawOpenGL(float* m, const btCollisionShape* shape, const b glRasterPos3f(0,0,0);//mvtx.x(), vtx.y(), vtx.z()); if (debugMode&btIDebugDraw::DBG_DrawText) { - BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),shape->GetName()); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),shape->getName()); } if (debugMode& btIDebugDraw::DBG_DrawFeaturesText) { - BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),shape->GetExtraDebugInfo()); + BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),shape->getExtraDebugInfo()); } glEnable(GL_DEPTH_BUFFER_BIT); diff --git a/Demos/OpenGL/GL_ShapeDrawer.h b/Demos/OpenGL/GL_ShapeDrawer.h index a37f3799e..dd900d3d9 100644 --- a/Demos/OpenGL/GL_ShapeDrawer.h +++ b/Demos/OpenGL/GL_ShapeDrawer.h @@ -23,8 +23,8 @@ class GL_ShapeDrawer { public: - static void DrawOpenGL(float* m, const btCollisionShape* shape, const btVector3& color,int debugMode); - static void DrawCoordSystem(); + static void drawOpenGL(float* m, const btCollisionShape* shape, const btVector3& color,int debugMode); + static void drawCoordSystem(); }; diff --git a/Demos/OpenGL/GL_Simplex1to4.cpp b/Demos/OpenGL/GL_Simplex1to4.cpp index 93a744590..ece211b25 100644 --- a/Demos/OpenGL/GL_Simplex1to4.cpp +++ b/Demos/OpenGL/GL_Simplex1to4.cpp @@ -34,16 +34,16 @@ GL_Simplex1to4::GL_Simplex1to4() } /// -/// Debugging method CalcClosest calculates the closest point to the origin, using m_simplexSolver +/// Debugging method calcClosest calculates the closest point to the origin, using m_simplexSolver /// -void GL_Simplex1to4::CalcClosest(float* m) +void GL_Simplex1to4::calcClosest(float* m) { btTransform tr; tr.setFromOpenGLMatrix(m); - GL_ShapeDrawer::DrawCoordSystem(); + GL_ShapeDrawer::drawCoordSystem(); if (m_simplexSolver) { diff --git a/Demos/OpenGL/GL_Simplex1to4.h b/Demos/OpenGL/GL_Simplex1to4.h index e59d30543..286e17c20 100644 --- a/Demos/OpenGL/GL_Simplex1to4.h +++ b/Demos/OpenGL/GL_Simplex1to4.h @@ -29,9 +29,9 @@ class GL_Simplex1to4 : public btBU_Simplex1to4 GL_Simplex1to4(); - void CalcClosest(float* m); + void calcClosest(float* m); - void SetSimplexSolver(btSimplexSolverInterface* simplexSolver) { + void setSimplexSolver(btSimplexSolverInterface* simplexSolver) { m_simplexSolver = simplexSolver; } diff --git a/Demos/OpenGL/RenderTexture.cpp b/Demos/OpenGL/RenderTexture.cpp index b0baa40b2..46bb1a78b 100644 --- a/Demos/OpenGL/RenderTexture.cpp +++ b/Demos/OpenGL/RenderTexture.cpp @@ -13,11 +13,11 @@ subject to the following restrictions: 3. This notice may not be removed or altered from any source distribution. */ -#include "RenderTexture.h" +#include "renderTexture.h" #include #include "BMF_FontData.h" -RenderTexture::RenderTexture(int width,int height) +renderTexture::renderTexture(int width,int height) :m_height(height),m_width(width) { m_buffer = new unsigned char[m_width*m_height*4]; @@ -30,14 +30,14 @@ RenderTexture::RenderTexture(int width,int height) { for (int y=0;y>=1; } } @@ -64,7 +64,7 @@ void RenderTexture::Printf(char* str, BMF_FontData* fontData, int startx,int sta } } -RenderTexture::~RenderTexture() +renderTexture::~renderTexture() { delete [] m_buffer; } diff --git a/Demos/OpenGL/RenderTexture.h b/Demos/OpenGL/RenderTexture.h index b6eea54d7..5964f9fb9 100644 --- a/Demos/OpenGL/RenderTexture.h +++ b/Demos/OpenGL/RenderTexture.h @@ -20,9 +20,9 @@ subject to the following restrictions: #include "BMF_FontData.h" /// -///RenderTexture provides a software-render context (setpixel/printf) +///renderTexture provides a software-render context (setpixel/printf) /// -class RenderTexture +class renderTexture { int m_height; int m_width; @@ -30,10 +30,10 @@ class RenderTexture public: - RenderTexture(int width,int height); - ~RenderTexture(); + renderTexture(int width,int height); + ~renderTexture(); - inline void SetPixel(int x,int y,const btVector4& rgba) + inline void setPixel(int x,int y,const btVector4& rgba) { unsigned char* pixel = &m_buffer[ (x+y*m_width) * 4]; @@ -43,10 +43,10 @@ public: pixel[3] = (unsigned char)(255*rgba.getW()); } - const unsigned char* GetBuffer() const { return m_buffer;} - int GetWidth() const { return m_width;} - int GetHeight() const { return m_height;} - void Printf(char* str, BMF_FontData* fontData, int startx = 0,int starty=0); + const unsigned char* getBuffer() const { return m_buffer;} + int getWidth() const { return m_width;} + int getHeight() const { return m_height;} + void grapicalPrintf(char* str, BMF_FontData* fontData, int startx = 0,int starty=0); }; diff --git a/Demos/Raytracer/Raytracer.cpp b/Demos/Raytracer/Raytracer.cpp index d128f7a54..9f997757f 100644 --- a/Demos/Raytracer/Raytracer.cpp +++ b/Demos/Raytracer/Raytracer.cpp @@ -12,7 +12,7 @@ /* -Raytracer uses the Convex Raycast to visualize the Collision Shapes/Minkowski Sum. +Raytracer uses the Convex rayCast to visualize the Collision Shapes/Minkowski Sum. Very basic raytracer, rendering into a texture. */ @@ -46,7 +46,7 @@ Very basic raytracer, rendering into a texture. -#include "RenderTexture.h" +#include "renderTexture.h" btVoronoiSimplexSolver simplexSolver; @@ -60,7 +60,7 @@ GL_Simplex1to4 simplex; btConvexShape* shapePtr[maxNumObjects]; btTransform transforms[maxNumObjects]; -RenderTexture* raytracePicture = 0; +renderTexture* raytracePicture = 0; int screenWidth = 128; int screenHeight = 128; @@ -90,16 +90,16 @@ int main(int argc,char** argv) void Raytracer::initPhysics() { - raytracePicture = new RenderTexture(screenWidth,screenHeight); + raytracePicture = new renderTexture(screenWidth,screenHeight); - myBox.SetMargin(0.02f); - myCone.SetMargin(0.2f); + myBox.setMargin(0.02f); + myCone.setMargin(0.2f); - simplex.SetSimplexSolver(&simplexSolver); - simplex.AddVertex(btPoint3(-1,0,-1)); - simplex.AddVertex(btPoint3(1,0,-1)); - simplex.AddVertex(btPoint3(0,0,1)); - simplex.AddVertex(btPoint3(0,1,0)); + simplex.setSimplexSolver(&simplexSolver); + simplex.addVertex(btPoint3(-1,0,-1)); + simplex.addVertex(btPoint3(1,0,-1)); + simplex.addVertex(btPoint3(0,0,1)); + simplex.addVertex(btPoint3(0,1,0)); /// convex hull of 5 spheres @@ -123,7 +123,7 @@ void Raytracer::initPhysics() shapePtr[2] =convexHullShape; shapePtr[3] =&myMink;//myBox;//multiSphereShape - simplex.SetMargin(0.3f); + simplex.setMargin(0.3f); } @@ -155,7 +155,7 @@ void Raytracer::displayCallback() transforms[i].setRotation(orn); } } - myMink.SetTransformA(btTransform(transforms[0].getRotation())); + myMink.setTransformA(btTransform(transforms[0].getRotation())); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glDisable(GL_LIGHTING); @@ -236,7 +236,7 @@ void Raytracer::displayCallback() for (int y=0;ySetPixel(x,y,rgba); + raytracePicture->setPixel(x,y,rgba); } } @@ -286,12 +286,12 @@ void Raytracer::displayCallback() light = 1.f; rgba = btVector4(light,light,light,1.f); - raytracePicture->SetPixel(x,y,rgba); + raytracePicture->setPixel(x,y,rgba); } else { //clear is already done //rgba = btVector4(0.f,0.f,0.f,0.f); - //raytracePicture->SetPixel(x,y,rgba); + //raytracePicture->setPixel(x,y,rgba); } @@ -306,10 +306,10 @@ void Raytracer::displayCallback() extern BMF_FontData BMF_font_helv10; - raytracePicture->Printf("CCD RAYTRACER",&BMF_font_helv10); + raytracePicture->grapicalPrintf("CCD RAYTRACER",&BMF_font_helv10); char buffer[256]; sprintf(buffer,"%d RAYS / Frame",screenWidth*screenHeight*numObjects); - raytracePicture->Printf(buffer,&BMF_font_helv10,0,10); + raytracePicture->grapicalPrintf(buffer,&BMF_font_helv10,0,10); #endif //TEST_PRINTF @@ -321,7 +321,7 @@ void Raytracer::displayCallback() glMatrixMode(GL_MODELVIEW); glPushMatrix(); - glLoadIdentity(); // Reset The Modelview Matrix + glLoadIdentity(); // reset The Modelview Matrix glTranslatef(0.0f,0.0f,-3.0f); // Move Into The Screen 5 Units @@ -329,11 +329,11 @@ void Raytracer::displayCallback() glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,glTextureId ); - const unsigned char *ptr = raytracePicture->GetBuffer(); + const unsigned char *ptr = raytracePicture->getBuffer(); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, - raytracePicture->GetWidth(),raytracePicture->GetHeight(), + raytracePicture->getWidth(),raytracePicture->getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, @@ -368,7 +368,7 @@ void Raytracer::displayCallback() glDisable(GL_TEXTURE_2D); glDisable(GL_DEPTH_TEST); - GL_ShapeDrawer::DrawCoordSystem(); + GL_ShapeDrawer::drawCoordSystem(); glPushMatrix(); @@ -386,9 +386,9 @@ void Raytracer::displayCallback() transA.getOpenGLMatrix( m ); /// draw the simplex - GL_ShapeDrawer::DrawOpenGL(m,shapePtr[i],btVector3(1,1,1)); + GL_ShapeDrawer::drawOpenGL(m,shapePtr[i],btVector3(1,1,1)); /// calculate closest point from simplex to the origin, and draw this vector - simplex.CalcClosest(m); + simplex.calcClosest(m); } */ diff --git a/Demos/SimplexDemo/SimplexDemo.cpp b/Demos/SimplexDemo/SimplexDemo.cpp index 78fcfd5d1..f5d7c49b4 100644 --- a/Demos/SimplexDemo/SimplexDemo.cpp +++ b/Demos/SimplexDemo/SimplexDemo.cpp @@ -71,7 +71,7 @@ void SimplexDemo::displayCallback() glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glDisable(GL_LIGHTING); - GL_ShapeDrawer::DrawCoordSystem(); + GL_ShapeDrawer::drawCoordSystem(); float m[16]; int i; @@ -88,10 +88,10 @@ void SimplexDemo::displayCallback() transA.getOpenGLMatrix( m ); /// draw the simplex - GL_ShapeDrawer::DrawOpenGL(m,shapePtr[i],btVector3(1,1,1),getDebugMode()); + GL_ShapeDrawer::drawOpenGL(m,shapePtr[i],btVector3(1,1,1),getDebugMode()); /// calculate closest point from simplex to the origin, and draw this vector - simplex.CalcClosest(m); + simplex.calcClosest(m); } pitch += 0.005f; @@ -104,12 +104,12 @@ void SimplexDemo::displayCallback() void SimplexDemo::initPhysics() { - simplex.SetSimplexSolver(&simplexSolver); + simplex.setSimplexSolver(&simplexSolver); - simplex.AddVertex(btPoint3(-2,0,-2)); - simplex.AddVertex(btPoint3(2,0,-2)); - simplex.AddVertex(btPoint3(0,0,2)); - simplex.AddVertex(btPoint3(0,2,0)); + simplex.addVertex(btPoint3(-2,0,-2)); + simplex.addVertex(btPoint3(2,0,-2)); + simplex.addVertex(btPoint3(0,0,2)); + simplex.addVertex(btPoint3(0,2,0)); shapePtr[0] = &simplex; diff --git a/Demos/UserCollisionAlgorithm/UserCollisionAlgorithm.cpp b/Demos/UserCollisionAlgorithm/UserCollisionAlgorithm.cpp index e98549521..e82462ad6 100644 --- a/Demos/UserCollisionAlgorithm/UserCollisionAlgorithm.cpp +++ b/Demos/UserCollisionAlgorithm/UserCollisionAlgorithm.cpp @@ -126,7 +126,7 @@ void UserCollisionAlgorithm::initPhysics() btVector3 maxAabb(10000,10000,10000); btOverlappingPairCache* broadphase = new btAxisSweep3(-maxAabb,maxAabb);//SimpleBroadphase(); - dispatcher->RegisterCollisionCreateFunc(SPHERE_SHAPE_PROXYTYPE,SPHERE_SHAPE_PROXYTYPE,new btSphereSphereCollisionAlgorithm::CreateFunc); + dispatcher->registerCollisionCreateFunc(SPHERE_SHAPE_PROXYTYPE,SPHERE_SHAPE_PROXYTYPE,new btSphereSphereCollisionAlgorithm::CreateFunc); m_physicsEnvironmentPtr = new CcdPhysicsEnvironment(dispatcher,broadphase); @@ -137,16 +137,16 @@ void UserCollisionAlgorithm::initPhysics() startTransform.setIdentity(); startTransform.setOrigin(btVector3(0,-2,0)); - CcdPhysicsController* staticTrimesh = LocalCreatePhysicsObject(isDynamic, mass, startTransform,trimeshShape); + CcdPhysicsController* staticTrimesh = localCreatePhysicsObject(isDynamic, mass, startTransform,trimeshShape); //enable custom material callback - staticTrimesh->GetRigidBody()->m_collisionFlags |= btCollisionObject::customMaterialCallback; + staticTrimesh->getRigidBody()->m_collisionFlags |= btCollisionObject::customMaterialCallback; { for (int i=0;i<10;i++) { btCollisionShape* sphereShape = new btSphereShape(1); startTransform.setOrigin(btVector3(1,2*i,1)); - LocalCreatePhysicsObject(true, 1, startTransform,sphereShape); + localCreatePhysicsObject(true, 1, startTransform,sphereShape); } } m_physicsEnvironmentPtr->setGravity(-1,-10,1); diff --git a/Demos/VehicleDemo/VehicleDemo.cpp b/Demos/VehicleDemo/VehicleDemo.cpp index 81836f87a..01853106e 100644 --- a/Demos/VehicleDemo/VehicleDemo.cpp +++ b/Demos/VehicleDemo/VehicleDemo.cpp @@ -186,12 +186,12 @@ const float TRIANGLE_SIZE=20.f; tr.setOrigin(btVector3(0,-20.f,0)); //create ground object - LocalCreatePhysicsObject(false,0,tr,groundShape); + localCreatePhysicsObject(false,0,tr,groundShape); btCollisionShape* chassisShape = new btBoxShape(btVector3(1.f,0.5f,2.f)); tr.setOrigin(btVector3(0,0.f,0)); - m_carChassis = LocalCreatePhysicsObject(true,800,tr,chassisShape); + m_carChassis = localCreatePhysicsObject(true,800,tr,chassisShape); clientResetScene(); @@ -208,7 +208,7 @@ const float TRIANGLE_SIZE=20.f; 0,0,0); ///never deactivate the vehicle - m_carChassis->GetRigidBody()->SetActivationState(DISABLE_DEACTIVATION); + m_carChassis->getRigidBody()->SetActivationState(DISABLE_DEACTIVATION); gVehicleConstraint = m_physicsEnvironmentPtr->getVehicleConstraint(constraintId); @@ -219,25 +219,25 @@ const float TRIANGLE_SIZE=20.f; int upIndex = 1; int forwardIndex = 2; - gVehicleConstraint->SetCoordinateSystem(rightIndex,upIndex,forwardIndex); + gVehicleConstraint->setCoordinateSystem(rightIndex,upIndex,forwardIndex); - gVehicleConstraint->AddWheel(&wheelMotionState[0], + gVehicleConstraint->addWheel(&wheelMotionState[0], (PHY__Vector3&)connectionPointCS0, (PHY__Vector3&)wheelDirectionCS0,(PHY__Vector3&)wheelAxleCS,suspensionRestLength,wheelRadius,isFrontWheel); connectionPointCS0 = btVector3(-CUBE_HALF_EXTENTS+(0.3*wheelWidth),0,2*CUBE_HALF_EXTENTS-wheelRadius); - gVehicleConstraint->AddWheel(&wheelMotionState[1], + gVehicleConstraint->addWheel(&wheelMotionState[1], (PHY__Vector3&)connectionPointCS0, (PHY__Vector3&)wheelDirectionCS0,(PHY__Vector3&)wheelAxleCS,suspensionRestLength,wheelRadius,isFrontWheel); connectionPointCS0 = btVector3(-CUBE_HALF_EXTENTS+(0.3*wheelWidth),0,-2*CUBE_HALF_EXTENTS+wheelRadius); isFrontWheel = false; - gVehicleConstraint->AddWheel(&wheelMotionState[2], + gVehicleConstraint->addWheel(&wheelMotionState[2], (PHY__Vector3&)connectionPointCS0, (PHY__Vector3&)wheelDirectionCS0,(PHY__Vector3&)wheelAxleCS,suspensionRestLength,wheelRadius,isFrontWheel); connectionPointCS0 = btVector3(CUBE_HALF_EXTENTS-(0.3*wheelWidth),0,-2*CUBE_HALF_EXTENTS+wheelRadius); - gVehicleConstraint->AddWheel(&wheelMotionState[3], + gVehicleConstraint->addWheel(&wheelMotionState[3], (PHY__Vector3&)connectionPointCS0, (PHY__Vector3&)wheelDirectionCS0,(PHY__Vector3&)wheelAxleCS,suspensionRestLength,wheelRadius,isFrontWheel); @@ -277,7 +277,7 @@ void VehicleDemo::renderme() { updateCamera(); - debugDrawer.SetDebugMode(getDebugMode()); + debugDrawer.setDebugMode(getDebugMode()); float m[16]; int i; @@ -288,7 +288,7 @@ void VehicleDemo::renderme() { //draw wheels (cylinders) wheelMotionState[i].m_worldTransform.getOpenGLMatrix(m); - GL_ShapeDrawer::DrawOpenGL(m,&wheelShape,wheelColor,getDebugMode()); + GL_ShapeDrawer::drawOpenGL(m,&wheelShape,wheelColor,getDebugMode()); } DemoApplication::renderme(); @@ -302,14 +302,14 @@ void VehicleDemo::clientMoveAndDisplay() { int steerWheelIndex = 2; - gVehicleConstraint->ApplyEngineForce(gEngineForce,steerWheelIndex); + gVehicleConstraint->applyEngineForce(gEngineForce,steerWheelIndex); steerWheelIndex = 3; - gVehicleConstraint->ApplyEngineForce(gEngineForce,steerWheelIndex); + gVehicleConstraint->applyEngineForce(gEngineForce,steerWheelIndex); steerWheelIndex = 0; - gVehicleConstraint->SetSteeringValue(gVehicleSteering,steerWheelIndex); + gVehicleConstraint->setSteeringValue(gVehicleSteering,steerWheelIndex); steerWheelIndex = 1; - gVehicleConstraint->SetSteeringValue(gVehicleSteering,steerWheelIndex); + gVehicleConstraint->setSteeringValue(gVehicleSteering,steerWheelIndex); } @@ -415,7 +415,7 @@ void VehicleDemo::updateCamera() glLoadIdentity(); //look at the vehicle - m_cameraTargetPosition = m_carChassis->GetRigidBody()->m_worldTransform.getOrigin(); + m_cameraTargetPosition = m_carChassis->getRigidBody()->m_worldTransform.getOrigin(); //interpolate the camera height m_cameraPosition[1] = (15.0*m_cameraPosition[1] + m_cameraTargetPosition[1] + m_cameraHeight)/16.0; diff --git a/Doxyfile b/Doxyfile index cad313001..9d808f1ed 100644 --- a/Doxyfile +++ b/Doxyfile @@ -267,7 +267,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = src Extras/PhysicsInterface Demos +INPUT = src Demos # If the value of the INPUT tag contains directories, you can use the diff --git a/Extras/AlgebraicCCD/BU_CollisionPair.cpp b/Extras/AlgebraicCCD/BU_CollisionPair.cpp index 09a36be2c..4b7a7b919 100644 --- a/Extras/AlgebraicCCD/BU_CollisionPair.cpp +++ b/Extras/AlgebraicCCD/BU_CollisionPair.cpp @@ -58,8 +58,8 @@ bool BU_CollisionPair::calcTimeOfImpact( btVector3 linvelA,angvelA; btVector3 linvelB,angvelB; - btTransformUtil::CalculateVelocity(fromA,toA,1.f,linvelA,angvelA); - btTransformUtil::CalculateVelocity(fromB,toB,1.f,linvelB,angvelB); + btTransformUtil::calculateVelocity(fromA,toA,1.f,linvelA,angvelA); + btTransformUtil::calculateVelocity(fromB,toB,1.f,linvelB,angvelB); btVector3 linearMotionA = toA.getOrigin() - fromA.getOrigin(); @@ -85,11 +85,11 @@ bool BU_CollisionPair::calcTimeOfImpact( /* debugging code { - const int numvertsB = m_convexB->GetNumVertices(); + const int numvertsB = m_convexB->getNumVertices(); for (int v=0;vGetVertex(v,pt); + m_convexB->getVertex(v,pt); pt = b2w * pt; char buf[1000]; @@ -182,11 +182,11 @@ bool BU_CollisionPair::calcTimeOfImpact( //toi = 0; /* { - const int numvertsB = m_convexB->GetNumVertices(); + const int numvertsB = m_convexB->getNumVertices(); for (int v=0;vGetVertex(v,pt); + m_convexB->getVertex(v,pt); pt = impactTransB * pt; char buf[1000]; @@ -215,11 +215,11 @@ bool BU_CollisionPair::calcTimeOfImpact( BU_EdgeEdge edgeEdge; //for all edged in A check agains all edges in B - for (int ea = 0;ea < m_convexA->GetNumEdges();ea++) + for (int ea = 0;ea < m_convexA->getNumEdges();ea++) { btPoint3 pA0,pA1; - m_convexA->GetEdge(ea,pA0,pA1); + m_convexA->getEdge(ea,pA0,pA1); pA0= a2w * pA0;//in world space pA0 = w2s * pA0;//in screwing space @@ -227,12 +227,12 @@ bool BU_CollisionPair::calcTimeOfImpact( pA1= a2w * pA1;//in world space pA1 = w2s * pA1;//in screwing space - int numedgesB = m_convexB->GetNumEdges(); + int numedgesB = m_convexB->getNumEdges(); for (int eb = 0; eb < numedgesB;eb++) { { btPoint3 pB0,pB1; - m_convexB->GetEdge(eb,pB0,pB1); + m_convexB->getEdge(eb,pB0,pB1); pB0= b2w * pB0;//in world space pB0 = w2s * pB0;//in screwing space @@ -307,18 +307,18 @@ bool BU_CollisionPair::calcTimeOfImpact( // for all vertices in A, for each face in B,do vertex-face { - const int numvertsA = m_convexA->GetNumVertices(); + const int numvertsA = m_convexA->getNumVertices(); for (int v=0;vGetVertex(v,vtx); + m_convexA->getVertex(v,vtx); vtx = a2w * vtx;//in world space vtx = w2s * vtx;//in screwing space - const int numplanesB = m_convexB->GetNumPlanes(); + const int numplanesB = m_convexB->getNumPlanes(); for (int p = 0 ; p < numplanesB; p++) //int p=2; @@ -329,7 +329,7 @@ bool BU_CollisionPair::calcTimeOfImpact( btVector3 planeNorm; btPoint3 planeSupport; - m_convexB->GetPlane(planeNorm,planeSupport,p); + m_convexB->getPlane(planeNorm,planeSupport,p); planeSupport = b2w * planeSupport;//transform to world space @@ -377,7 +377,7 @@ bool BU_CollisionPair::calcTimeOfImpact( hitpt = b2winv * hitptWorld; //vertex has to be 'within' the facet's boundary - if (m_convexB->IsInside(hitpt,m_tolerance)) + if (m_convexB->isInside(hitpt,m_tolerance)) { // m_manifold.SetContactPoint(BUM_FeatureVertexFace, index,v,p,hitptWorld,hitNormalWorld); @@ -403,13 +403,13 @@ bool BU_CollisionPair::calcTimeOfImpact( //todo: make this into one method with a kind of 'swapped' logic // { - const int numvertsB = m_convexB->GetNumVertices(); + const int numvertsB = m_convexB->getNumVertices(); for (int v=0;vGetVertex(v,vtx); + m_convexB->getVertex(v,vtx); vtx = b2w * vtx;//in world space /* @@ -429,7 +429,7 @@ bool BU_CollisionPair::calcTimeOfImpact( */ vtx = w2s * vtx;//in screwing space - const int numplanesA = m_convexA->GetNumPlanes(); + const int numplanesA = m_convexA->getNumPlanes(); for (int p = 0 ; p < numplanesA; p++) //int p=2; @@ -439,7 +439,7 @@ bool BU_CollisionPair::calcTimeOfImpact( btVector3 planeNorm; btPoint3 planeSupport; - m_convexA->GetPlane(planeNorm,planeSupport,p); + m_convexA->getPlane(planeNorm,planeSupport,p); planeSupport = a2w * planeSupport;//transform to world space @@ -477,7 +477,7 @@ bool BU_CollisionPair::calcTimeOfImpact( //vertex has to be 'within' the facet's boundary - if (m_convexA->IsInside(hitpt,m_tolerance)) + if (m_convexA->isInside(hitpt,m_tolerance)) { // m_manifold.SetContactPoint(BUM_FeatureFaceVertex,index,p,v,hitptWorld,hitNormalWorld); @@ -552,11 +552,11 @@ bool BU_CollisionPair::calcTimeOfImpact( /* { - const int numvertsB = m_convexB->GetNumVertices(); + const int numvertsB = m_convexB->getNumVertices(); for (int v=0;vGetVertex(v,pt); + m_convexB->getVertex(v,pt); pt = impactTransB * pt; char buf[1000]; diff --git a/Extras/AlternativeCollisionAlgorithms/SphereSphereCollisionAlgorithm.cpp b/Extras/AlternativeCollisionAlgorithms/SphereSphereCollisionAlgorithm.cpp index 09a4f15b8..9fe82da79 100644 --- a/Extras/AlternativeCollisionAlgorithms/SphereSphereCollisionAlgorithm.cpp +++ b/Extras/AlternativeCollisionAlgorithms/SphereSphereCollisionAlgorithm.cpp @@ -23,9 +23,9 @@ btSphereSphereCollisionAlgorithm::btSphereSphereCollisionAlgorithm(btPersistentM m_ownManifold(false), m_manifoldPtr(mf) { - if (!m_manifoldPtr && m_dispatcher->NeedsCollision(*proxy0,*proxy1)) + if (!m_manifoldPtr && m_dispatcher->needsCollision(*proxy0,*proxy1)) { - m_manifoldPtr = m_dispatcher->GetNewManifold(proxy0->m_clientObject,proxy1->m_clientObject); + m_manifoldPtr = m_dispatcher->getNewManifold(proxy0->m_clientObject,proxy1->m_clientObject); m_ownManifold = true; } } @@ -35,11 +35,11 @@ btSphereSphereCollisionAlgorithm::~btSphereSphereCollisionAlgorithm() if (m_ownManifold) { if (m_manifoldPtr) - m_dispatcher->ReleaseManifold(m_manifoldPtr); + m_dispatcher->releaseManifold(m_manifoldPtr); } } -void btSphereSphereCollisionAlgorithm::ProcessCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) +void btSphereSphereCollisionAlgorithm::processCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) { if (!m_manifoldPtr) return; @@ -51,8 +51,8 @@ void btSphereSphereCollisionAlgorithm::ProcessCollision (btBroadphaseProxy* prox btVector3 diff = col0->m_worldTransform.getOrigin()- col1->m_worldTransform.getOrigin(); float len = diff.length(); - btScalar radius0 = sphere0->GetRadius(); - btScalar radius1 = sphere1->GetRadius(); + btScalar radius0 = sphere0->getRadius(); + btScalar radius1 = sphere1->getRadius(); ///iff distance positive, don't generate a new contact if ( len > (radius0+radius1)) @@ -68,13 +68,13 @@ void btSphereSphereCollisionAlgorithm::ProcessCollision (btBroadphaseProxy* prox btVector3 pos1 = col1->m_worldTransform.getOrigin() + radius1* normalOnSurfaceB; /// report a contact. internally this will be kept persistent, and contact reduction is done - btManifoldResult* resultOut = m_dispatcher->GetNewManifoldResult(col0,col1,m_manifoldPtr); - resultOut->AddContactPoint(normalOnSurfaceB,pos1,dist); - m_dispatcher->ReleaseManifoldResult(resultOut); + btManifoldResult* resultOut = m_dispatcher->getNewManifoldResult(col0,col1,m_manifoldPtr); + resultOut->addContactPoint(normalOnSurfaceB,pos1,dist); + m_dispatcher->releaseManifoldResult(resultOut); } -float btSphereSphereCollisionAlgorithm::CalculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) +float btSphereSphereCollisionAlgorithm::calculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) { //not yet return 1.f; diff --git a/Extras/AlternativeCollisionAlgorithms/SphereSphereCollisionAlgorithm.h b/Extras/AlternativeCollisionAlgorithms/SphereSphereCollisionAlgorithm.h index 04951af93..a9b0f6893 100644 --- a/Extras/AlternativeCollisionAlgorithms/SphereSphereCollisionAlgorithm.h +++ b/Extras/AlternativeCollisionAlgorithms/SphereSphereCollisionAlgorithm.h @@ -33,9 +33,9 @@ public: btSphereSphereCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci) : btCollisionAlgorithm(ci) {} - virtual void ProcessCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); + virtual void processCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); - virtual float CalculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); + virtual float calculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); btSphereSphereCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); diff --git a/Extras/ConvexDecomposition/cd_hull.cpp b/Extras/ConvexDecomposition/cd_hull.cpp index da7a45284..2d24d837f 100644 --- a/Extras/ConvexDecomposition/cd_hull.cpp +++ b/Extras/ConvexDecomposition/cd_hull.cpp @@ -2916,7 +2916,7 @@ HullError HullLibrary::ReleaseResult(HullResult &result) // release memory alloc } -static void AddPoint(unsigned int &vcount,float *p,float x,float y,float z) +static void addPoint(unsigned int &vcount,float *p,float x,float y,float z) { float *dest = &p[vcount*3]; dest[0] = x; @@ -3022,14 +3022,14 @@ bool HullLibrary::CleanupVertices(unsigned int svcount, float z1 = center[2] - dz; float z2 = center[2] + dz; - AddPoint(vcount,vertices,x1,y1,z1); - AddPoint(vcount,vertices,x2,y1,z1); - AddPoint(vcount,vertices,x2,y2,z1); - AddPoint(vcount,vertices,x1,y2,z1); - AddPoint(vcount,vertices,x1,y1,z2); - AddPoint(vcount,vertices,x2,y1,z2); - AddPoint(vcount,vertices,x2,y2,z2); - AddPoint(vcount,vertices,x1,y2,z2); + addPoint(vcount,vertices,x1,y1,z1); + addPoint(vcount,vertices,x2,y1,z1); + addPoint(vcount,vertices,x2,y2,z1); + addPoint(vcount,vertices,x1,y2,z1); + addPoint(vcount,vertices,x1,y1,z2); + addPoint(vcount,vertices,x2,y1,z2); + addPoint(vcount,vertices,x2,y2,z2); + addPoint(vcount,vertices,x1,y2,z2); return true; // return cube @@ -3177,14 +3177,14 @@ bool HullLibrary::CleanupVertices(unsigned int svcount, vcount = 0; // add box - AddPoint(vcount,vertices,x1,y1,z1); - AddPoint(vcount,vertices,x2,y1,z1); - AddPoint(vcount,vertices,x2,y2,z1); - AddPoint(vcount,vertices,x1,y2,z1); - AddPoint(vcount,vertices,x1,y1,z2); - AddPoint(vcount,vertices,x2,y1,z2); - AddPoint(vcount,vertices,x2,y2,z2); - AddPoint(vcount,vertices,x1,y2,z2); + addPoint(vcount,vertices,x1,y1,z1); + addPoint(vcount,vertices,x2,y1,z1); + addPoint(vcount,vertices,x2,y2,z1); + addPoint(vcount,vertices,x1,y2,z1); + addPoint(vcount,vertices,x1,y1,z2); + addPoint(vcount,vertices,x2,y1,z2); + addPoint(vcount,vertices,x2,y2,z2); + addPoint(vcount,vertices,x1,y2,z2); return true; } diff --git a/Extras/ConvexDecomposition/cd_wavefront.cpp b/Extras/ConvexDecomposition/cd_wavefront.cpp index 84124d7e1..5d7208630 100644 --- a/Extras/ConvexDecomposition/cd_wavefront.cpp +++ b/Extras/ConvexDecomposition/cd_wavefront.cpp @@ -570,7 +570,7 @@ public: int ParseLine(int lineno,int argc,const char **argv); // return TRUE to continue parsing, return FALSE to abort parsing process private: - void GetVertex(GeometryVertex &v,const char *face) const; + void getVertex(GeometryVertex &v,const char *face) const; FloatVector mVerts; FloatVector mTexels; @@ -609,7 +609,7 @@ static const char * GetArg(const char **argv,int i,int argc) return ret; } -void OBJ::GetVertex(GeometryVertex &v,const char *face) const +void OBJ::getVertex(GeometryVertex &v,const char *face) const { v.mPos[0] = 0; v.mPos[1] = 0; @@ -717,7 +717,7 @@ int OBJ::ParseLine(int lineno,int argc,const char **argv) // return TRUE to con for (int i=1; imPos) ); - mIndices.push_back( GetIndex(v2->mPos) ); - mIndices.push_back( GetIndex(v3->mPos) ); + mIndices.push_back( getIndex(v1->mPos) ); + mIndices.push_back( getIndex(v2->mPos) ); + mIndices.push_back( getIndex(v3->mPos) ); } const FloatVector& GetVertices(void) const { return mVertices; }; diff --git a/Extras/ConvexDecomposition/vlookup.cpp b/Extras/ConvexDecomposition/vlookup.cpp index d2e2254e5..34158a937 100644 --- a/Extras/ConvexDecomposition/vlookup.cpp +++ b/Extras/ConvexDecomposition/vlookup.cpp @@ -173,7 +173,7 @@ public: typedef std::set VertexSet; typedef std::vector< Type > VertexVector; - int GetVertex(const Type& vtx) + int getVertex(const Type& vtx) { VertexLess::SetSearch(vtx,&mVtxs); VertexSet::iterator found; @@ -224,7 +224,7 @@ public: }; - Type * GetBuffer(void) + Type * getBuffer(void) { return &mVtxs[0]; }; @@ -289,7 +289,7 @@ unsigned int Vl_getIndex(VertexLookup vlook,const float *pos) // get index. { VertexPool< VertexPosition > *vp = (VertexPool< VertexPosition > *) vlook; VertexPosition p(pos); - return vp->GetVertex(p); + return vp->getVertex(p); } const float * Vl_getVertices(VertexLookup vlook) diff --git a/Extras/EPA/Epa.cpp b/Extras/EPA/Epa.cpp index 00975780e..44260f769 100644 --- a/Extras/EPA/Epa.cpp +++ b/Extras/EPA/Epa.cpp @@ -73,8 +73,8 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver ) btVector3 seperatingAxisInA = -v * m_transformA.getBasis(); btVector3 seperatingAxisInB = v * m_transformB.getBasis(); - btVector3 pInA = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA ); - btVector3 qInB = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB ); + btVector3 pInA = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA ); + btVector3 qInB = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB ); btPoint3 pWorld = m_transformA( pInA ); btPoint3 qWorld = m_transformB( qInB ); @@ -189,8 +189,8 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver ) btVector3 seperatingAxisInA = v1 * m_transformA.getBasis(); btVector3 seperatingAxisInB = -v1 * m_transformB.getBasis(); - btVector3 p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA ); - btVector3 q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB ); + btVector3 p = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA ); + btVector3 q = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB ); btPoint3 pWorld = m_transformA( p ); btPoint3 qWorld = m_transformB( q ); @@ -202,8 +202,8 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver ) seperatingAxisInA = v2 * m_transformA.getBasis(); seperatingAxisInB = -v2 * m_transformB.getBasis(); - p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA ); - q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB ); + p = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA ); + q = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB ); pWorld = m_transformA( p ); qWorld = m_transformB( q ); @@ -215,8 +215,8 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver ) seperatingAxisInA = v3 * m_transformA.getBasis(); seperatingAxisInB = -v3 * m_transformB.getBasis(); - p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA ); - q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB ); + p = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA ); + q = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB ); pWorld = m_transformA( p ); qWorld = m_transformB( q ); @@ -265,8 +265,8 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver ) btVector3 seperatingAxisInA = triangleNormal * m_transformA.getBasis(); btVector3 seperatingAxisInB = -triangleNormal * m_transformB.getBasis(); - btVector3 p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA ); - btVector3 q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB ); + btVector3 p = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA ); + btVector3 q = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB ); btPoint3 pWorld = m_transformA( p ); btPoint3 qWorld = m_transformB( q ); @@ -284,8 +284,8 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver ) seperatingAxisInA = -triangleNormal * m_transformA.getBasis(); seperatingAxisInB = triangleNormal * m_transformB.getBasis(); - p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA ); - q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB ); + p = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA ); + q = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB ); pWorld = m_transformA( p ); qWorld = m_transformB( q ); @@ -398,7 +398,7 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver ) return true; } -btScalar Epa::CalcPenDepth( btPoint3& wWitnessOnA, btPoint3& wWitnessOnB ) +btScalar Epa::calcPenDepth( btPoint3& wWitnessOnA, btPoint3& wWitnessOnB ) { btVector3 v; @@ -448,8 +448,8 @@ btScalar Epa::CalcPenDepth( btPoint3& wWitnessOnA, btPoint3& wWitnessOnB ) btVector3 seperatingAxisInA = v * m_transformA.getBasis(); btVector3 seperatingAxisInB = -v * m_transformB.getBasis(); - btVector3 p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA ); - btVector3 q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB ); + btVector3 p = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA ); + btVector3 q = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB ); btPoint3 pWorld = m_transformA( p ); btPoint3 qWorld = m_transformB( q ); diff --git a/Extras/EPA/Epa.h b/Extras/EPA/Epa.h index 1ea084754..e5cb81e86 100644 --- a/Extras/EPA/Epa.h +++ b/Extras/EPA/Epa.h @@ -40,7 +40,7 @@ class Epa bool Initialize( btSimplexSolverInterface& simplexSolver ); - btScalar CalcPenDepth( btPoint3& wWitnessOnA, btPoint3& wWitnessOnB ); + btScalar calcPenDepth( btPoint3& wWitnessOnA, btPoint3& wWitnessOnB ); private : diff --git a/Extras/EPA/EpaPenetrationDepthSolver.cpp b/Extras/EPA/EpaPenetrationDepthSolver.cpp index 049bd2a04..bfddf762e 100644 --- a/Extras/EPA/EpaPenetrationDepthSolver.cpp +++ b/Extras/EPA/EpaPenetrationDepthSolver.cpp @@ -39,7 +39,7 @@ subject to the following restrictions: btScalar g_GJKMaxRelError = 1e-3f; btScalar g_GJKMaxRelErrorSqrd = g_GJKMaxRelError * g_GJKMaxRelError; -bool EpaPenetrationDepthSolver::CalcPenDepth( btSimplexSolverInterface& simplexSolver, +bool EpaPenetrationDepthSolver::calcPenDepth( btSimplexSolverInterface& simplexSolver, btConvexShape* pConvexA, btConvexShape* pConvexB, const btTransform& transformA, const btTransform& transformB, btVector3& v, btPoint3& wWitnessOnA, btPoint3& wWitnessOnB, @@ -79,7 +79,7 @@ bool EpaPenetrationDepthSolver::HybridPenDepth( btSimplexSolverInterface& simple btScalar squaredDistance = SIMD_INFINITY; btScalar delta = 0.f; - const btScalar margin = pConvexA->GetMargin() + pConvexB->GetMargin(); + const btScalar margin = pConvexA->getMargin() + pConvexB->getMargin(); const btScalar marginSqrd = margin * margin; simplexSolver.reset(); @@ -93,8 +93,8 @@ bool EpaPenetrationDepthSolver::HybridPenDepth( btSimplexSolverInterface& simple btVector3 seperatingAxisInA = -v * transformA.getBasis(); btVector3 seperatingAxisInB = v * transformB.getBasis(); - btVector3 pInA = pConvexA->LocalGetSupportingVertexWithoutMargin( seperatingAxisInA ); - btVector3 qInB = pConvexB->LocalGetSupportingVertexWithoutMargin( seperatingAxisInB ); + btVector3 pInA = pConvexA->localGetSupportingVertexWithoutMargin( seperatingAxisInA ); + btVector3 qInB = pConvexB->localGetSupportingVertexWithoutMargin( seperatingAxisInB ); btPoint3 pWorld = transformA( pInA ); btPoint3 qWorld = transformB( qInB ); @@ -119,10 +119,10 @@ bool EpaPenetrationDepthSolver::HybridPenDepth( btSimplexSolverInterface& simple assert( ( squaredDistance > 0 ) && "squaredDistance is zero!" ); btScalar vLength = sqrt( squaredDistance ); - wWitnessOnA -= v * ( pConvexA->GetMargin() / vLength ); - wWitnessOnB += v * ( pConvexB->GetMargin() / vLength ); + wWitnessOnA -= v * ( pConvexA->getMargin() / vLength ); + wWitnessOnB += v * ( pConvexB->getMargin() / vLength ); - penDepth = pConvexA->GetMargin() + pConvexB->GetMargin() - vLength; + penDepth = pConvexA->getMargin() + pConvexB->getMargin() - vLength; // Returning true means that Hybrid's result is ok and there's no need to run EPA return true; @@ -139,10 +139,10 @@ bool EpaPenetrationDepthSolver::HybridPenDepth( btSimplexSolverInterface& simple assert( ( squaredDistance > 0 ) && "squaredDistance is zero!" ); btScalar vLength = sqrt( squaredDistance ); - wWitnessOnA -= v * ( pConvexA->GetMargin() / vLength ); - wWitnessOnB += v * ( pConvexB->GetMargin() / vLength ); + wWitnessOnA -= v * ( pConvexA->getMargin() / vLength ); + wWitnessOnB += v * ( pConvexB->getMargin() / vLength ); - penDepth = pConvexA->GetMargin() + pConvexB->GetMargin() - vLength; + penDepth = pConvexA->getMargin() + pConvexB->getMargin() - vLength; // Returning true means that Hybrid's result is ok and there's no need to run EPA return true; @@ -162,10 +162,10 @@ bool EpaPenetrationDepthSolver::HybridPenDepth( btSimplexSolverInterface& simple assert( ( squaredDistance > 0 ) && "squaredDistance is zero!" ); btScalar vLength = sqrt( squaredDistance ); - wWitnessOnA -= v * ( pConvexA->GetMargin() / vLength ); - wWitnessOnB += v * ( pConvexB->GetMargin() / vLength ); + wWitnessOnA -= v * ( pConvexA->getMargin() / vLength ); + wWitnessOnB += v * ( pConvexB->getMargin() / vLength ); - penDepth = pConvexA->GetMargin() + pConvexB->GetMargin() - vLength; + penDepth = pConvexA->getMargin() + pConvexB->getMargin() - vLength; // Returning true means that Hybrid's result is ok and there's no need to run EPA return true; @@ -197,6 +197,6 @@ btScalar EpaPenetrationDepthSolver::EpaPenDepth( btSimplexSolverInterface& simpl return 0; } - return epa.CalcPenDepth( wWitnessOnA, wWitnessOnB ); + return epa.calcPenDepth( wWitnessOnA, wWitnessOnB ); } diff --git a/Extras/EPA/EpaPenetrationDepthSolver.h b/Extras/EPA/EpaPenetrationDepthSolver.h index 7902c8419..6a92abd8b 100644 --- a/Extras/EPA/EpaPenetrationDepthSolver.h +++ b/Extras/EPA/EpaPenetrationDepthSolver.h @@ -30,7 +30,7 @@ class EpaPenetrationDepthSolver : public btConvexPenetrationDepthSolver { public : - bool CalcPenDepth( btSimplexSolverInterface& simplexSolver, + bool calcPenDepth( btSimplexSolverInterface& simplexSolver, btConvexShape* pConvexA, btConvexShape* pConvexB, const btTransform& transformA, const btTransform& transformB, btVector3& v, btPoint3& wWitnessOnA, btPoint3& wWitnessOnB, diff --git a/Extras/ExtraSolid35/Solid3EpaPenetrationDepth.cpp b/Extras/ExtraSolid35/Solid3EpaPenetrationDepth.cpp index 136369b32..52723d85a 100644 --- a/Extras/ExtraSolid35/Solid3EpaPenetrationDepth.cpp +++ b/Extras/ExtraSolid35/Solid3EpaPenetrationDepth.cpp @@ -317,7 +317,7 @@ inline bool originInTetrahedron(const btVector3& p1, const btVector3& p2, -bool Solid3EpaPenetrationDepth::CalcPenDepth( btSimplexSolverInterface& simplexSolver, +bool Solid3EpaPenetrationDepth::calcPenDepth( btSimplexSolverInterface& simplexSolver, btConvexShape* convexA,btConvexShape* convexB, const btTransform& transformA,const btTransform& transformB, btVector3& v, btPoint3& pa, btPoint3& pb) @@ -348,16 +348,16 @@ bool Solid3EpaPenetrationDepth::CalcPenDepth( btSimplexSolverInterface& simplexS btVector3 aux2 = rot_mat * aux1; btVector3 aux3 = rot_mat * aux2; - pBuf[2] = transformA(convexA->LocalGetSupportingVertex(aux1*transformA.getBasis())); - qBuf[2] = transformB(convexB->LocalGetSupportingVertex((-aux1)*transformB.getBasis())); + pBuf[2] = transformA(convexA->localGetSupportingVertex(aux1*transformA.getBasis())); + qBuf[2] = transformB(convexB->localGetSupportingVertex((-aux1)*transformB.getBasis())); yBuf[2] = pBuf[2] - qBuf[2]; - pBuf[3] = transformA(convexA->LocalGetSupportingVertex(aux2*transformA.getBasis())); - qBuf[3] = transformB(convexB->LocalGetSupportingVertex((-aux2)*transformB.getBasis())); + pBuf[3] = transformA(convexA->localGetSupportingVertex(aux2*transformA.getBasis())); + qBuf[3] = transformB(convexB->localGetSupportingVertex((-aux2)*transformB.getBasis())); yBuf[3] = pBuf[3] - qBuf[3]; - pBuf[4] = transformA(convexA->LocalGetSupportingVertex(aux3*transformA.getBasis())); - qBuf[4] = transformB(convexB->LocalGetSupportingVertex((-aux3)*transformB.getBasis())); + pBuf[4] = transformA(convexA->localGetSupportingVertex(aux3*transformA.getBasis())); + qBuf[4] = transformB(convexB->localGetSupportingVertex((-aux3)*transformB.getBasis())); yBuf[4] = pBuf[4] - qBuf[4]; if (originInTetrahedron(yBuf[0], yBuf[2], yBuf[3], yBuf[4])) @@ -391,11 +391,11 @@ bool Solid3EpaPenetrationDepth::CalcPenDepth( btSimplexSolverInterface& simplexS btVector3 v2 = yBuf[2] - yBuf[0]; btVector3 vv = v1.cross(v2); - pBuf[3] = transformA(convexA->LocalGetSupportingVertex(vv*transformA.getBasis())); - qBuf[3] = transformB(convexB->LocalGetSupportingVertex((-vv)*transformB.getBasis())); + pBuf[3] = transformA(convexA->localGetSupportingVertex(vv*transformA.getBasis())); + qBuf[3] = transformB(convexB->localGetSupportingVertex((-vv)*transformB.getBasis())); yBuf[3] = pBuf[3] - qBuf[3]; - pBuf[4] = transformA(convexA->LocalGetSupportingVertex((-vv)*transformA.getBasis())); - qBuf[4] = transformB(convexB->LocalGetSupportingVertex(vv*transformB.getBasis())); + pBuf[4] = transformA(convexA->localGetSupportingVertex((-vv)*transformA.getBasis())); + qBuf[4] = transformB(convexB->localGetSupportingVertex(vv*transformB.getBasis())); yBuf[4] = pBuf[4] - qBuf[4]; @@ -481,8 +481,8 @@ bool Solid3EpaPenetrationDepth::CalcPenDepth( btSimplexSolverInterface& simplexS break; } - pBuf[num_verts] = transformA(convexA->LocalGetSupportingVertex((facet->getClosest())*transformA.getBasis())); - qBuf[num_verts] = transformB(convexB->LocalGetSupportingVertex((-facet->getClosest())*transformB.getBasis())); + pBuf[num_verts] = transformA(convexA->localGetSupportingVertex((facet->getClosest())*transformA.getBasis())); + qBuf[num_verts] = transformB(convexB->localGetSupportingVertex((-facet->getClosest())*transformB.getBasis())); yBuf[num_verts] = pBuf[num_verts] - qBuf[num_verts]; diff --git a/Extras/ExtraSolid35/Solid3EpaPenetrationDepth.h b/Extras/ExtraSolid35/Solid3EpaPenetrationDepth.h index 7532f04f2..d1757202f 100644 --- a/Extras/ExtraSolid35/Solid3EpaPenetrationDepth.h +++ b/Extras/ExtraSolid35/Solid3EpaPenetrationDepth.h @@ -32,7 +32,7 @@ class Solid3EpaPenetrationDepth : public btConvexPenetrationDepthSolver { public: - virtual bool CalcPenDepth(btSimplexSolverInterface& simplexSolver, + virtual bool calcPenDepth(btSimplexSolverInterface& simplexSolver, btConvexShape* convexA,btConvexShape* convexB, const btTransform& transformA,const btTransform& transformB, btVector3& v, btPoint3& pa, btPoint3& pb); diff --git a/Extras/GPUphysics/GPU_physics_demo.cpp b/Extras/GPUphysics/GPU_physics_demo.cpp index 6650b3c92..ff4496c4a 100644 --- a/Extras/GPUphysics/GPU_physics_demo.cpp +++ b/Extras/GPUphysics/GPU_physics_demo.cpp @@ -122,7 +122,7 @@ void initGLcontext ( int argc, char **argv, glutInit ( &argc, argv ) ; glutInitDisplayMode ( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE ) ; glutInitWindowSize ( win_width, win_height ) ; - glutCreateWindow ( "Shader Math Demo" ) ; + glutCreateWindow ( "Bullet GPU Physics Demo. http://bullet.sf.net" ) ; glutDisplayFunc ( display ) ; glutKeyboardFunc ( keybd ) ; glutReshapeFunc ( reshape ) ; @@ -703,7 +703,7 @@ void help () int main ( int argc, char **argv ) { - bool disableVertexTextureSupport = false ; + bool disableVertexTextureSupport = true ; debugOpt = DRAW_ALL ; for ( int i = 1 ; i < argc ; i++ ) diff --git a/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp b/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp index c0e4c207a..808a81838 100644 --- a/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp +++ b/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp @@ -131,7 +131,7 @@ bool CcdPhysicsController::SynchronizeMotionStates(float time) float scale[3]; m_MotionState->getWorldScaling(scale[0],scale[1],scale[2]); btVector3 scaling(scale[0],scale[1],scale[2]); - GetCollisionShape()->setLocalScaling(scaling); + getCollisionShape()->setLocalScaling(scaling); } else { btVector3 worldPos; @@ -150,7 +150,7 @@ bool CcdPhysicsController::SynchronizeMotionStates(float time) float scale[3]; m_MotionState->getWorldScaling(scale[0],scale[1],scale[2]); btVector3 scaling(scale[0],scale[1],scale[2]); - GetCollisionShape()->setLocalScaling(scaling); + getCollisionShape()->setLocalScaling(scaling); } return true; @@ -312,10 +312,10 @@ void CcdPhysicsController::setScaling(float scaleX,float scaleY,float scaleZ) { m_cci.m_scaling = btVector3(scaleX,scaleY,scaleZ); - if (m_body && m_body->GetCollisionShape()) + if (m_body && m_body->getCollisionShape()) { - m_body->GetCollisionShape()->setLocalScaling(m_cci.m_scaling); - m_body->GetCollisionShape()->CalculateLocalInertia(m_cci.m_mass, m_cci.m_localInertiaTensor); + m_body->getCollisionShape()->setLocalScaling(m_cci.m_scaling); + m_body->getCollisionShape()->calculateLocalInertia(m_cci.m_mass, m_cci.m_localInertiaTensor); m_body->setMassProps(m_cci.m_mass, m_cci.m_localInertiaTensor * m_cci.m_inertiaFactor); } } @@ -499,7 +499,7 @@ PHY_IPhysicsController* CcdPhysicsController::GetReplica() btCcdConstructionInfo cinfo = m_cci; if (cinfo.m_collisionShape) { - switch (cinfo.m_collisionShape->GetShapeType()) + switch (cinfo.m_collisionShape->getShapeType()) { case SPHERE_SHAPE_PROXYTYPE: { diff --git a/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.h b/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.h index 47a86789b..4c4f14fb3 100644 --- a/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.h +++ b/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.h @@ -46,7 +46,7 @@ struct btCcdConstructionInfo ///CollisionFilterGroups provides some optional usage of basic collision filtering ///this is done during broadphase, so very early in the pipeline - ///more advanced collision filtering should be done in btCollisionDispatcher::NeedsCollision + ///more advanced collision filtering should be done in btCollisionDispatcher::needsCollision enum CollisionFilterGroups { DefaultFilter = 1, @@ -87,7 +87,7 @@ struct btCcdConstructionInfo ///optional use of collision group/mask: ///only collision with object goups that match the collision mask. ///this is very basic early out. advanced collision filtering should be - ///done in the btCollisionDispatcher::NeedsCollision and NeedsResponse + ///done in the btCollisionDispatcher::needsCollision and needsResponse ///both values default to 1 short int m_collisionFilterGroup; short int m_collisionFilterMask; @@ -127,10 +127,10 @@ class CcdPhysicsController : public PHY_IPhysicsController virtual ~CcdPhysicsController(); - btRigidBody* GetRigidBody() { return m_body;} + btRigidBody* getRigidBody() { return m_body;} - btCollisionShape* GetCollisionShape() { - return m_body->GetCollisionShape(); + btCollisionShape* getCollisionShape() { + return m_body->getCollisionShape(); } //////////////////////////////////// // PHY_IPhysicsController interface @@ -198,8 +198,8 @@ class CcdPhysicsController : public PHY_IPhysicsController virtual void calcXform() {} ; - virtual void SetMargin(float margin) {}; - virtual float GetMargin() const {return 0.f;}; + virtual void setMargin(float margin) {}; + virtual float getMargin() const {return 0.f;}; bool wantsSleeping(); @@ -208,7 +208,7 @@ class CcdPhysicsController : public PHY_IPhysicsController static btTransform GetTransformFromMotionState(PHY_IMotionState* motionState); - void SetAabb(const btVector3& aabbMin,const btVector3& aabbMax); + void setAabb(const btVector3& aabbMin,const btVector3& aabbMax); class PHY_IMotionState* GetMotionState() diff --git a/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp b/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp index 9fc70d8ca..912325aaf 100644 --- a/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp +++ b/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp @@ -117,7 +117,7 @@ public: return m_chassis; } - virtual void AddWheel( + virtual void addWheel( PHY_IMotionState* motionState, PHY__Vector3 connectionPoint, PHY__Vector3 downDirection, @@ -132,7 +132,7 @@ public: btVector3 wheelAxle(axleDirection[0],axleDirection[1],axleDirection[2]); - btWheelInfo& info = m_vehicle->AddWheel(connectionPointCS0,wheelDirectionCS0,wheelAxle, + btWheelInfo& info = m_vehicle->addWheel(connectionPointCS0,wheelDirectionCS0,wheelAxle, suspensionRestLength,wheelRadius,gTuning,hasSteering); info.m_clientInfo = motionState; @@ -140,14 +140,14 @@ public: void SyncWheels() { - int numWheels = GetNumWheels(); + int numWheels = getNumWheels(); int i; for (i=0;iGetWheelInfo(i); + btWheelInfo& info = m_vehicle->getWheelInfo(i); PHY_IMotionState* motionState = (PHY_IMotionState*)info.m_clientInfo ; - m_vehicle->UpdateWheelTransform(i); - btTransform trans = m_vehicle->GetWheelTransformWS(i); + m_vehicle->updateWheelTransform(i); + btTransform trans = m_vehicle->getWheelTransformWS(i); btQuaternion orn = trans.getRotation(); const btVector3& pos = trans.getOrigin(); motionState->setWorldOrientation(orn.x(),orn.y(),orn.z(),orn[3]); @@ -156,21 +156,21 @@ public: } } - virtual int GetNumWheels() const + virtual int getNumWheels() const { - return m_vehicle->GetNumWheels(); + return m_vehicle->getNumWheels(); } virtual void GetWheelPosition(int wheelIndex,float& posX,float& posY,float& posZ) const { - btTransform trans = m_vehicle->GetWheelTransformWS(wheelIndex); + btTransform trans = m_vehicle->getWheelTransformWS(wheelIndex); posX = trans.getOrigin().x(); posY = trans.getOrigin().y(); posZ = trans.getOrigin().z(); } virtual void GetWheelOrientationQuaternion(int wheelIndex,float& quatX,float& quatY,float& quatZ,float& quatW) const { - btTransform trans = m_vehicle->GetWheelTransformWS(wheelIndex); + btTransform trans = m_vehicle->getWheelTransformWS(wheelIndex); btQuaternion quat = trans.getRotation(); btMatrix3x3 orn2(quat); @@ -189,9 +189,9 @@ public: { float rotation = 0.f; - if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels())) + if ((wheelIndex>=0) && (wheelIndex< m_vehicle->getNumWheels())) { - btWheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex); + btWheelInfo& info = m_vehicle->getWheelInfo(wheelIndex); rotation = info.m_rotation; } return rotation; @@ -200,40 +200,40 @@ public: - virtual int GetUserConstraintId() const + virtual int getUserConstraintId() const { - return m_vehicle->GetUserConstraintId(); + return m_vehicle->getUserConstraintId(); } - virtual int GetUserConstraintType() const + virtual int getUserConstraintType() const { - return m_vehicle->GetUserConstraintType(); + return m_vehicle->getUserConstraintType(); } - virtual void SetSteeringValue(float steering,int wheelIndex) + virtual void setSteeringValue(float steering,int wheelIndex) { - m_vehicle->SetSteeringValue(steering,wheelIndex); + m_vehicle->setSteeringValue(steering,wheelIndex); } - virtual void ApplyEngineForce(float force,int wheelIndex) + virtual void applyEngineForce(float force,int wheelIndex) { - m_vehicle->ApplyEngineForce(force,wheelIndex); + m_vehicle->applyEngineForce(force,wheelIndex); } virtual void ApplyBraking(float braking,int wheelIndex) { - if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels())) + if ((wheelIndex>=0) && (wheelIndex< m_vehicle->getNumWheels())) { - btWheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex); + btWheelInfo& info = m_vehicle->getWheelInfo(wheelIndex); info.m_brake = braking; } } virtual void SetWheelFriction(float friction,int wheelIndex) { - if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels())) + if ((wheelIndex>=0) && (wheelIndex< m_vehicle->getNumWheels())) { - btWheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex); + btWheelInfo& info = m_vehicle->getWheelInfo(wheelIndex); info.m_frictionSlip = friction; } @@ -241,9 +241,9 @@ public: virtual void SetSuspensionStiffness(float suspensionStiffness,int wheelIndex) { - if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels())) + if ((wheelIndex>=0) && (wheelIndex< m_vehicle->getNumWheels())) { - btWheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex); + btWheelInfo& info = m_vehicle->getWheelInfo(wheelIndex); info.m_suspensionStiffness = suspensionStiffness; } @@ -251,18 +251,18 @@ public: virtual void SetSuspensionDamping(float suspensionDamping,int wheelIndex) { - if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels())) + if ((wheelIndex>=0) && (wheelIndex< m_vehicle->getNumWheels())) { - btWheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex); + btWheelInfo& info = m_vehicle->getWheelInfo(wheelIndex); info.m_wheelsDampingRelaxation = suspensionDamping; } } virtual void SetSuspensionCompression(float suspensionCompression,int wheelIndex) { - if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels())) + if ((wheelIndex>=0) && (wheelIndex< m_vehicle->getNumWheels())) { - btWheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex); + btWheelInfo& info = m_vehicle->getWheelInfo(wheelIndex); info.m_wheelsDampingCompression = suspensionCompression; } } @@ -271,16 +271,16 @@ public: virtual void SetRollInfluence(float rollInfluence,int wheelIndex) { - if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels())) + if ((wheelIndex>=0) && (wheelIndex< m_vehicle->getNumWheels())) { - btWheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex); + btWheelInfo& info = m_vehicle->getWheelInfo(wheelIndex); info.m_rollInfluence = rollInfluence; } } - virtual void SetCoordinateSystem(int rightIndex,int upIndex,int forwardIndex) + virtual void setCoordinateSystem(int rightIndex,int upIndex,int forwardIndex) { - m_vehicle->SetCoordinateSystem(rightIndex,upIndex,forwardIndex); + m_vehicle->setCoordinateSystem(rightIndex,upIndex,forwardIndex); } @@ -311,7 +311,7 @@ static void DrawAabb(btIDebugDraw* debugDrawer,const btVector3& from,const btVec edgecoord[2]*halfExtents[2]); pb+=center; - debugDrawer->DrawLine(pa,pb,color); + debugDrawer->drawLine(pa,pb,color); } edgecoord = btVector3(-1.f,-1.f,-1.f); if (i<3) @@ -371,7 +371,7 @@ m_scalingPropagated(false) void CcdPhysicsEnvironment::addCcdPhysicsController(CcdPhysicsController* ctrl) { - btRigidBody* body = ctrl->GetRigidBody(); + btRigidBody* body = ctrl->getRigidBody(); //this m_userPointer is just used for triggers, see CallbackTriggers body->m_internalOwner = ctrl; @@ -379,21 +379,21 @@ void CcdPhysicsEnvironment::addCcdPhysicsController(CcdPhysicsController* ctrl) body->setGravity( m_gravity ); m_controllers.push_back(ctrl); - m_collisionWorld->AddCollisionObject(body,ctrl->GetCollisionFilterGroup(),ctrl->GetCollisionFilterMask()); + m_collisionWorld->addCollisionObject(body,ctrl->GetCollisionFilterGroup(),ctrl->GetCollisionFilterMask()); assert(body->m_broadphaseHandle); - btCollisionShape* shapeinterface = ctrl->GetCollisionShape(); + btCollisionShape* shapeinterface = ctrl->getCollisionShape(); assert(shapeinterface); - const btTransform& t = ctrl->GetRigidBody()->getCenterOfMassTransform(); + const btTransform& t = ctrl->getRigidBody()->getCenterOfMassTransform(); body->m_cachedInvertedWorldTransform = body->m_worldTransform.inverse(); btPoint3 minAabb,maxAabb; - shapeinterface->GetAabb(t,minAabb,maxAabb); + shapeinterface->getAabb(t,minAabb,maxAabb); float timeStep = 0.02f; @@ -443,10 +443,10 @@ void CcdPhysicsEnvironment::removeCcdPhysicsController(CcdPhysicsController* ctr !(i==m_constraints.end()); i++) { btTypedConstraint* constraint = (*i); - if ((&constraint->GetRigidBodyA() == ctrl->GetRigidBody() || - (&constraint->GetRigidBodyB() == ctrl->GetRigidBody()))) + if ((&constraint->getRigidBodyA() == ctrl->getRigidBody() || + (&constraint->getRigidBodyB() == ctrl->getRigidBody()))) { - removeConstraint(constraint->GetUserConstraintId()); + removeConstraint(constraint->getUserConstraintId()); //only 1 constraint per constroller break; } @@ -460,10 +460,10 @@ void CcdPhysicsEnvironment::removeCcdPhysicsController(CcdPhysicsController* ctr !(i==m_constraints.end()); i++) { btTypedConstraint* constraint = (*i); - if ((&constraint->GetRigidBodyA() == ctrl->GetRigidBody() || - (&constraint->GetRigidBodyB() == ctrl->GetRigidBody()))) + if ((&constraint->getRigidBodyA() == ctrl->getRigidBody() || + (&constraint->getRigidBodyB() == ctrl->getRigidBody()))) { - removeConstraint(constraint->GetUserConstraintId()); + removeConstraint(constraint->getUserConstraintId()); //only 1 constraint per constroller break; } @@ -471,7 +471,7 @@ void CcdPhysicsEnvironment::removeCcdPhysicsController(CcdPhysicsController* ctr } - m_collisionWorld->RemoveCollisionObject(ctrl->GetRigidBody()); + m_collisionWorld->removeCollisionObject(ctrl->getRigidBody()); { @@ -516,7 +516,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep) #ifdef USE_QUICKPROF //toggle btProfiler - if ( m_debugDrawer && m_debugDrawer->GetDebugMode() & btIDebugDraw::DBG_ProfileTimings) + if ( m_debugDrawer && m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_ProfileTimings) { if (!m_profileTimings) { @@ -554,7 +554,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep) CcdPhysicsController* ctrl = *i; btTransform predictedTrans; - btRigidBody* body = ctrl->GetRigidBody(); + btRigidBody* body = ctrl->getRigidBody(); if (body->GetActivationState() != ISLAND_SLEEPING) { @@ -607,7 +607,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) if (m_debugDrawer) { - gDisableDeactivation = (m_debugDrawer->GetDebugMode() & btIDebugDraw::DBG_NoDeactivation); + gDisableDeactivation = (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_NoDeactivation); } @@ -640,7 +640,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) { CcdPhysicsController* ctrl = m_controllers[k]; // btTransform predictedTrans; - btRigidBody* body = ctrl->GetRigidBody(); + btRigidBody* body = ctrl->getRigidBody(); body->m_cachedInvertedWorldTransform = body->m_worldTransform.inverse(); @@ -661,7 +661,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) btProfiler::endBlock("predictIntegratedTransform"); #endif //USE_QUICKPROF - btOverlappingPairCache* scene = m_collisionWorld->GetPairCache(); + btOverlappingPairCache* scene = m_collisionWorld->getPairCache(); // @@ -670,7 +670,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) #ifdef USE_QUICKPROF - btProfiler::beginBlock("DispatchAllCollisionPairs"); + btProfiler::beginBlock("dispatchAllCollisionPairs"); #endif //USE_QUICKPROF @@ -683,16 +683,16 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) dispatchInfo.m_enableSatConvex = m_enableSatCollisionDetection; dispatchInfo.m_debugDraw = this->m_debugDrawer; - scene->RefreshOverlappingPairs(); + scene->refreshOverlappingPairs(); - GetCollisionWorld()->GetDispatcher()->DispatchAllCollisionPairs(scene,dispatchInfo); + getCollisionWorld()->getDispatcher()->dispatchAllCollisionPairs(scene,dispatchInfo); #ifdef USE_QUICKPROF - btProfiler::endBlock("DispatchAllCollisionPairs"); + btProfiler::endBlock("dispatchAllCollisionPairs"); #endif //USE_QUICKPROF - m_islandManager->UpdateActivationState(GetCollisionWorld(),GetCollisionWorld()->GetDispatcher()); + m_islandManager->updateActivationState(getCollisionWorld(),getCollisionWorld()->getDispatcher()); { int i; @@ -701,8 +701,8 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) { btTypedConstraint* constraint = m_constraints[i]; - const btRigidBody* colObj0 = &constraint->GetRigidBodyA(); - const btRigidBody* colObj1 = &constraint->GetRigidBodyB(); + const btRigidBody* colObj0 = &constraint->getRigidBodyA(); + const btRigidBody* colObj1 = &constraint->getRigidBodyB(); if (((colObj0) && ((colObj0)->mergesSimulationIslands())) && ((colObj1) && ((colObj1)->mergesSimulationIslands()))) @@ -710,19 +710,19 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) if (colObj0->IsActive() || colObj1->IsActive()) { - m_islandManager->GetUnionFind().unite((colObj0)->m_islandTag1, + m_islandManager->getUnionFind().unite((colObj0)->m_islandTag1, (colObj1)->m_islandTag1); } } } } - m_islandManager->StoreIslandActivationState(GetCollisionWorld()); + m_islandManager->storeIslandActivationState(getCollisionWorld()); //contacts #ifdef USE_QUICKPROF - btProfiler::beginBlock("SolveConstraint"); + btProfiler::beginBlock("solveConstraint"); #endif //USE_QUICKPROF @@ -743,8 +743,8 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) { btTypedConstraint* constraint = m_constraints[i]; - constraint->BuildJacobian(); - constraint->SolveConstraint( timeStep ); + constraint->buildJacobian(); + constraint->solveConstraint( timeStep ); } @@ -752,7 +752,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) } #ifdef USE_QUICKPROF - btProfiler::endBlock("SolveConstraint"); + btProfiler::endBlock("solveConstraint"); #endif //USE_QUICKPROF //solve the vehicles @@ -764,7 +764,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) { WrapperVehicle* wrapperVehicle = m_wrapperVehicles[i]; btRaycastVehicle* vehicle = wrapperVehicle->GetVehicle(); - vehicle->UpdateVehicle( timeStep); + vehicle->updateVehicle( timeStep); } #endif //NEW_BULLET_VEHICLE_SUPPORT @@ -789,7 +789,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) virtual void ProcessIsland(btPersistentManifold** manifolds,int numManifolds) { - m_solver->SolveGroup( manifolds, numManifolds,m_solverInfo,m_debugDrawer); + m_solver->solveGroup( manifolds, numManifolds,m_solverInfo,m_debugDrawer); } }; @@ -806,14 +806,14 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) m_debugDrawer); #ifdef USE_QUICKPROF - btProfiler::beginBlock("BuildAndProcessIslands"); + btProfiler::beginBlock("buildAndProcessIslands"); #endif //USE_QUICKPROF /// solve all the contact points and contact friction - m_islandManager->BuildAndProcessIslands(GetCollisionWorld()->GetDispatcher(),m_collisionWorld->GetCollisionObjectArray(),&solverCallback); + m_islandManager->buildAndProcessIslands(getCollisionWorld()->getDispatcher(),m_collisionWorld->getCollisionObjectArray(),&solverCallback); #ifdef USE_QUICKPROF - btProfiler::endBlock("BuildAndProcessIslands"); + btProfiler::endBlock("buildAndProcessIslands"); btProfiler::beginBlock("CallbackTriggers"); #endif //USE_QUICKPROF @@ -849,8 +849,8 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) dispatchInfo.m_stepCount = 0; dispatchInfo.m_dispatchFunc = btDispatcherInfo::DISPATCH_CONTINUOUS; - //pairCache->RefreshOverlappingPairs();//?? - GetCollisionWorld()->GetDispatcher()->DispatchAllCollisionPairs(scene,dispatchInfo); + //pairCache->refreshOverlappingPairs();//?? + getCollisionWorld()->getDispatcher()->dispatchAllCollisionPairs(scene,dispatchInfo); toi = dispatchInfo.m_timeOfImpact; @@ -873,7 +873,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) CcdPhysicsController* ctrl = *i; btTransform predictedTrans; - btRigidBody* body = ctrl->GetRigidBody(); + btRigidBody* body = ctrl->getRigidBody(); if (body->IsActive()) { @@ -910,7 +910,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) !(i==m_controllers.end()); i++) { CcdPhysicsController* ctrl = (*i); - btRigidBody* body = ctrl->GetRigidBody(); + btRigidBody* body = ctrl->getRigidBody(); ctrl->UpdateDeactivation(timeStep); @@ -979,7 +979,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) void CcdPhysicsEnvironment::setDebugMode(int debugMode) { if (m_debugDrawer){ - m_debugDrawer->SetDebugMode(debugMode); + m_debugDrawer->setDebugMode(debugMode); } } @@ -1100,7 +1100,7 @@ void CcdPhysicsEnvironment::setGravity(float x,float y,float z) { CcdPhysicsController* ctrl = (*i); - ctrl->GetRigidBody()->setGravity(m_gravity); + ctrl->getRigidBody()->setGravity(m_gravity); } } @@ -1131,7 +1131,7 @@ public: btScalar m_distFraction; }; */ - virtual void* CastRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result) + virtual void* castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result) { @@ -1156,7 +1156,7 @@ public: //some safety for 'explosion' due to sudden penetration of the full 'ray' /* if (result.m_distFraction<0.1) { - printf("Vehicle Raycast: avoided instability due to penetration. Consider moving the connection points deeper inside vehicle chassis"); + printf("Vehicle rayCast: avoided instability due to penetration. Consider moving the connection points deeper inside vehicle chassis"); result.m_distFraction = 1.f; hitObject = 0; } @@ -1164,7 +1164,7 @@ public: /* if (result.m_distFraction>1.) { - printf("Vehicle Raycast: avoided instability 1Consider moving the connection points deeper inside vehicle chassis"); + printf("Vehicle rayCast: avoided instability 1Consider moving the connection points deeper inside vehicle chassis"); result.m_distFraction = 1.f; hitObject = 0; } @@ -1190,8 +1190,8 @@ int CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl CcdPhysicsController* c0 = (CcdPhysicsController*)ctrl0; CcdPhysicsController* c1 = (CcdPhysicsController*)ctrl1; - btRigidBody* rb0 = c0 ? c0->GetRigidBody() : 0; - btRigidBody* rb1 = c1 ? c1->GetRigidBody() : 0; + btRigidBody* rb0 = c0 ? c0->getRigidBody() : 0; + btRigidBody* rb1 = c1 ? c1->getRigidBody() : 0; ASSERT(rb0); @@ -1222,10 +1222,10 @@ int CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl } m_constraints.push_back(p2p); - p2p->SetUserConstraintId(gConstraintUid++); - p2p->SetUserConstraintType(type); + p2p->setUserConstraintId(gConstraintUid++); + p2p->setUserConstraintType(type); //64 bit systems can't cast pointer to int. could use size_t instead. - return p2p->GetUserConstraintId(); + return p2p->getUserConstraintId(); break; } @@ -1268,10 +1268,10 @@ int CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl m_constraints.push_back(genericConstraint); - genericConstraint->SetUserConstraintId(gConstraintUid++); - genericConstraint->SetUserConstraintType(type); + genericConstraint->setUserConstraintId(gConstraintUid++); + genericConstraint->setUserConstraintType(type); //64 bit systems can't cast pointer to int. could use size_t instead. - return genericConstraint->GetUserConstraintId(); + return genericConstraint->getUserConstraintId(); break; } @@ -1299,10 +1299,10 @@ int CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl hinge->setAngularOnly(angularOnly); m_constraints.push_back(hinge); - hinge->SetUserConstraintId(gConstraintUid++); - hinge->SetUserConstraintType(type); + hinge->setUserConstraintId(gConstraintUid++); + hinge->setUserConstraintType(type); //64 bit systems can't cast pointer to int. could use size_t instead. - return hinge->GetUserConstraintId(); + return hinge->getUserConstraintId(); break; } #ifdef NEW_BULLET_VEHICLE_SUPPORT @@ -1315,9 +1315,9 @@ int CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl btRaycastVehicle* vehicle = new btRaycastVehicle(*tuning,chassis,raycaster); WrapperVehicle* wrapperVehicle = new WrapperVehicle(vehicle,ctrl0); m_wrapperVehicles.push_back(wrapperVehicle); - vehicle->SetUserConstraintId(gConstraintUid++); - vehicle->SetUserConstraintType(type); - return vehicle->GetUserConstraintId(); + vehicle->setUserConstraintId(gConstraintUid++); + vehicle->setUserConstraintType(type); + return vehicle->getUserConstraintId(); break; }; @@ -1356,8 +1356,8 @@ int CcdPhysicsEnvironment::createUniversalD6Constraint( CcdPhysicsController* ctrl0 = (CcdPhysicsController*) ctrlRef; CcdPhysicsController* ctrl1 = (CcdPhysicsController*) ctrlOther; - btRigidBody* rb0 = ctrl0->GetRigidBody(); - btRigidBody* rb1 = ctrl1->GetRigidBody(); + btRigidBody* rb0 = ctrl0->getRigidBody(); + btRigidBody* rb1 = ctrl1->getRigidBody(); if (rb1) { @@ -1380,10 +1380,10 @@ int CcdPhysicsEnvironment::createUniversalD6Constraint( if (genericConstraint) { m_constraints.push_back(genericConstraint); - genericConstraint->SetUserConstraintId(gConstraintUid++); - genericConstraint->SetUserConstraintType(PHY_GENERIC_6DOF_CONSTRAINT); + genericConstraint->setUserConstraintId(gConstraintUid++); + genericConstraint->setUserConstraintType(PHY_GENERIC_6DOF_CONSTRAINT); //64 bit systems can't cast pointer to int. could use size_t instead. - return genericConstraint->GetUserConstraintId(); + return genericConstraint->getUserConstraintId(); } return 0; } @@ -1398,7 +1398,7 @@ void CcdPhysicsEnvironment::removeConstraint(int constraintId) !(i==m_constraints.end()); i++) { btTypedConstraint* constraint = (*i); - if (constraint->GetUserConstraintId() == constraintId) + if (constraint->getUserConstraintId() == constraintId) { std::swap(*i, m_constraints.back()); m_constraints.pop_back(); @@ -1454,7 +1454,7 @@ PHY_IPhysicsController* CcdPhysicsEnvironment::rayTest(PHY_IPhysicsController* i PHY_IPhysicsController* nearestHit = 0; - m_collisionWorld->RayTest(rayFrom,rayTo,rayCallback); + m_collisionWorld->rayTest(rayFrom,rayTo,rayCallback); if (rayCallback.HasHit()) { nearestHit = static_cast(rayCallback.m_collisionObject->m_internalOwner); @@ -1487,9 +1487,9 @@ void CcdPhysicsEnvironment::getContactPoint(int i,float& hitX,float& hitY,float& -btBroadphaseInterface* CcdPhysicsEnvironment::GetBroadphase() +btBroadphaseInterface* CcdPhysicsEnvironment::getBroadphase() { - return m_collisionWorld->GetBroadphase(); + return m_collisionWorld->getBroadphase(); } @@ -1537,7 +1537,7 @@ btTypedConstraint* CcdPhysicsEnvironment::getConstraintById(int constraintId) for (i=0;iGetUserConstraintId()==constraintId) + if (constraint->getUserConstraintId()==constraintId) { return constraint; } @@ -1621,28 +1621,28 @@ void CcdPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ctr void CcdPhysicsEnvironment::CallbackTriggers() { - if (m_triggerCallbacks[PHY_OBJECT_RESPONSE] || (m_debugDrawer && (m_debugDrawer->GetDebugMode() & btIDebugDraw::DBG_DrawContactPoints))) + if (m_triggerCallbacks[PHY_OBJECT_RESPONSE] || (m_debugDrawer && (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawContactPoints))) { //walk over all overlapping pairs, and if one of the involved bodies is registered for trigger callback, perform callback - int numManifolds = m_collisionWorld->GetDispatcher()->GetNumManifolds(); + int numManifolds = m_collisionWorld->getDispatcher()->getNumManifolds(); for (int i=0;iGetDispatcher()->GetManifoldByIndexInternal(i); - int numContacts = manifold->GetNumContacts(); + btPersistentManifold* manifold = m_collisionWorld->getDispatcher()->getManifoldByIndexInternal(i); + int numContacts = manifold->getNumContacts(); if (numContacts) { - if (m_debugDrawer && (m_debugDrawer->GetDebugMode() & btIDebugDraw::DBG_DrawContactPoints)) + if (m_debugDrawer && (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawContactPoints)) { for (int j=0;jGetContactPoint(j); + const btManifoldPoint& cp = manifold->getContactPoint(j); if (m_debugDrawer) - m_debugDrawer->DrawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.GetDistance(),cp.GetLifeTime(),color); + m_debugDrawer->drawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.getDistance(),cp.getLifeTime(),color); } } - btRigidBody* obj0 = static_cast(manifold->GetBody0()); - btRigidBody* obj1 = static_cast(manifold->GetBody1()); + btRigidBody* obj0 = static_cast(manifold->getBody0()); + btRigidBody* obj1 = static_cast(manifold->getBody1()); //m_internalOwner is set in 'addPhysicsController' CcdPhysicsController* ctrl0 = static_cast(obj0->m_internalOwner); @@ -1686,7 +1686,7 @@ PHY_IVehicle* CcdPhysicsEnvironment::getVehicleConstraint(int constraintId) for (i=0;iGetVehicle()->GetUserConstraintId() == constraintId) + if (wrapperVehicle->GetVehicle()->getUserConstraintId() == constraintId) return wrapperVehicle; } @@ -1703,7 +1703,7 @@ int numController = 0; void CcdPhysicsEnvironment::UpdateAabbs(float timeStep) { std::vector::iterator i; - btBroadphaseInterface* scene = GetBroadphase(); + btBroadphaseInterface* scene = getBroadphase(); numController = m_controllers.size(); currentController = 0; @@ -1716,15 +1716,15 @@ void CcdPhysicsEnvironment::UpdateAabbs(float timeStep) { currentController++; CcdPhysicsController* ctrl = (*i); - btRigidBody* body = ctrl->GetRigidBody(); + btRigidBody* body = ctrl->getRigidBody(); btPoint3 minAabb,maxAabb; - btCollisionShape* shapeinterface = ctrl->GetCollisionShape(); + btCollisionShape* shapeinterface = ctrl->getCollisionShape(); - shapeinterface->CalculateTemporalAabb(body->getCenterOfMassTransform(), + shapeinterface->calculateTemporalAabb(body->getCenterOfMassTransform(), body->getLinearVelocity(), //body->getAngularVelocity(), btVector3(0.f,0.f,0.f),//no angular effect for now //body->getAngularVelocity(), @@ -1767,7 +1767,7 @@ void CcdPhysicsEnvironment::UpdateAabbs(float timeStep) }; - if (m_debugDrawer->GetDebugMode() & btIDebugDraw::DBG_DrawAabb) + if (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawAabb) { DrawAabb(m_debugDrawer,minAabb,maxAabb,color); } @@ -1776,7 +1776,7 @@ void CcdPhysicsEnvironment::UpdateAabbs(float timeStep) if ( (maxAabb-minAabb).length2() < 1e12f) { - scene->SetAabb(bp,minAabb,maxAabb); + scene->setAabb(bp,minAabb,maxAabb); } else { //something went wrong, investigate @@ -1844,9 +1844,9 @@ float CcdPhysicsEnvironment::getAppliedImpulse(int constraintid) !(i==m_constraints.end()); i++) { btTypedConstraint* constraint = (*i); - if (constraint->GetUserConstraintId() == constraintid) + if (constraint->getUserConstraintId() == constraintid) { - return constraint->GetAppliedImpulse(); + return constraint->getAppliedImpulse(); } } return 0.f; diff --git a/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.h b/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.h index 740c6d1e4..be7f71e7b 100644 --- a/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.h +++ b/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.h @@ -183,7 +183,7 @@ protected: void removeCcdPhysicsController(CcdPhysicsController* ctrl); - btBroadphaseInterface* GetBroadphase(); + btBroadphaseInterface* getBroadphase(); @@ -207,29 +207,29 @@ protected: - const btPersistentManifold* GetManifold(int index) const; + const btPersistentManifold* getManifold(int index) const; std::vector m_constraints; void SyncMotionStates(float timeStep); - class btCollisionWorld* GetCollisionWorld() + class btCollisionWorld* getCollisionWorld() { return m_collisionWorld; } - const class btCollisionWorld* GetCollisionWorld() const + const class btCollisionWorld* getCollisionWorld() const { return m_collisionWorld; } - btSimulationIslandManager* GetSimulationIslandManager() + btSimulationIslandManager* getSimulationIslandManager() { return m_islandManager; } - const btSimulationIslandManager* GetSimulationIslandManager() const + const btSimulationIslandManager* getSimulationIslandManager() const { return m_islandManager; } diff --git a/Extras/PhysicsInterface/CcdPhysics/ParallelIslandDispatcher.cpp b/Extras/PhysicsInterface/CcdPhysics/ParallelIslandDispatcher.cpp index bb1a24542..b6231fae0 100644 --- a/Extras/PhysicsInterface/CcdPhysics/ParallelIslandDispatcher.cpp +++ b/Extras/PhysicsInterface/CcdPhysics/ParallelIslandDispatcher.cpp @@ -51,7 +51,7 @@ ParallelIslandDispatcher::ParallelIslandDispatcher (): }; -btPersistentManifold* ParallelIslandDispatcher::GetNewManifold(void* b0,void* b1) +btPersistentManifold* ParallelIslandDispatcher::getNewManifold(void* b0,void* b1) { gNumManifold2++; @@ -67,20 +67,20 @@ btPersistentManifold* ParallelIslandDispatcher::GetNewManifold(void* b0,void* b1 return manifold; } -void ParallelIslandDispatcher::ClearManifold(btPersistentManifold* manifold) +void ParallelIslandDispatcher::clearManifold(btPersistentManifold* manifold) { - manifold->ClearManifold(); + manifold->clearManifold(); } -void ParallelIslandDispatcher::ReleaseManifold(btPersistentManifold* manifold) +void ParallelIslandDispatcher::releaseManifold(btPersistentManifold* manifold) { gNumManifold2--; - //printf("ReleaseManifold: gNumManifold2 %d\n",gNumManifold2); + //printf("releaseManifold: gNumManifold2 %d\n",gNumManifold2); - ClearManifold(manifold); + clearManifold(manifold); std::vector::iterator i = std::find(m_manifoldsPtr.begin(), m_manifoldsPtr.end(), manifold); @@ -99,7 +99,7 @@ void ParallelIslandDispatcher::ReleaseManifold(btPersistentManifold* manifold) // // todo: this is random access, it can be walked 'cache friendly'! // -void ParallelIslandDispatcher::BuildAndProcessIslands(btCollisionObjectArray& collisionObjects, IslandCallback* callback) +void ParallelIslandDispatcher::buildAndProcessIslands(btCollisionObjectArray& collisionObjects, IslandCallback* callback) { int numBodies = collisionObjects.size(); @@ -130,20 +130,20 @@ void ParallelIslandDispatcher::BuildAndProcessIslands(btCollisionObjectArray& co } - for (i=0;iGetManifoldByIndexInternal(i); + btPersistentManifold* manifold = this->getManifoldByIndexInternal(i); //filtering for response - btCollisionObject* colObj0 = static_cast(manifold->GetBody0()); - btCollisionObject* colObj1 = static_cast(manifold->GetBody1()); + btCollisionObject* colObj0 = static_cast(manifold->getBody0()); + btCollisionObject* colObj1 = static_cast(manifold->getBody1()); { if (((colObj0) && (colObj0)->m_islandTag1 == (islandId)) || ((colObj1) && (colObj1)->m_islandTag1 == (islandId))) { - if (NeedsResponse(*colObj0,*colObj1)) + if (needsResponse(*colObj0,*colObj1)) islandmanifold.push_back(manifold); } } @@ -189,7 +189,7 @@ void ParallelIslandDispatcher::BuildAndProcessIslands(btCollisionObjectArray& co -btCollisionAlgorithm* ParallelIslandDispatcher::InternalFindAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) +btCollisionAlgorithm* ParallelIslandDispatcher::internalFindAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) { m_count++; btCollisionObject* body0 = (btCollisionObject*)proxy0.m_clientObject; @@ -198,27 +198,27 @@ btCollisionAlgorithm* ParallelIslandDispatcher::InternalFindAlgorithm(btBroadpha btCollisionAlgorithmConstructionInfo ci; ci.m_dispatcher = this; - if (body0->m_collisionShape->IsConvex() && body1->m_collisionShape->IsConvex() ) + if (body0->m_collisionShape->isConvex() && body1->m_collisionShape->isConvex() ) { return new btConvexConvexAlgorithm(0,ci,&proxy0,&proxy1); } - if (body0->m_collisionShape->IsConvex() && body1->m_collisionShape->IsConcave()) + if (body0->m_collisionShape->isConvex() && body1->m_collisionShape->isConcave()) { return new btConvexConcaveCollisionAlgorithm(ci,&proxy0,&proxy1); } - if (body1->m_collisionShape->IsConvex() && body0->m_collisionShape->IsConcave()) + if (body1->m_collisionShape->isConvex() && body0->m_collisionShape->isConcave()) { return new btConvexConcaveCollisionAlgorithm(ci,&proxy1,&proxy0); } - if (body0->m_collisionShape->IsCompound()) + if (body0->m_collisionShape->isCompound()) { return new btCompoundCollisionAlgorithm(ci,&proxy0,&proxy1); } else { - if (body1->m_collisionShape->IsCompound()) + if (body1->m_collisionShape->isCompound()) { return new btCompoundCollisionAlgorithm(ci,&proxy1,&proxy0); } @@ -230,7 +230,7 @@ btCollisionAlgorithm* ParallelIslandDispatcher::InternalFindAlgorithm(btBroadpha } -bool ParallelIslandDispatcher::NeedsResponse(const btCollisionObject& colObj0,const btCollisionObject& colObj1) +bool ParallelIslandDispatcher::needsResponse(const btCollisionObject& colObj0,const btCollisionObject& colObj1) { @@ -243,7 +243,7 @@ bool ParallelIslandDispatcher::NeedsResponse(const btCollisionObject& colObj0,c return hasResponse; } -bool ParallelIslandDispatcher::NeedsCollision(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) +bool ParallelIslandDispatcher::needsCollision(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) { btCollisionObject* body0 = (btCollisionObject*)proxy0.m_clientObject; @@ -266,7 +266,7 @@ bool ParallelIslandDispatcher::NeedsCollision(btBroadphaseProxy& proxy0,btBroadp } ///allows the user to get contact point callbacks -btManifoldResult* ParallelIslandDispatcher::GetNewManifoldResult(btCollisionObject* obj0,btCollisionObject* obj1,btPersistentManifold* manifold) +btManifoldResult* ParallelIslandDispatcher::getNewManifoldResult(btCollisionObject* obj0,btCollisionObject* obj1,btPersistentManifold* manifold) { @@ -276,13 +276,13 @@ btManifoldResult* ParallelIslandDispatcher::GetNewManifoldResult(btCollisionObje } ///allows the user to get contact point callbacks -void ParallelIslandDispatcher::ReleaseManifoldResult(btManifoldResult*) +void ParallelIslandDispatcher::releaseManifoldResult(btManifoldResult*) { } -void ParallelIslandDispatcher::DispatchAllCollisionPairs(btOverlappingPairCache* pairCache,btDispatcherInfo& dispatchInfo) +void ParallelIslandDispatcher::dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,btDispatcherInfo& dispatchInfo) { //m_blockedForChanges = true; @@ -291,7 +291,7 @@ void ParallelIslandDispatcher::DispatchAllCollisionPairs(btOverlappingPairCache* assert(0); /* - int dispatcherId = GetUniqueId(); + int dispatcherId = getUniqueId(); int i; for (i=0;iProcessCollision(pair.m_pProxy0,pair.m_pProxy1,dispatchInfo); + pair.m_algorithms[dispatcherId]->processCollision(pair.m_pProxy0,pair.m_pProxy1,dispatchInfo); } else { - float toi = pair.m_algorithms[dispatcherId]->CalculateTimeOfImpact(pair.m_pProxy0,pair.m_pProxy1,dispatchInfo); + float toi = pair.m_algorithms[dispatcherId]->calculateTimeOfImpact(pair.m_pProxy0,pair.m_pProxy1,dispatchInfo); if (dispatchInfo.m_timeOfImpact > toi) dispatchInfo.m_timeOfImpact = toi; @@ -324,7 +324,7 @@ void ParallelIslandDispatcher::DispatchAllCollisionPairs(btOverlappingPairCache* } else { //non-persistent algorithm dispatcher - btCollisionAlgorithm* algo = FindAlgorithm( + btCollisionAlgorithm* algo = findAlgorithm( *pair.m_pProxy0, *pair.m_pProxy1); @@ -332,10 +332,10 @@ void ParallelIslandDispatcher::DispatchAllCollisionPairs(btOverlappingPairCache* { if (dispatchInfo.m_dispatchFunc == btDispatcherInfo::DISPATCH_DISCRETE) { - algo->ProcessCollision(pair.m_pProxy0,pair.m_pProxy1,dispatchInfo); + algo->processCollision(pair.m_pProxy0,pair.m_pProxy1,dispatchInfo); } else { - float toi = algo->CalculateTimeOfImpact(pair.m_pProxy0,pair.m_pProxy1,dispatchInfo); + float toi = algo->calculateTimeOfImpact(pair.m_pProxy0,pair.m_pProxy1,dispatchInfo); if (dispatchInfo.m_timeOfImpact > toi) dispatchInfo.m_timeOfImpact = toi; } diff --git a/Extras/PhysicsInterface/CcdPhysics/ParallelIslandDispatcher.h b/Extras/PhysicsInterface/CcdPhysics/ParallelIslandDispatcher.h index 36f888438..f6dd79668 100644 --- a/Extras/PhysicsInterface/CcdPhysics/ParallelIslandDispatcher.h +++ b/Extras/PhysicsInterface/CcdPhysics/ParallelIslandDispatcher.h @@ -50,7 +50,7 @@ class ParallelIslandDispatcher : public btDispatcher public: - btUnionFind& GetUnionFind() { return m_unionFind;} + btUnionFind& getUnionFind() { return m_unionFind;} struct IslandCallback { @@ -60,65 +60,65 @@ public: }; - int GetNumManifolds() const + int getNumManifolds() const { return m_manifoldsPtr.size(); } - btPersistentManifold* GetManifoldByIndexInternal(int index) + btPersistentManifold* getManifoldByIndexInternal(int index) { return m_manifoldsPtr[index]; } - const btPersistentManifold* GetManifoldByIndexInternal(int index) const + const btPersistentManifold* getManifoldByIndexInternal(int index) const { return m_manifoldsPtr[index]; } - void InitUnionFind(int n) + void initUnionFind(int n) { if (m_useIslands) m_unionFind.reset(n); } - void FindUnions(); + void findUnions(); int m_count; ParallelIslandDispatcher (); virtual ~ParallelIslandDispatcher() {}; - virtual btPersistentManifold* GetNewManifold(void* b0,void* b1); + virtual btPersistentManifold* getNewManifold(void* b0,void* b1); - virtual void ReleaseManifold(btPersistentManifold* manifold); + virtual void releaseManifold(btPersistentManifold* manifold); - virtual void BuildAndProcessIslands(btCollisionObjectArray& collisionObjects, IslandCallback* callback); + virtual void buildAndProcessIslands(btCollisionObjectArray& collisionObjects, IslandCallback* callback); ///allows the user to get contact point callbacks - virtual btManifoldResult* GetNewManifoldResult(btCollisionObject* obj0,btCollisionObject* obj1,btPersistentManifold* manifold); + virtual btManifoldResult* getNewManifoldResult(btCollisionObject* obj0,btCollisionObject* obj1,btPersistentManifold* manifold); ///allows the user to get contact point callbacks - virtual void ReleaseManifoldResult(btManifoldResult*); + virtual void releaseManifoldResult(btManifoldResult*); - virtual void ClearManifold(btPersistentManifold* manifold); + virtual void clearManifold(btPersistentManifold* manifold); - btCollisionAlgorithm* FindAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) + btCollisionAlgorithm* findAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) { - btCollisionAlgorithm* algo = InternalFindAlgorithm(proxy0,proxy1); + btCollisionAlgorithm* algo = internalFindAlgorithm(proxy0,proxy1); return algo; } - btCollisionAlgorithm* InternalFindAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1); + btCollisionAlgorithm* internalFindAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1); - virtual bool NeedsCollision(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1); + virtual bool needsCollision(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1); - virtual bool NeedsResponse(const btCollisionObject& colObj0,const btCollisionObject& colObj1); + virtual bool needsResponse(const btCollisionObject& colObj0,const btCollisionObject& colObj1); - virtual int GetUniqueId() { return RIGIDBODY_DISPATCHER;} + virtual int getUniqueId() { return RIGIDBODY_DISPATCHER;} - virtual void DispatchAllCollisionPairs(btOverlappingPairCache* pairCache,btDispatcherInfo& dispatchInfo); + virtual void dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,btDispatcherInfo& dispatchInfo); diff --git a/Extras/PhysicsInterface/CcdPhysics/ParallelPhysicsEnvironment.cpp b/Extras/PhysicsInterface/CcdPhysics/ParallelPhysicsEnvironment.cpp index 67748a266..493eec20f 100644 --- a/Extras/PhysicsInterface/CcdPhysics/ParallelPhysicsEnvironment.cpp +++ b/Extras/PhysicsInterface/CcdPhysics/ParallelPhysicsEnvironment.cpp @@ -41,8 +41,8 @@ ParallelPhysicsEnvironment::~ParallelPhysicsEnvironment() bool ParallelPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) { // Make sure the broadphase / overlapping AABB paircache is up-to-date - btOverlappingPairCache* scene = m_collisionWorld->GetPairCache(); - scene->RefreshOverlappingPairs(); + btOverlappingPairCache* scene = m_collisionWorld->getPairCache(); + scene->refreshOverlappingPairs(); // Find the connected sets that can be simulated in parallel // Using union find @@ -51,7 +51,7 @@ bool ParallelPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) btProfiler::beginBlock("IslandUnionFind"); #endif //USE_QUICKPROF - GetSimulationIslandManager()->UpdateActivationState(GetCollisionWorld(),GetCollisionWorld()->GetDispatcher()); + getSimulationIslandManager()->updateActivationState(getCollisionWorld(),getCollisionWorld()->getDispatcher()); { int i; @@ -60,8 +60,8 @@ bool ParallelPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) { btTypedConstraint* constraint = m_constraints[i]; - const btRigidBody* colObj0 = &constraint->GetRigidBodyA(); - const btRigidBody* colObj1 = &constraint->GetRigidBodyB(); + const btRigidBody* colObj0 = &constraint->getRigidBodyA(); + const btRigidBody* colObj1 = &constraint->getRigidBodyB(); if (((colObj0) && ((colObj0)->mergesSimulationIslands())) && ((colObj1) && ((colObj1)->mergesSimulationIslands()))) @@ -69,7 +69,7 @@ bool ParallelPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) if (colObj0->IsActive() || colObj1->IsActive()) { - GetSimulationIslandManager()->GetUnionFind().unite((colObj0)->m_islandTag1, + getSimulationIslandManager()->getUnionFind().unite((colObj0)->m_islandTag1, (colObj1)->m_islandTag1); } } @@ -77,7 +77,7 @@ bool ParallelPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) } //Store the island id in each body - GetSimulationIslandManager()->StoreIslandActivationState(GetCollisionWorld()); + getSimulationIslandManager()->storeIslandActivationState(getCollisionWorld()); #ifdef USE_QUICKPROF btProfiler::endBlock("IslandUnionFind"); @@ -98,14 +98,14 @@ bool ParallelPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) for (k=0;kGetRigidBody()->m_islandTag1; + int tag = ctrl->getRigidBody()->m_islandTag1; if (tag>=0) { simulationIslands[tag].m_controllers.push_back(ctrl); } } - btDispatcher* dispatcher = GetCollisionWorld()->GetDispatcher(); + btDispatcher* dispatcher = getCollisionWorld()->getDispatcher(); //this is a brute force approach, will rethink later about more subtle ways @@ -137,32 +137,32 @@ bool ParallelPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) for (unsigned int ui=0;ui constraint.GetRigidBodyB().m_islandTag1) + if (constraint.getRigidBodyA().m_islandTag1 > constraint.getRigidBodyB().m_islandTag1) { - simulationIslands[constraint.GetRigidBodyA().m_islandTag1].m_constraintIndices.push_back(ui); + simulationIslands[constraint.getRigidBodyA().m_islandTag1].m_constraintIndices.push_back(ui); } else { - simulationIslands[constraint.GetRigidBodyB().m_islandTag1].m_constraintIndices.push_back(ui); + simulationIslands[constraint.getRigidBodyB().m_islandTag1].m_constraintIndices.push_back(ui); } } //add all overlapping pairs for each island - for (i=0;iGetNumManifolds();i++) + for (i=0;igetNumManifolds();i++) { - btPersistentManifold* manifold = dispatcher->GetManifoldByIndexInternal(i); + btPersistentManifold* manifold = dispatcher->getManifoldByIndexInternal(i); //filtering for response - btCollisionObject* colObj0 = static_cast(manifold->GetBody0()); - btCollisionObject* colObj1 = static_cast(manifold->GetBody1()); + btCollisionObject* colObj0 = static_cast(manifold->getBody0()); + btCollisionObject* colObj1 = static_cast(manifold->getBody1()); { int islandTag = colObj0->m_islandTag1; if (colObj1->m_islandTag1 > islandTag) islandTag = colObj1->m_islandTag1; - if (dispatcher->NeedsResponse(*colObj0,*colObj1)) + if (dispatcher->needsResponse(*colObj0,*colObj1)) simulationIslands[islandTag].m_manifolds.push_back(manifold); } @@ -191,7 +191,7 @@ bool ParallelPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) if (simulationIslands[k].m_controllers.size()) { assert(0);//seems to be wrong, passing ALL overlapping pairs - simulationIslands[k].Simulate(m_debugDrawer,m_numIterations, constraintBase ,&scene->GetOverlappingPair(0),dispatcher,GetBroadphase(),m_solver,timeStep); + simulationIslands[k].Simulate(m_debugDrawer,m_numIterations, constraintBase ,&scene->GetOverlappingPair(0),dispatcher,getBroadphase(),m_solver,timeStep); } } */ diff --git a/Extras/PhysicsInterface/CcdPhysics/SimulationIsland.cpp b/Extras/PhysicsInterface/CcdPhysics/SimulationIsland.cpp index 420470bbf..00b9e2e1a 100644 --- a/Extras/PhysicsInterface/CcdPhysics/SimulationIsland.cpp +++ b/Extras/PhysicsInterface/CcdPhysics/SimulationIsland.cpp @@ -45,7 +45,7 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration { CcdPhysicsController* ctrl = m_controllers[k]; // btTransform predictedTrans; - btRigidBody* body = ctrl->GetRigidBody(); + btRigidBody* body = ctrl->getRigidBody(); //todo: only do this when necessary, it's used for contact points body->m_cachedInvertedWorldTransform = body->m_worldTransform.inverse(); @@ -66,7 +66,7 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration btProfiler::endBlock("predictIntegratedTransform"); #endif //USE_QUICKPROF - //BroadphaseInterface* scene = GetBroadphase(); + //BroadphaseInterface* scene = getBroadphase(); // @@ -75,7 +75,7 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration #ifdef USE_QUICKPROF - btProfiler::beginBlock("DispatchAllCollisionPairs"); + btProfiler::beginBlock("dispatchAllCollisionPairs"); #endif //USE_QUICKPROF @@ -99,11 +99,11 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration } - //pairCache->RefreshOverlappingPairs(); + //pairCache->refreshOverlappingPairs(); if (overlappingPairs.size()) { assert(0); - //dispatcher->DispatchAllCollisionPairs(&overlappingPairs[0],overlappingPairs.size(),dispatchInfo);///numsubstep,g); + //dispatcher->dispatchAllCollisionPairs(&overlappingPairs[0],overlappingPairs.size(),dispatchInfo);///numsubstep,g); } //scatter overlapping pair info, mainly the created algorithms/contact caches @@ -115,13 +115,13 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration #ifdef USE_QUICKPROF - btProfiler::endBlock("DispatchAllCollisionPairs"); + btProfiler::endBlock("dispatchAllCollisionPairs"); #endif //USE_QUICKPROF //contacts #ifdef USE_QUICKPROF - btProfiler::beginBlock("SolveConstraint"); + btProfiler::beginBlock("solveConstraint"); #endif //USE_QUICKPROF @@ -140,8 +140,8 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration for (i=0;i< numConstraints ; i++ ) { btTypedConstraint* constraint = constraintsBaseAddress[m_constraintIndices[i]]; - constraint->BuildJacobian(); - constraint->SolveConstraint( timeStep ); + constraint->buildJacobian(); + constraint->solveConstraint( timeStep ); } @@ -149,7 +149,7 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration } #ifdef USE_QUICKPROF - btProfiler::endBlock("SolveConstraint"); + btProfiler::endBlock("solveConstraint"); #endif //USE_QUICKPROF /* @@ -163,7 +163,7 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration { WrapperVehicle* wrapperVehicle = m_wrapperVehicles[i]; btRaycastVehicle* vehicle = wrapperVehicle->GetVehicle(); - vehicle->UpdateVehicle( timeStep); + vehicle->updateVehicle( timeStep); } #endif //NEW_BULLET_VEHICLE_SUPPORT */ @@ -181,7 +181,7 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration } */ - //OverlappingPairCache* scene = GetCollisionWorld()->GetPairCache(); + //OverlappingPairCache* scene = getCollisionWorld()->getPairCache(); btContactSolverInfo solverInfo; @@ -193,7 +193,7 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration if (m_manifolds.size()) { - solver->SolveGroup( &m_manifolds[0],m_manifolds.size(),solverInfo,0); + solver->solveGroup( &m_manifolds[0],m_manifolds.size(),solverInfo,0); } @@ -221,7 +221,7 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration dispatchInfo.m_stepCount = 0; dispatchInfo.m_dispatchFunc = btDispatcherInfo::DISPATCH_CONTINUOUS; - // GetCollisionWorld()->GetDispatcher()->DispatchAllCollisionPairs(scene,dispatchInfo); + // getCollisionWorld()->getDispatcher()->dispatchAllCollisionPairs(scene,dispatchInfo); toi = dispatchInfo.m_timeOfImpact; } @@ -244,7 +244,7 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration CcdPhysicsController* ctrl = *i; btTransform predictedTrans; - btRigidBody* body = ctrl->GetRigidBody(); + btRigidBody* body = ctrl->getRigidBody(); if (body->IsActive()) { @@ -276,7 +276,7 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration !(i==m_controllers.end()); i++) { CcdPhysicsController* ctrl = (*i); - btRigidBody* body = ctrl->GetRigidBody(); + btRigidBody* body = ctrl->getRigidBody(); ctrl->UpdateDeactivation(timeStep); @@ -375,15 +375,15 @@ void SimulationIsland::UpdateAabbs(btIDebugDraw* debugDrawer,btBroadphaseInterfa !(i==m_controllers.end()); i++) { CcdPhysicsController* ctrl = (*i); - btRigidBody* body = ctrl->GetRigidBody(); + btRigidBody* body = ctrl->getRigidBody(); btPoint3 minAabb,maxAabb; - btCollisionShape* shapeinterface = ctrl->GetCollisionShape(); + btCollisionShape* shapeinterface = ctrl->getCollisionShape(); - shapeinterface->CalculateTemporalAabb(body->getCenterOfMassTransform(), + shapeinterface->calculateTemporalAabb(body->getCenterOfMassTransform(), body->getLinearVelocity(), //body->getAngularVelocity(), btVector3(0.f,0.f,0.f),//no angular effect for now //body->getAngularVelocity(), @@ -428,7 +428,7 @@ void SimulationIsland::UpdateAabbs(btIDebugDraw* debugDrawer,btBroadphaseInterfa }; - if (m_debugDrawer->GetDebugMode() & btIDebugDraw::DBG_DrawAabb) + if (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawAabb) { DrawAabb(m_debugDrawer,minAabb,maxAabb,color); } @@ -438,7 +438,7 @@ void SimulationIsland::UpdateAabbs(btIDebugDraw* debugDrawer,btBroadphaseInterfa if ( (maxAabb-minAabb).length2() < 1e12f) { - scene->SetAabb(bp,minAabb,maxAabb); + scene->setAabb(bp,minAabb,maxAabb); } else { //something went wrong, investigate diff --git a/Extras/PhysicsInterface/Common/PHY_IPhysicsController.h b/Extras/PhysicsInterface/Common/PHY_IPhysicsController.h index 822cf4e7f..73926e226 100644 --- a/Extras/PhysicsInterface/Common/PHY_IPhysicsController.h +++ b/Extras/PhysicsInterface/Common/PHY_IPhysicsController.h @@ -77,9 +77,9 @@ class PHY_IPhysicsController virtual PHY_IPhysicsController* GetReplica() {return 0;} virtual void calcXform() =0; - virtual void SetMargin(float margin) =0; - virtual float GetMargin() const=0; - virtual float GetRadius() const { return 0.f;} + virtual void setMargin(float margin) =0; + virtual float getMargin() const=0; + virtual float getRadius() const { return 0.f;} PHY__Vector3 GetWorldPosition(PHY__Vector3& localpos); }; diff --git a/Extras/PhysicsInterface/Common/PHY_IVehicle.h b/Extras/PhysicsInterface/Common/PHY_IVehicle.h index 58694b77b..954066a1f 100644 --- a/Extras/PhysicsInterface/Common/PHY_IVehicle.h +++ b/Extras/PhysicsInterface/Common/PHY_IVehicle.h @@ -27,7 +27,7 @@ public: virtual ~PHY_IVehicle(); - virtual void AddWheel( + virtual void addWheel( PHY_IMotionState* motionState, PHY__Vector3 connectionPoint, PHY__Vector3 downDirection, @@ -38,20 +38,20 @@ public: ) = 0; - virtual int GetNumWheels() const = 0; + virtual int getNumWheels() const = 0; virtual void GetWheelPosition(int wheelIndex,float& posX,float& posY,float& posZ) const = 0; virtual void GetWheelOrientationQuaternion(int wheelIndex,float& quatX,float& quatY,float& quatZ,float& quatW) const = 0; virtual float GetWheelRotation(int wheelIndex) const = 0; - virtual int GetUserConstraintId() const =0; - virtual int GetUserConstraintType() const =0; + virtual int getUserConstraintId() const =0; + virtual int getUserConstraintType() const =0; //some basic steering/braking/tuning/balancing (bikes) - virtual void SetSteeringValue(float steering,int wheelIndex) = 0; + virtual void setSteeringValue(float steering,int wheelIndex) = 0; - virtual void ApplyEngineForce(float force,int wheelIndex) = 0; + virtual void applyEngineForce(float force,int wheelIndex) = 0; virtual void ApplyBraking(float braking,int wheelIndex) = 0; @@ -65,7 +65,7 @@ public: virtual void SetRollInfluence(float rollInfluence,int wheelIndex) = 0; - virtual void SetCoordinateSystem(int rightIndex,int upIndex,int forwardIndex) =0; + virtual void setCoordinateSystem(int rightIndex,int upIndex,int forwardIndex) =0; }; diff --git a/Extras/SATConvexCollision/Geometry.h b/Extras/SATConvexCollision/Geometry.h index db551e436..dee61e2ed 100644 --- a/Extras/SATConvexCollision/Geometry.h +++ b/Extras/SATConvexCollision/Geometry.h @@ -110,7 +110,7 @@ public: // element access const Vector3 GetNormal() const; - const Scalar GetDistance() const; + const Scalar getDistance() const; // transformations friend const Plane operator-(const Plane& p); diff --git a/Extras/SATConvexCollision/Hull.cpp b/Extras/SATConvexCollision/Hull.cpp index d310b7dc5..68fbd8eff 100644 --- a/Extras/SATConvexCollision/Hull.cpp +++ b/Extras/SATConvexCollision/Hull.cpp @@ -49,10 +49,10 @@ Point3 Hull::GetFaceCentroid(short face) const short edge; edge = GetFaceFirstEdge(face); - Vector3 c = Vector3(GetVertex(GetEdgeVertex0(face, edge))); + Vector3 c = Vector3(getVertex(GetEdgeVertex0(face, edge))); for (edge = GetFaceNextEdge(face, edge); edge >= 0; edge = GetFaceNextEdge(face, edge)) - c += Vector3(GetVertex(GetEdgeVertex0(face, edge))); + c += Vector3(getVertex(GetEdgeVertex0(face, edge))); c /= Scalar(GetFace(face).m_numEdges); @@ -767,8 +767,8 @@ int Hull::AddContactsHullHull(btSeparation& sep, const Point3* pVertsA, const Po // edge->edge contact is always a single point if (sep.m_separator == btSeparation::kFeatureBoth) { - const Hull::Edge& edgeA = hullA.GetEdge(sep.m_featureA); - const Hull::Edge& edgeB = hullB.GetEdge(sep.m_featureB); + const Hull::Edge& edgeA = hullA.getEdge(sep.m_featureA); + const Hull::Edge& edgeB = hullB.getEdge(sep.m_featureB); float ta, tb; Line la(pVertsA[edgeA.m_verts[0]], pVertsA[edgeA.m_verts[1]]); @@ -801,13 +801,13 @@ int Hull::AddContactsHullHull(btSeparation& sep, const Point3* pVertsA, const Po // TODO: avoid having to transform planes here if (sep.m_separator == btSeparation::kFeatureB) { - const Hull::Edge& edgeB = hullB.GetEdge(hullB.GetFaceFirstEdge(faceB)); + const Hull::Edge& edgeB = hullB.getEdge(hullB.GetFaceFirstEdge(faceB)); tangent = Normalize(pVertsB[edgeB.m_verts[1]] - pVertsB[edgeB.m_verts[0]]); Scalar dmin = Scalar::Consts::MaxValue; for (short face = 0; face < hullA.m_numFaces; face++) { - Vector3 normal = hullA.GetPlane(face).GetNormal() * trA; + Vector3 normal = hullA.getPlane(face).GetNormal() * trA; Scalar d = Dot(normal, sep.m_axis); if (d < dmin) { @@ -818,13 +818,13 @@ int Hull::AddContactsHullHull(btSeparation& sep, const Point3* pVertsA, const Po } else { - const Hull::Edge& edgeA = hullA.GetEdge(hullA.GetFaceFirstEdge(faceA)); + const Hull::Edge& edgeA = hullA.getEdge(hullA.GetFaceFirstEdge(faceA)); tangent = Normalize(pVertsA[edgeA.m_verts[1]] - pVertsA[edgeA.m_verts[0]]); Scalar dmin = Scalar::Consts::MaxValue; for (short face = 0; face < hullB.m_numFaces; face++) { - Vector3 normal = hullB.GetPlane(face).GetNormal() * trB; + Vector3 normal = hullB.getPlane(face).GetNormal() * trB; Scalar d = Dot(normal, -sep.m_axis); if (d < dmin) { @@ -848,19 +848,19 @@ int Hull::AddContactsHullHull(btSeparation& sep, const Point3* pVertsA, const Po #if 0 for (short edge = hullA.GetFaceFirstEdge(faceA); edge != -1; edge = hullA.GetFaceNextEdge(faceA, edge)) { - Plane planeA = hullA.GetPlane( hullA.GetEdgeOtherFace(edge, faceA) ) * trA; + Plane planeA = hullA.getPlane( hullA.GetEdgeOtherFace(edge, faceA) ) * trA; numContacts = ClipFace(numContacts, &pVtxIn, &pVtxOut, planeA); } #else for (short f = 0; f < hullA.GetNumFaces(); f++) { - Plane planeA = hullA.GetPlane(f) * trA; + Plane planeA = hullA.getPlane(f) * trA; numContacts = ClipFace(numContacts, &pVtxIn, &pVtxOut, planeA); } #endif // only keep points that are behind the witness face - Plane planeA = hullA.GetPlane(faceA) * trA; + Plane planeA = hullA.getPlane(faceA) * trA; float depths[Hull::kMaxVerts]; int numPoints = 0; @@ -1002,11 +1002,11 @@ bool Hull::GetSeparationHullHull(btSeparation& sep, const Point3* pVertsA, const for (short ea = hullA.GetFaceFirstEdge(faceA); ea != -1; ea = hullA.GetFaceNextEdge(faceA, ea)) { - const Hull::Edge& edgeA = hullA.GetEdge(ea); + const Hull::Edge& edgeA = hullA.getEdge(ea); for (short eb = hullB.GetFaceFirstEdge(faceB); eb != -1; eb = hullB.GetFaceNextEdge(faceB, eb)) { - const Hull::Edge& edgeB = hullB.GetEdge(eb); + const Hull::Edge& edgeB = hullB.getEdge(eb); Vector3 va = pVertsA[edgeA.m_verts[1]] - pVertsA[edgeA.m_verts[0]]; Vector3 vb = pVertsB[edgeB.m_verts[1]] - pVertsB[edgeB.m_verts[0]]; diff --git a/Extras/SATConvexCollision/Hull.h b/Extras/SATConvexCollision/Hull.h index 55bd184b2..8e02160de 100644 --- a/Extras/SATConvexCollision/Hull.h +++ b/Extras/SATConvexCollision/Hull.h @@ -119,14 +119,14 @@ public: // ObjectType GetObjectType() const {return kTypeHull;} - short GetNumVertices() const; + short getNumVertices() const; short GetNumFaces() const; - short GetNumEdges() const; + short getNumEdges() const; - const Point3& GetVertex(short index) const; + const Point3& getVertex(short index) const; const Face& GetFace(short index) const; - const Edge& GetEdge(short index) const; - const Plane& GetPlane(short index) const; + const Edge& getEdge(short index) const; + const Plane& getPlane(short index) const; short GetFaceFirstEdge(short face) const; short GetFaceNextEdge(short face, short prevEdge) const; diff --git a/Extras/quickstep/OdeConstraintSolver.cpp b/Extras/quickstep/OdeConstraintSolver.cpp index 5cc76c1d4..cdcf67436 100644 --- a/Extras/quickstep/OdeConstraintSolver.cpp +++ b/Extras/quickstep/OdeConstraintSolver.cpp @@ -69,7 +69,7 @@ m_erp(0.4f) //iterative lcp and penalty method -float OdeConstraintSolver::SolveGroup(btPersistentManifold** manifoldPtr, int numManifolds,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer) +float OdeConstraintSolver::solveGroup(btPersistentManifold** manifoldPtr, int numManifolds,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer) { m_CurBody = 0; m_CurJoint = 0; @@ -87,10 +87,10 @@ float OdeConstraintSolver::SolveGroup(btPersistentManifold** manifoldPtr, int nu int body0=-1,body1=-1; btPersistentManifold* manifold = manifoldPtr[j]; - if (manifold->GetNumContacts() > 0) + if (manifold->getNumContacts() > 0) { - body0 = ConvertBody((btRigidBody*)manifold->GetBody0(),bodies,numBodies); - body1 = ConvertBody((btRigidBody*)manifold->GetBody1(),bodies,numBodies); + body0 = ConvertBody((btRigidBody*)manifold->getBody0(),bodies,numBodies); + body1 = ConvertBody((btRigidBody*)manifold->getBody1(),bodies,numBodies); ConvertConstraint(manifold,joints,numJoints,bodies,body0,body1,debugDrawer); } } @@ -199,12 +199,12 @@ void OdeConstraintSolver::ConvertConstraint(btPersistentManifold* manifold,BU_Jo { - manifold->RefreshContactPoints(((btRigidBody*)manifold->GetBody0())->getCenterOfMassTransform(), - ((btRigidBody*)manifold->GetBody1())->getCenterOfMassTransform()); + manifold->refreshContactPoints(((btRigidBody*)manifold->getBody0())->getCenterOfMassTransform(), + ((btRigidBody*)manifold->getBody1())->getCenterOfMassTransform()); int bodyId0 = _bodyId0,bodyId1 = _bodyId1; - int i,numContacts = manifold->GetNumContacts(); + int i,numContacts = manifold->getNumContacts(); bool swapBodies = (bodyId0 < 0); @@ -216,13 +216,13 @@ void OdeConstraintSolver::ConvertConstraint(btPersistentManifold* manifold,BU_Jo bodyId0 = _bodyId1; bodyId1 = _bodyId0; - body0 = (btRigidBody*)manifold->GetBody1(); - body1 = (btRigidBody*)manifold->GetBody0(); + body0 = (btRigidBody*)manifold->getBody1(); + body1 = (btRigidBody*)manifold->getBody0(); } else { - body0 = (btRigidBody*)manifold->GetBody0(); - body1 = (btRigidBody*)manifold->GetBody1(); + body0 = (btRigidBody*)manifold->getBody0(); + body1 = (btRigidBody*)manifold->getBody1(); } assert(bodyId0 >= 0); @@ -233,19 +233,19 @@ void OdeConstraintSolver::ConvertConstraint(btPersistentManifold* manifold,BU_Jo if (debugDrawer) { - const btManifoldPoint& cp = manifold->GetContactPoint(i); + const btManifoldPoint& cp = manifold->getContactPoint(i); - debugDrawer->DrawContactPoint( + debugDrawer->drawContactPoint( cp.m_positionWorldOnB, cp.m_normalWorldOnB, - cp.GetDistance(), - cp.GetLifeTime(), + cp.getDistance(), + cp.getLifeTime(), color); } assert (m_CurJoint < MAX_JOINTS_1); -// if (manifold->GetContactPoint(i).GetDistance() < 0.0f) +// if (manifold->getContactPoint(i).getDistance() < 0.0f) { ContactJoint* cont = new (&gJointArray[m_CurJoint++]) ContactJoint( manifold ,i, swapBodies,body0,body1); diff --git a/Extras/quickstep/OdeConstraintSolver.h b/Extras/quickstep/OdeConstraintSolver.h index d91b29399..cef8eb6d5 100644 --- a/Extras/quickstep/OdeConstraintSolver.h +++ b/Extras/quickstep/OdeConstraintSolver.h @@ -44,7 +44,7 @@ public: virtual ~OdeConstraintSolver() {} - virtual float SolveGroup(btPersistentManifold** manifold,int numManifolds,const btContactSolverInfo& info,btIDebugDraw* debugDrawer = 0); + virtual float solveGroup(btPersistentManifold** manifold,int numManifolds,const btContactSolverInfo& info,btIDebugDraw* debugDrawer = 0); ///setConstraintForceMixing, the cfm adds some positive value to the main diagonal ///This can improve convergence (make matrix positive semidefinite), but it can make the simulation look more 'springy' diff --git a/Extras/test_BulletOde.cpp b/Extras/test_BulletOde.cpp index 750220330..14823f355 100644 --- a/Extras/test_BulletOde.cpp +++ b/Extras/test_BulletOde.cpp @@ -179,7 +179,7 @@ static void command (int cmd) // destroy the body and geoms for slot i dBodyDestroy (obj[i].body); - collisionWorld->RemoveCollisionObject(&obj[i].collider); + collisionWorld->removeCollisionObject(&obj[i].collider); obj[i].collider.m_broadphaseHandle = (btBroadphaseProxy*)(-1); @@ -212,7 +212,7 @@ static void command (int cmd) dMassSetBox (&m,DENSITY,sides[0],sides[1],sides[2]); obj[i].collider.m_collisionShape = new btBoxShape(btVector3(0.5*sides[0],0.5*sides[1],0.5*sides[2])); obj[i].collider.m_worldTransform = GetTransformFromOde(dBodyGetPosition(obj[i].body),dBodyGetRotation(obj[i].body)); - collisionWorld->AddCollisionObject(&obj[i].collider); + collisionWorld->addCollisionObject(&obj[i].collider); obj[i].collider.m_userPointer = obj[i].body; } @@ -223,7 +223,7 @@ static void command (int cmd) dMassSetCappedCylinder (&m,DENSITY,3,sides[0],sides[1]); obj[i].collider.m_collisionShape = new btCylinderShapeZ(btVector3(sides[0],sides[1],sides[1])); obj[i].collider.m_worldTransform = GetTransformFromOde(dBodyGetPosition(obj[i].body),dBodyGetRotation(obj[i].body)); - collisionWorld->AddCollisionObject(&obj[i].collider); + collisionWorld->addCollisionObject(&obj[i].collider); obj[i].collider.m_userPointer = obj[i].body; //obj[i].geom[0] = dCreateCCylinder (space,sides[0],sides[1]); } @@ -242,7 +242,7 @@ static void command (int cmd) obj[i].collider.m_worldTransform = GetTransformFromOde(dBodyGetPosition(obj[i].body),dBodyGetRotation(obj[i].body)); - collisionWorld->AddCollisionObject(&obj[i].collider); + collisionWorld->addCollisionObject(&obj[i].collider); obj[i].collider.m_userPointer = obj[i].body; //obj[i].geom[0] = dCreateSphere (space,sides[0]); @@ -300,21 +300,21 @@ void drawGeom (btCollisionObject& collider)//, const dReal *pos, const dReal *R, if (!collider.m_collisionShape) return; - int type = collider.m_collisionShape->GetShapeType(); + int type = collider.m_collisionShape->getShapeType(); if (type == BOX_SHAPE_PROXYTYPE) { dVector3 sides; btBoxShape* boxShape = static_cast(collider.m_collisionShape); - sides[0] = 2.f*boxShape->GetHalfExtents().x(); - sides[1] = 2.f*boxShape->GetHalfExtents().y(); - sides[2] = 2.f*boxShape->GetHalfExtents().z(); + sides[0] = 2.f*boxShape->getHalfExtents().x(); + sides[1] = 2.f*boxShape->getHalfExtents().y(); + sides[2] = 2.f*boxShape->getHalfExtents().z(); ///boxshape already has margins 'inside' dsDrawBox (pos,R,sides); } else if (type == SPHERE_SHAPE_PROXYTYPE) { btSphereShape* sphereShape = static_cast(collider.m_collisionShape); - dReal radius = sphereShape->GetMargin(); + dReal radius = sphereShape->getMargin(); dsDrawSphere (pos,R,radius); @@ -323,10 +323,10 @@ void drawGeom (btCollisionObject& collider)//, const dReal *pos, const dReal *R, else if (type == CYLINDER_SHAPE_PROXYTYPE) { btCylinderShapeZ* cylinder = static_cast(collider.m_collisionShape); - dReal radius = cylinder->GetHalfExtents()[0]; - dReal length = 2.f*cylinder->GetHalfExtents()[1]; - radius += cylinder->GetMargin(); - length += 2.f*cylinder->GetMargin(); + dReal radius = cylinder->getHalfExtents()[0]; + dReal length = 2.f*cylinder->getHalfExtents()[1]; + radius += cylinder->getMargin(); + length += 2.f*cylinder->getMargin(); //dGeomCCylinderGetParams (g,&radius,&length); dsDrawCylinder (pos,R,length,radius); @@ -376,21 +376,21 @@ static void simLoop (int pause) { dsSetColor (0,0,2); //dSpaceCollide (space,0,&nearCallback); - collisionWorld->PerformDiscreteCollisionDetection(); + collisionWorld->performDiscreteCollisionDetection(); //now the collisionWorld contains all contact points... just copy them over to ODE and that's it - for (int i=0;iGetDispatcher()->GetNumManifolds();i++) + for (int i=0;igetDispatcher()->getNumManifolds();i++) { - btPersistentManifold* manifold = collisionWorld->GetDispatcher()->GetManifoldByIndexInternal(i); - btCollisionObject* obj0 = static_cast(manifold->GetBody0()); - btCollisionObject* obj1 = static_cast(manifold->GetBody1()); + btPersistentManifold* manifold = collisionWorld->getDispatcher()->getManifoldByIndexInternal(i); + btCollisionObject* obj0 = static_cast(manifold->getBody0()); + btCollisionObject* obj1 = static_cast(manifold->getBody1()); - //RefreshContactPoints will update and/or remove existing contactpoints from previous frames - manifold->RefreshContactPoints(obj0->m_worldTransform,obj1->m_worldTransform); - for (int j=0;jGetNumContacts();j++) + //refreshContactPoints will update and/or remove existing contactpoints from previous frames + manifold->refreshContactPoints(obj0->m_worldTransform,obj1->m_worldTransform); + for (int j=0;jgetNumContacts();j++) { - btManifoldPoint& pt = manifold->GetContactPoint(j); - if (pt.GetDistance()<0.f) + btManifoldPoint& pt = manifold->getContactPoint(j); + if (pt.getDistance()<0.f) { //report point to ODE @@ -401,7 +401,7 @@ static void simLoop (int pause) contact.surface.bounce = 0.1; contact.surface.bounce_vel = 0.1; contact.surface.soft_cfm = 0.01; - contact.geom.depth = -pt.GetDistance(); + contact.geom.depth = -pt.getDistance(); contact.geom.normal[0] = pt.m_normalWorldOnB.x(); @@ -410,9 +410,9 @@ static void simLoop (int pause) //contact.geom.g1 does it really need this? contact.geom.g1 = 0; contact.geom.g2 = 0; - contact.geom.pos[0] = pt.GetPositionWorldOnB().x(); - contact.geom.pos[1] = pt.GetPositionWorldOnB().y(); - contact.geom.pos[2] = pt.GetPositionWorldOnB().z(); + contact.geom.pos[0] = pt.getPositionWorldOnB().x(); + contact.geom.pos[1] = pt.getPositionWorldOnB().y(); + contact.geom.pos[2] = pt.getPositionWorldOnB().z(); contact.fdir1[0] = 0.f; contact.fdir1[1] = 0.f; @@ -513,8 +513,8 @@ int main (int argc, char **argv) btCollisionObject groundPlane; groundPlane.m_worldTransform.setIdentity(); groundPlane.m_collisionShape = new btBoxShape(btVector3(50,50,0.04)); - groundPlane.m_collisionShape->SetMargin(0.005f); - collisionWorld->AddCollisionObject(&groundPlane); + groundPlane.m_collisionShape->setMargin(0.005f); + collisionWorld->addCollisionObject(&groundPlane); groundPlane.m_userPointer = 0; memset (obj,0,sizeof(obj)); diff --git a/changes.txt b/changes.txt index 1920992b8..b99507d5f 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,12 @@ Bullet Continuous Collision Detection and Physics Library Erwin Coumans +2006 Sept 27 + Big Refactoring: renamed and moved files, create a replacement for CcdPhysicsEnvironment/CcdPhysicsController. + All Bullet classes in LinearMath, BulletCollision and BulletDynamics start with bt, and methods start with lowercase. + Moved classes into src folder, which is the only include folder needed. + Added 2 headerfiles in src: btBulletCollisionCommon.h and btBulletDynamicsCommon.h + 2006 Sept 23 Fixed 2 bugs, causing crashes when removing objects. Should do better unit-testing. UnionFind and 3D SAP were involved. diff --git a/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp b/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp index 7e4d6d8c8..b05285ca7 100644 --- a/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp +++ b/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp @@ -21,25 +21,25 @@ #include -btBroadphaseProxy* btAxisSweep3::CreateProxy( const btVector3& min, const btVector3& max,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask) +btBroadphaseProxy* btAxisSweep3::createProxy( const btVector3& min, const btVector3& max,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask) { - unsigned short handleId = AddHandle(min,max, userPtr,collisionFilterGroup,collisionFilterMask); + unsigned short handleId = addHandle(min,max, userPtr,collisionFilterGroup,collisionFilterMask); - Handle* handle = GetHandle(handleId); + Handle* handle = getHandle(handleId); return handle; } -void btAxisSweep3::DestroyProxy(btBroadphaseProxy* proxy) +void btAxisSweep3::destroyProxy(btBroadphaseProxy* proxy) { Handle* handle = static_cast(proxy); - RemoveHandle(handle->m_handleId); + removeHandle(handle->m_handleId); } -void btAxisSweep3::SetAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax) +void btAxisSweep3::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax) { Handle* handle = static_cast(proxy); - UpdateHandle(handle->m_handleId,aabbMin,aabbMax); + updateHandle(handle->m_handleId,aabbMin,aabbMax); } @@ -107,7 +107,7 @@ btAxisSweep3::~btAxisSweep3() delete[] m_pHandles; } -void btAxisSweep3::Quantize(unsigned short* out, const btPoint3& point, int isMax) const +void btAxisSweep3::quantize(unsigned short* out, const btPoint3& point, int isMax) const { btPoint3 clampedPoint(point); /* @@ -132,22 +132,22 @@ void btAxisSweep3::Quantize(unsigned short* out, const btPoint3& point, int isMa -unsigned short btAxisSweep3::AllocHandle() +unsigned short btAxisSweep3::allocHandle() { assert(m_firstFreeHandle); unsigned short handle = m_firstFreeHandle; - m_firstFreeHandle = GetHandle(handle)->GetNextFree(); + m_firstFreeHandle = getHandle(handle)->GetNextFree(); m_numHandles++; return handle; } -void btAxisSweep3::FreeHandle(unsigned short handle) +void btAxisSweep3::freeHandle(unsigned short handle) { assert(handle > 0 && handle < m_maxHandles); - GetHandle(handle)->SetNextFree(m_firstFreeHandle); + getHandle(handle)->SetNextFree(m_firstFreeHandle); m_firstFreeHandle = handle; m_numHandles--; @@ -155,18 +155,18 @@ void btAxisSweep3::FreeHandle(unsigned short handle) -unsigned short btAxisSweep3::AddHandle(const btPoint3& aabbMin,const btPoint3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask) +unsigned short btAxisSweep3::addHandle(const btPoint3& aabbMin,const btPoint3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask) { // quantize the bounds unsigned short min[3], max[3]; - Quantize(min, aabbMin, 0); - Quantize(max, aabbMax, 1); + quantize(min, aabbMin, 0); + quantize(max, aabbMax, 1); // allocate a handle - unsigned short handle = AllocHandle(); + unsigned short handle = allocHandle(); assert(handle!= 0xcdcd); - Handle* pHandle = GetHandle(handle); + Handle* pHandle = getHandle(handle); pHandle->m_handleId = handle; //pHandle->m_pOverlaps = 0; @@ -195,12 +195,12 @@ unsigned short btAxisSweep3::AddHandle(const btPoint3& aabbMin,const btPoint3& a } // now sort the new edges to their correct position - SortMinDown(0, pHandle->m_minEdges[0], false); - SortMaxDown(0, pHandle->m_maxEdges[0], false); - SortMinDown(1, pHandle->m_minEdges[1], false); - SortMaxDown(1, pHandle->m_maxEdges[1], false); - SortMinDown(2, pHandle->m_minEdges[2], true); - SortMaxDown(2, pHandle->m_maxEdges[2], true); + sortMinDown(0, pHandle->m_minEdges[0], false); + sortMaxDown(0, pHandle->m_maxEdges[0], false); + sortMinDown(1, pHandle->m_minEdges[1], false); + sortMaxDown(1, pHandle->m_maxEdges[1], false); + sortMinDown(2, pHandle->m_minEdges[2], true); + sortMaxDown(2, pHandle->m_maxEdges[2], true); //PrintAxis(1); @@ -208,14 +208,14 @@ unsigned short btAxisSweep3::AddHandle(const btPoint3& aabbMin,const btPoint3& a } -void btAxisSweep3::RemoveHandle(unsigned short handle) +void btAxisSweep3::removeHandle(unsigned short handle) { - Handle* pHandle = GetHandle(handle); + Handle* pHandle = getHandle(handle); //explicitly remove the pairs containing the proxy - //we could do it also in the SortMinUp (passing true) + //we could do it also in the sortMinUp (passing true) //todo: compare performance - RemoveOverlappingPairsContainingProxy(pHandle); + removeOverlappingPairsContainingProxy(pHandle); // compute current limit of edge arrays @@ -238,12 +238,12 @@ void btAxisSweep3::RemoveHandle(unsigned short handle) int max = pHandle->m_maxEdges[axis]; pEdges[max].m_pos = 0xffff; - SortMaxUp(axis,max,false); + sortMaxUp(axis,max,false); int i = pHandle->m_minEdges[axis]; pEdges[i].m_pos = 0xffff; - SortMinUp(axis,i,false); + sortMinUp(axis,i,false); pEdges[limit-1].m_handle = 0; pEdges[limit-1].m_pos = 0xffff; @@ -251,12 +251,12 @@ void btAxisSweep3::RemoveHandle(unsigned short handle) } // free the handle - FreeHandle(handle); + freeHandle(handle); } -bool btAxisSweep3::TestOverlap(int ignoreAxis,const Handle* pHandleA, const Handle* pHandleB) +bool btAxisSweep3::testOverlap(int ignoreAxis,const Handle* pHandleA, const Handle* pHandleB) { //optimization 1: check the array index (memory address), instead of the m_pos @@ -287,17 +287,17 @@ bool btAxisSweep3::TestOverlap(int ignoreAxis,const Handle* pHandleA, const Hand return true; } -void btAxisSweep3::UpdateHandle(unsigned short handle, const btPoint3& aabbMin,const btPoint3& aabbMax) +void btAxisSweep3::updateHandle(unsigned short handle, const btPoint3& aabbMin,const btPoint3& aabbMax) { // assert(bounds.IsFinite()); //assert(bounds.HasVolume()); - Handle* pHandle = GetHandle(handle); + Handle* pHandle = getHandle(handle); // quantize the new bounds unsigned short min[3], max[3]; - Quantize(min, aabbMin, 0); - Quantize(max, aabbMax, 1); + quantize(min, aabbMin, 0); + quantize(max, aabbMax, 1); // update changed edges for (int axis = 0; axis < 3; axis++) @@ -313,39 +313,39 @@ void btAxisSweep3::UpdateHandle(unsigned short handle, const btPoint3& aabbMin,c // expand (only adds overlaps) if (dmin < 0) - SortMinDown(axis, emin); + sortMinDown(axis, emin); if (dmax > 0) - SortMaxUp(axis, emax); + sortMaxUp(axis, emax); // shrink (only removes overlaps) if (dmin > 0) - SortMinUp(axis, emin); + sortMinUp(axis, emin); if (dmax < 0) - SortMaxDown(axis, emax); + sortMaxDown(axis, emax); } //PrintAxis(1); } // sorting a min edge downwards can only ever *add* overlaps -void btAxisSweep3::SortMinDown(int axis, unsigned short edge, bool updateOverlaps) +void btAxisSweep3::sortMinDown(int axis, unsigned short edge, bool updateOverlaps) { Edge* pEdge = m_pEdges[axis] + edge; Edge* pPrev = pEdge - 1; - Handle* pHandleEdge = GetHandle(pEdge->m_handle); + Handle* pHandleEdge = getHandle(pEdge->m_handle); while (pEdge->m_pos < pPrev->m_pos) { - Handle* pHandlePrev = GetHandle(pPrev->m_handle); + Handle* pHandlePrev = getHandle(pPrev->m_handle); if (pPrev->IsMax()) { // if previous edge is a maximum check the bounds and add an overlap if necessary - if (updateOverlaps && TestOverlap(axis,pHandleEdge, pHandlePrev)) + if (updateOverlaps && testOverlap(axis,pHandleEdge, pHandlePrev)) { - AddOverlappingPair(pHandleEdge,pHandlePrev); + addOverlappingPair(pHandleEdge,pHandlePrev); //AddOverlap(pEdge->m_handle, pPrev->m_handle); @@ -371,25 +371,25 @@ void btAxisSweep3::SortMinDown(int axis, unsigned short edge, bool updateOverlap } // sorting a min edge upwards can only ever *remove* overlaps -void btAxisSweep3::SortMinUp(int axis, unsigned short edge, bool updateOverlaps) +void btAxisSweep3::sortMinUp(int axis, unsigned short edge, bool updateOverlaps) { Edge* pEdge = m_pEdges[axis] + edge; Edge* pNext = pEdge + 1; - Handle* pHandleEdge = GetHandle(pEdge->m_handle); + Handle* pHandleEdge = getHandle(pEdge->m_handle); while (pEdge->m_pos > pNext->m_pos) { - Handle* pHandleNext = GetHandle(pNext->m_handle); + Handle* pHandleNext = getHandle(pNext->m_handle); if (pNext->IsMax()) { // if next edge is maximum remove any overlap between the two handles if (updateOverlaps) { - Handle* handle0 = GetHandle(pEdge->m_handle); - Handle* handle1 = GetHandle(pNext->m_handle); + Handle* handle0 = getHandle(pEdge->m_handle); + Handle* handle1 = getHandle(pNext->m_handle); btBroadphasePair tmpPair(*handle0,*handle1); - RemoveOverlappingPair(tmpPair); + removeOverlappingPair(tmpPair); } @@ -413,29 +413,29 @@ void btAxisSweep3::SortMinUp(int axis, unsigned short edge, bool updateOverlaps) } // sorting a max edge downwards can only ever *remove* overlaps -void btAxisSweep3::SortMaxDown(int axis, unsigned short edge, bool updateOverlaps) +void btAxisSweep3::sortMaxDown(int axis, unsigned short edge, bool updateOverlaps) { Edge* pEdge = m_pEdges[axis] + edge; Edge* pPrev = pEdge - 1; - Handle* pHandleEdge = GetHandle(pEdge->m_handle); + Handle* pHandleEdge = getHandle(pEdge->m_handle); while (pEdge->m_pos < pPrev->m_pos) { - Handle* pHandlePrev = GetHandle(pPrev->m_handle); + Handle* pHandlePrev = getHandle(pPrev->m_handle); if (!pPrev->IsMax()) { // if previous edge was a minimum remove any overlap between the two handles if (updateOverlaps) { - Handle* handle0 = GetHandle(pEdge->m_handle); - Handle* handle1 = GetHandle(pPrev->m_handle); - btBroadphasePair* pair = FindPair(handle0,handle1); + Handle* handle0 = getHandle(pEdge->m_handle); + Handle* handle1 = getHandle(pPrev->m_handle); + btBroadphasePair* pair = findPair(handle0,handle1); //assert(pair); if (pair) { - RemoveOverlappingPair(*pair); + removeOverlappingPair(*pair); } } @@ -459,24 +459,24 @@ void btAxisSweep3::SortMaxDown(int axis, unsigned short edge, bool updateOverlap } // sorting a max edge upwards can only ever *add* overlaps -void btAxisSweep3::SortMaxUp(int axis, unsigned short edge, bool updateOverlaps) +void btAxisSweep3::sortMaxUp(int axis, unsigned short edge, bool updateOverlaps) { Edge* pEdge = m_pEdges[axis] + edge; Edge* pNext = pEdge + 1; - Handle* pHandleEdge = GetHandle(pEdge->m_handle); + Handle* pHandleEdge = getHandle(pEdge->m_handle); while (pEdge->m_pos > pNext->m_pos) { - Handle* pHandleNext = GetHandle(pNext->m_handle); + Handle* pHandleNext = getHandle(pNext->m_handle); if (!pNext->IsMax()) { // if next edge is a minimum check the bounds and add an overlap if necessary - if (updateOverlaps && TestOverlap(axis, pHandleEdge, pHandleNext)) + if (updateOverlaps && testOverlap(axis, pHandleEdge, pHandleNext)) { - Handle* handle0 = GetHandle(pEdge->m_handle); - Handle* handle1 = GetHandle(pNext->m_handle); - AddOverlappingPair(handle0,handle1); + Handle* handle0 = getHandle(pEdge->m_handle); + Handle* handle1 = getHandle(pNext->m_handle); + addOverlappingPair(handle0,handle1); } // update edge reference in other handle diff --git a/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h b/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h index 3f3d6a89d..ebbbe01bb 100644 --- a/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h +++ b/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h @@ -26,7 +26,7 @@ /// btAxisSweep3 is an efficient implementation of the 3d axis sweep and prune broadphase. /// It uses arrays rather then lists for storage of the 3 axis. Also it operates using integer coordinates instead of floats. -/// The TestOverlap check is optimized to check the array index, rather then the actual AABB coordinates/pos +/// The testOverlap check is optimized to check the array index, rather then the actual AABB coordinates/pos class btAxisSweep3 : public btOverlappingPairCache { @@ -74,41 +74,41 @@ private: // allocation/deallocation - unsigned short AllocHandle(); - void FreeHandle(unsigned short handle); + unsigned short allocHandle(); + void freeHandle(unsigned short handle); - bool TestOverlap(int ignoreAxis,const Handle* pHandleA, const Handle* pHandleB); + bool testOverlap(int ignoreAxis,const Handle* pHandleA, const Handle* pHandleB); //Overlap* AddOverlap(unsigned short handleA, unsigned short handleB); //void RemoveOverlap(unsigned short handleA, unsigned short handleB); - void Quantize(unsigned short* out, const btPoint3& point, int isMax) const; + void quantize(unsigned short* out, const btPoint3& point, int isMax) const; - void SortMinDown(int axis, unsigned short edge, bool updateOverlaps = true); - void SortMinUp(int axis, unsigned short edge, bool updateOverlaps = true); - void SortMaxDown(int axis, unsigned short edge, bool updateOverlaps = true); - void SortMaxUp(int axis, unsigned short edge, bool updateOverlaps = true); + void sortMinDown(int axis, unsigned short edge, bool updateOverlaps = true); + void sortMinUp(int axis, unsigned short edge, bool updateOverlaps = true); + void sortMaxDown(int axis, unsigned short edge, bool updateOverlaps = true); + void sortMaxUp(int axis, unsigned short edge, bool updateOverlaps = true); public: btAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, int maxHandles = 16384); virtual ~btAxisSweep3(); - virtual void RefreshOverlappingPairs() + virtual void refreshOverlappingPairs() { //this is replace by sweep and prune } - unsigned short AddHandle(const btPoint3& aabbMin,const btPoint3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask); - void RemoveHandle(unsigned short handle); - void UpdateHandle(unsigned short handle, const btPoint3& aabbMin,const btPoint3& aabbMax); - inline Handle* GetHandle(unsigned short index) const {return m_pHandles + index;} + unsigned short addHandle(const btPoint3& aabbMin,const btPoint3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask); + void removeHandle(unsigned short handle); + void updateHandle(unsigned short handle, const btPoint3& aabbMin,const btPoint3& aabbMax); + inline Handle* getHandle(unsigned short index) const {return m_pHandles + index;} //Broadphase Interface - virtual btBroadphaseProxy* CreateProxy( const btVector3& min, const btVector3& max,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask); - virtual void DestroyProxy(btBroadphaseProxy* proxy); - virtual void SetAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax); + virtual btBroadphaseProxy* createProxy( const btVector3& min, const btVector3& max,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask); + virtual void destroyProxy(btBroadphaseProxy* proxy); + virtual void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax); }; diff --git a/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h b/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h index 3dc2676e0..0c0bfe4f7 100644 --- a/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h +++ b/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h @@ -29,10 +29,10 @@ class btBroadphaseInterface public: virtual ~btBroadphaseInterface() {} - virtual btBroadphaseProxy* CreateProxy( const btVector3& min, const btVector3& max,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask) =0; - virtual void DestroyProxy(btBroadphaseProxy* proxy)=0; - virtual void SetAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax)=0; - virtual void CleanProxyFromPairs(btBroadphaseProxy* proxy)=0; + virtual btBroadphaseProxy* createProxy( const btVector3& min, const btVector3& max,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask) =0; + virtual void destroyProxy(btBroadphaseProxy* proxy)=0; + virtual void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax)=0; + virtual void cleanProxyFromPairs(btBroadphaseProxy* proxy)=0; }; diff --git a/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h b/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h index 510cad60b..069de5c76 100644 --- a/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h +++ b/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h @@ -74,22 +74,22 @@ struct btBroadphaseProxy { } - static inline bool IsPolyhedral(int proxyType) + static inline bool isPolyhedral(int proxyType) { return (proxyType < IMPLICIT_CONVEX_SHAPES_START_HERE); } - static inline bool IsConvex(int proxyType) + static inline bool isConvex(int proxyType) { return (proxyType < CONCAVE_SHAPES_START_HERE); } - static inline bool IsConcave(int proxyType) + static inline bool isConcave(int proxyType) { return ((proxyType > CONCAVE_SHAPES_START_HERE) && (proxyType < CONCAVE_SHAPES_END_HERE)); } - static inline bool IsCompound(int proxyType) + static inline bool isCompound(int proxyType) { return (proxyType == COMPOUND_SHAPE_PROXYTYPE); } diff --git a/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h b/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h index 185ec23f4..3f32cf460 100644 --- a/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h +++ b/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h @@ -32,7 +32,7 @@ struct btCollisionAlgorithmConstructionInfo btDispatcher* m_dispatcher; - int GetDispatcherId(); + int getDispatcherId(); }; @@ -47,7 +47,7 @@ protected: btDispatcher* m_dispatcher; protected: - int GetDispatcherId(); + int getDispatcherId(); public: @@ -57,9 +57,9 @@ public: virtual ~btCollisionAlgorithm() {}; - virtual void ProcessCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const struct btDispatcherInfo& dispatchInfo) = 0; + virtual void processCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const struct btDispatcherInfo& dispatchInfo) = 0; - virtual float CalculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const struct btDispatcherInfo& dispatchInfo) = 0; + virtual float calculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const struct btDispatcherInfo& dispatchInfo) = 0; }; diff --git a/src/BulletCollision/BroadphaseCollision/btDispatcher.h b/src/BulletCollision/BroadphaseCollision/btDispatcher.h index e481ba476..a2c6aec76 100644 --- a/src/BulletCollision/BroadphaseCollision/btDispatcher.h +++ b/src/BulletCollision/BroadphaseCollision/btDispatcher.h @@ -66,32 +66,32 @@ class btDispatcher public: virtual ~btDispatcher() ; - virtual btCollisionAlgorithm* FindAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) = 0; + virtual btCollisionAlgorithm* findAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) = 0; // // asume dispatchers to have unique id's in the range [0..max dispacher] // - virtual int GetUniqueId() = 0; + virtual int getUniqueId() = 0; - virtual btPersistentManifold* GetNewManifold(void* body0,void* body1)=0; + virtual btPersistentManifold* getNewManifold(void* body0,void* body1)=0; - virtual void ReleaseManifold(btPersistentManifold* manifold)=0; + virtual void releaseManifold(btPersistentManifold* manifold)=0; - virtual void ClearManifold(btPersistentManifold* manifold)=0; + virtual void clearManifold(btPersistentManifold* manifold)=0; - virtual bool NeedsCollision(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) = 0; + virtual bool needsCollision(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) = 0; - virtual bool NeedsResponse(const btCollisionObject& colObj0,const btCollisionObject& colObj1)=0; + virtual bool needsResponse(const btCollisionObject& colObj0,const btCollisionObject& colObj1)=0; - virtual btManifoldResult* GetNewManifoldResult(btCollisionObject* obj0,btCollisionObject* obj1,btPersistentManifold* manifold) =0; + virtual btManifoldResult* getNewManifoldResult(btCollisionObject* obj0,btCollisionObject* obj1,btPersistentManifold* manifold) =0; - virtual void ReleaseManifoldResult(btManifoldResult*)=0; + virtual void releaseManifoldResult(btManifoldResult*)=0; - virtual void DispatchAllCollisionPairs(btOverlappingPairCache* pairCache,btDispatcherInfo& dispatchInfo)=0; + virtual void dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,btDispatcherInfo& dispatchInfo)=0; - virtual int GetNumManifolds() const = 0; + virtual int getNumManifolds() const = 0; - virtual btPersistentManifold* GetManifoldByIndexInternal(int index) = 0; + virtual btPersistentManifold* getManifoldByIndexInternal(int index) = 0; }; diff --git a/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp b/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp index e168d6d9e..cc16a93c3 100644 --- a/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp +++ b/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp @@ -36,7 +36,7 @@ btOverlappingPairCache::~btOverlappingPairCache() } -void btOverlappingPairCache::RemoveOverlappingPair(btBroadphasePair& findPair) +void btOverlappingPairCache::removeOverlappingPair(btBroadphasePair& findPair) { std::set::iterator it = m_overlappingPairSet.find(findPair); @@ -46,13 +46,13 @@ void btOverlappingPairCache::RemoveOverlappingPair(btBroadphasePair& findPair) { gOverlappingPairs--; btBroadphasePair* pair = (btBroadphasePair*)(&(*it)); - CleanOverlappingPair(*pair); + cleanOverlappingPair(*pair); m_overlappingPairSet.erase(it); } } -void btOverlappingPairCache::CleanOverlappingPair(btBroadphasePair& pair) +void btOverlappingPairCache::cleanOverlappingPair(btBroadphasePair& pair) { for (int dispatcherId=0;dispatcherIdCleanOverlappingPair(pair); + m_pairCache->cleanOverlappingPair(pair); } return false; } @@ -137,13 +137,13 @@ void btOverlappingPairCache::CleanProxyFromPairs(btBroadphaseProxy* proxy) CleanPairCallback cleanPairs(proxy,this); - ProcessAllOverlappingPairs(&cleanPairs); + processAllOverlappingPairs(&cleanPairs); } -void btOverlappingPairCache::RemoveOverlappingPairsContainingProxy(btBroadphaseProxy* proxy) +void btOverlappingPairCache::removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy) { class RemovePairCallback : public btOverlapCallback @@ -155,7 +155,7 @@ void btOverlappingPairCache::RemoveOverlappingPairsContainingProxy(btBroadphaseP :m_obsoleteProxy(obsoleteProxy) { } - virtual bool ProcessOverlap(btBroadphasePair& pair) + virtual bool processOverlap(btBroadphasePair& pair) { return ((pair.m_pProxy0 == m_obsoleteProxy) || (pair.m_pProxy1 == m_obsoleteProxy)); @@ -166,21 +166,21 @@ void btOverlappingPairCache::RemoveOverlappingPairsContainingProxy(btBroadphaseP RemovePairCallback removeCallback(proxy); - ProcessAllOverlappingPairs(&removeCallback); + processAllOverlappingPairs(&removeCallback); } -void btOverlappingPairCache::ProcessAllOverlappingPairs(btOverlapCallback* callback) +void btOverlappingPairCache::processAllOverlappingPairs(btOverlapCallback* callback) { std::set::iterator it = m_overlappingPairSet.begin(); for (; !(it==m_overlappingPairSet.end());) { btBroadphasePair* pair = (btBroadphasePair*)(&(*it)); - if (callback->ProcessOverlap(*pair)) + if (callback->processOverlap(*pair)) { - CleanOverlappingPair(*pair); + cleanOverlappingPair(*pair); std::set::iterator it2 = it; //why does next line not compile under OS X?? diff --git a/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h b/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h index a92ec70dd..3ce1ac4fe 100644 --- a/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h +++ b/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h @@ -30,7 +30,7 @@ virtual ~btOverlapCallback() { } //return true for deletion of the pair - virtual bool ProcessOverlap(btBroadphasePair& pair) = 0; + virtual bool processOverlap(btBroadphasePair& pair) = 0; }; ///OverlappingPairCache maintains the objects with overlapping AABB @@ -48,23 +48,23 @@ class btOverlappingPairCache : public btBroadphaseInterface btOverlappingPairCache(); virtual ~btOverlappingPairCache(); - void ProcessAllOverlappingPairs(btOverlapCallback*); + void processAllOverlappingPairs(btOverlapCallback*); - void RemoveOverlappingPair(btBroadphasePair& pair); + void removeOverlappingPair(btBroadphasePair& pair); - void CleanOverlappingPair(btBroadphasePair& pair); + void cleanOverlappingPair(btBroadphasePair& pair); - void AddOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); + void addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); - btBroadphasePair* FindPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); + btBroadphasePair* findPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); - void CleanProxyFromPairs(btBroadphaseProxy* proxy); + void cleanProxyFromPairs(btBroadphaseProxy* proxy); - void RemoveOverlappingPairsContainingProxy(btBroadphaseProxy* proxy); + void removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy); - inline bool NeedsCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const + inline bool needsCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const { bool collides = proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask; collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask); @@ -74,7 +74,7 @@ class btOverlappingPairCache : public btBroadphaseInterface - virtual void RefreshOverlappingPairs() =0; + virtual void refreshOverlappingPairs() =0; diff --git a/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp b/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp index bb8cd18ae..e0a7d25cd 100644 --- a/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp +++ b/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp @@ -70,7 +70,7 @@ btSimpleBroadphase::~btSimpleBroadphase() } -btBroadphaseProxy* btSimpleBroadphase::CreateProxy( const btVector3& min, const btVector3& max,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask) +btBroadphaseProxy* btSimpleBroadphase::createProxy( const btVector3& min, const btVector3& max,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask) { if (m_numProxies >= m_maxProxies) { @@ -98,7 +98,7 @@ btBroadphaseProxy* btSimpleBroadphase::CreateProxy( const btVector3& min, cons class RemovingOverlapCallback : public btOverlapCallback { protected: - virtual bool ProcessOverlap(btBroadphasePair& pair) + virtual bool processOverlap(btBroadphasePair& pair) { assert(0); } @@ -113,7 +113,7 @@ class RemovePairContainingProxy { } protected: - virtual bool ProcessOverlap(btBroadphasePair& pair) + virtual bool processOverlap(btBroadphasePair& pair) { btSimpleBroadphaseProxy* proxy0 = static_cast(pair.m_pProxy0); btSimpleBroadphaseProxy* proxy1 = static_cast(pair.m_pProxy1); @@ -122,7 +122,7 @@ protected: }; }; -void btSimpleBroadphase::DestroyProxy(btBroadphaseProxy* proxyOrg) +void btSimpleBroadphase::destroyProxy(btBroadphaseProxy* proxyOrg) { int i; @@ -134,7 +134,7 @@ void btSimpleBroadphase::DestroyProxy(btBroadphaseProxy* proxyOrg) assert (index < m_maxProxies); m_freeProxies[--m_firstFreeProxy] = index; - //RemoveOverlappingPairsContainingProxy(proxyOrg); + //removeOverlappingPairsContainingProxy(proxyOrg); assert(0); //then remove non-overlapping ones @@ -142,11 +142,11 @@ void btSimpleBroadphase::DestroyProxy(btBroadphaseProxy* proxyOrg) { btBroadphasePair& pair = GetOverlappingPair(i); - btSimpleBroadphaseProxy* proxy0 = GetSimpleProxyFromProxy(pair.m_pProxy0); - btSimpleBroadphaseProxy* proxy1 = GetSimpleProxyFromProxy(pair.m_pProxy1); + btSimpleBroadphaseProxy* proxy0 = getSimpleProxyFromProxy(pair.m_pProxy0); + btSimpleBroadphaseProxy* proxy1 = getSimpleProxyFromProxy(pair.m_pProxy1); if ((proxy0==proxyOrg) || (proxy1==proxyOrg)) { - RemoveOverlappingPair(pair); + removeOverlappingPair(pair); } } */ @@ -167,9 +167,9 @@ void btSimpleBroadphase::DestroyProxy(btBroadphaseProxy* proxyOrg) } -void btSimpleBroadphase::SetAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax) +void btSimpleBroadphase::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax) { - btSimpleBroadphaseProxy* sbp = GetSimpleProxyFromProxy(proxy); + btSimpleBroadphaseProxy* sbp = getSimpleProxyFromProxy(proxy); sbp->m_min = aabbMin; sbp->m_max = aabbMax; } @@ -182,7 +182,7 @@ void btSimpleBroadphase::SetAabb(btBroadphaseProxy* proxy,const btVector3& aabbM -bool btSimpleBroadphase::AabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBroadphaseProxy* proxy1) +bool btSimpleBroadphase::aabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBroadphaseProxy* proxy1) { return proxy0->m_min[0] <= proxy1->m_max[0] && proxy1->m_min[0] <= proxy0->m_max[0] && proxy0->m_min[1] <= proxy1->m_max[1] && proxy1->m_min[1] <= proxy0->m_max[1] && @@ -196,13 +196,13 @@ bool btSimpleBroadphase::AabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBro class CheckOverlapCallback : public btOverlapCallback { public: - virtual bool ProcessOverlap(btBroadphasePair& pair) + virtual bool processOverlap(btBroadphasePair& pair) { - return (!btSimpleBroadphase::AabbOverlap(static_cast(pair.m_pProxy0),static_cast(pair.m_pProxy1))); + return (!btSimpleBroadphase::aabbOverlap(static_cast(pair.m_pProxy0),static_cast(pair.m_pProxy1))); } }; -void btSimpleBroadphase::RefreshOverlappingPairs() +void btSimpleBroadphase::refreshOverlappingPairs() { //first check for new overlapping pairs int i,j; @@ -213,14 +213,14 @@ void btSimpleBroadphase::RefreshOverlappingPairs() for (j=i+1;j(proxy); return proxy0; @@ -64,20 +64,20 @@ class btSimpleBroadphase : public btOverlappingPairCache protected: - virtual void RefreshOverlappingPairs(); + virtual void refreshOverlappingPairs(); public: btSimpleBroadphase(int maxProxies=16384); virtual ~btSimpleBroadphase(); - static bool AabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBroadphaseProxy* proxy1); + static bool aabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBroadphaseProxy* proxy1); - virtual btBroadphaseProxy* CreateProxy( const btVector3& min, const btVector3& max,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask); + virtual btBroadphaseProxy* createProxy( const btVector3& min, const btVector3& max,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask); - virtual void DestroyProxy(btBroadphaseProxy* proxy); - virtual void SetAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax); + virtual void destroyProxy(btBroadphaseProxy* proxy); + virtual void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax); diff --git a/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp b/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp index 38c59ecf9..a72379ce1 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp +++ b/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp @@ -52,7 +52,7 @@ btCollisionDispatcher::btCollisionDispatcher (): { for (int j=0;jClearManifold(); + manifold->clearManifold(); } -void btCollisionDispatcher::ReleaseManifold(btPersistentManifold* manifold) +void btCollisionDispatcher::releaseManifold(btPersistentManifold* manifold) { gNumManifold--; - //printf("ReleaseManifold: gNumManifold %d\n",gNumManifold); + //printf("releaseManifold: gNumManifold %d\n",gNumManifold); - ClearManifold(manifold); + clearManifold(manifold); std::vector::iterator i = std::find(m_manifoldsPtr.begin(), m_manifoldsPtr.end(), manifold); @@ -121,7 +121,7 @@ void btCollisionDispatcher::ReleaseManifold(btPersistentManifold* manifold) -btCollisionAlgorithm* btCollisionDispatcher::FindAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) +btCollisionAlgorithm* btCollisionDispatcher::findAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) { #define USE_DISPATCH_REGISTRY_ARRAY 1 #ifdef USE_DISPATCH_REGISTRY_ARRAY @@ -129,39 +129,39 @@ btCollisionAlgorithm* btCollisionDispatcher::FindAlgorithm(btBroadphaseProxy& pr btCollisionObject* body1 = (btCollisionObject*)proxy1.m_clientObject; btCollisionAlgorithmConstructionInfo ci; ci.m_dispatcher = this; - btCollisionAlgorithm* algo = m_doubleDispatch[body0->m_collisionShape->GetShapeType()][body1->m_collisionShape->GetShapeType()] + btCollisionAlgorithm* algo = m_doubleDispatch[body0->m_collisionShape->getShapeType()][body1->m_collisionShape->getShapeType()] ->CreateCollisionAlgorithm(ci,&proxy0,&proxy1); #else - btCollisionAlgorithm* algo = InternalFindAlgorithm(proxy0,proxy1); + btCollisionAlgorithm* algo = internalFindAlgorithm(proxy0,proxy1); #endif //USE_DISPATCH_REGISTRY_ARRAY return algo; } -btCollisionAlgorithmCreateFunc* btCollisionDispatcher::InternalFindCreateFunc(int proxyType0,int proxyType1) +btCollisionAlgorithmCreateFunc* btCollisionDispatcher::internalFindCreateFunc(int proxyType0,int proxyType1) { - if (btBroadphaseProxy::IsConvex(proxyType0) && btBroadphaseProxy::IsConvex(proxyType1)) + if (btBroadphaseProxy::isConvex(proxyType0) && btBroadphaseProxy::isConvex(proxyType1)) { return m_convexConvexCreateFunc; } - if (btBroadphaseProxy::IsConvex(proxyType0) && btBroadphaseProxy::IsConcave(proxyType1)) + if (btBroadphaseProxy::isConvex(proxyType0) && btBroadphaseProxy::isConcave(proxyType1)) { return m_convexConcaveCreateFunc; } - if (btBroadphaseProxy::IsConvex(proxyType1) && btBroadphaseProxy::IsConcave(proxyType0)) + if (btBroadphaseProxy::isConvex(proxyType1) && btBroadphaseProxy::isConcave(proxyType0)) { return m_swappedConvexConcaveCreateFunc; } - if (btBroadphaseProxy::IsCompound(proxyType0)) + if (btBroadphaseProxy::isCompound(proxyType0)) { return m_compoundCreateFunc; } else { - if (btBroadphaseProxy::IsCompound(proxyType1)) + if (btBroadphaseProxy::isCompound(proxyType1)) { return m_swappedCompoundCreateFunc; } @@ -173,7 +173,7 @@ btCollisionAlgorithmCreateFunc* btCollisionDispatcher::InternalFindCreateFunc(in -btCollisionAlgorithm* btCollisionDispatcher::InternalFindAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) +btCollisionAlgorithm* btCollisionDispatcher::internalFindAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) { m_count++; btCollisionObject* body0 = (btCollisionObject*)proxy0.m_clientObject; @@ -182,27 +182,27 @@ btCollisionAlgorithm* btCollisionDispatcher::InternalFindAlgorithm(btBroadphaseP btCollisionAlgorithmConstructionInfo ci; ci.m_dispatcher = this; - if (body0->m_collisionShape->IsConvex() && body1->m_collisionShape->IsConvex() ) + if (body0->m_collisionShape->isConvex() && body1->m_collisionShape->isConvex() ) { return new btConvexConvexAlgorithm(0,ci,&proxy0,&proxy1); } - if (body0->m_collisionShape->IsConvex() && body1->m_collisionShape->IsConcave()) + if (body0->m_collisionShape->isConvex() && body1->m_collisionShape->isConcave()) { return new btConvexConcaveCollisionAlgorithm(ci,&proxy0,&proxy1); } - if (body1->m_collisionShape->IsConvex() && body0->m_collisionShape->IsConcave()) + if (body1->m_collisionShape->isConvex() && body0->m_collisionShape->isConcave()) { return new btConvexConcaveCollisionAlgorithm(ci,&proxy1,&proxy0); } - if (body0->m_collisionShape->IsCompound()) + if (body0->m_collisionShape->isCompound()) { return new btCompoundCollisionAlgorithm(ci,&proxy0,&proxy1); } else { - if (body1->m_collisionShape->IsCompound()) + if (body1->m_collisionShape->isCompound()) { return new btCompoundCollisionAlgorithm(ci,&proxy1,&proxy0); } @@ -213,7 +213,7 @@ btCollisionAlgorithm* btCollisionDispatcher::InternalFindAlgorithm(btBroadphaseP } -bool btCollisionDispatcher::NeedsResponse(const btCollisionObject& colObj0,const btCollisionObject& colObj1) +bool btCollisionDispatcher::needsResponse(const btCollisionObject& colObj0,const btCollisionObject& colObj1) { @@ -226,7 +226,7 @@ bool btCollisionDispatcher::NeedsResponse(const btCollisionObject& colObj0,cons return hasResponse; } -bool btCollisionDispatcher::NeedsCollision(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) +bool btCollisionDispatcher::needsCollision(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) { btCollisionObject* body0 = (btCollisionObject*)proxy0.m_clientObject; @@ -249,7 +249,7 @@ bool btCollisionDispatcher::NeedsCollision(btBroadphaseProxy& proxy0,btBroadphas } ///allows the user to get contact point callbacks -btManifoldResult* btCollisionDispatcher::GetNewManifoldResult(btCollisionObject* obj0,btCollisionObject* obj1,btPersistentManifold* manifold) +btManifoldResult* btCollisionDispatcher::getNewManifoldResult(btCollisionObject* obj0,btCollisionObject* obj1,btPersistentManifold* manifold) { @@ -259,34 +259,34 @@ btManifoldResult* btCollisionDispatcher::GetNewManifoldResult(btCollisionObject* } ///allows the user to get contact point callbacks -void btCollisionDispatcher::ReleaseManifoldResult(btManifoldResult*) +void btCollisionDispatcher::releaseManifoldResult(btManifoldResult*) { } -class CollisionPairCallback : public btOverlapCallback +class btCollisionPairCallback : public btOverlapCallback { btDispatcherInfo& m_dispatchInfo; btCollisionDispatcher* m_dispatcher; int m_dispatcherId; public: - CollisionPairCallback(btDispatcherInfo& dispatchInfo,btCollisionDispatcher* dispatcher,int dispatcherId) + btCollisionPairCallback(btDispatcherInfo& dispatchInfo,btCollisionDispatcher* dispatcher,int dispatcherId) :m_dispatchInfo(dispatchInfo), m_dispatcher(dispatcher), m_dispatcherId(dispatcherId) { } - virtual bool ProcessOverlap(btBroadphasePair& pair) + virtual bool processOverlap(btBroadphasePair& pair) { if (m_dispatcherId>= 0) { //dispatcher will keep algorithms persistent in the collision pair if (!pair.m_algorithms[m_dispatcherId]) { - pair.m_algorithms[m_dispatcherId] = m_dispatcher->FindAlgorithm( + pair.m_algorithms[m_dispatcherId] = m_dispatcher->findAlgorithm( *pair.m_pProxy0, *pair.m_pProxy1); } @@ -295,10 +295,10 @@ public: { if (m_dispatchInfo.m_dispatchFunc == btDispatcherInfo::DISPATCH_DISCRETE) { - pair.m_algorithms[m_dispatcherId]->ProcessCollision(pair.m_pProxy0,pair.m_pProxy1,m_dispatchInfo); + pair.m_algorithms[m_dispatcherId]->processCollision(pair.m_pProxy0,pair.m_pProxy1,m_dispatchInfo); } else { - float toi = pair.m_algorithms[m_dispatcherId]->CalculateTimeOfImpact(pair.m_pProxy0,pair.m_pProxy1,m_dispatchInfo); + float toi = pair.m_algorithms[m_dispatcherId]->calculateTimeOfImpact(pair.m_pProxy0,pair.m_pProxy1,m_dispatchInfo); if (m_dispatchInfo.m_timeOfImpact > toi) m_dispatchInfo.m_timeOfImpact = toi; @@ -307,7 +307,7 @@ public: } else { //non-persistent algorithm dispatcher - btCollisionAlgorithm* algo = m_dispatcher->FindAlgorithm( + btCollisionAlgorithm* algo = m_dispatcher->findAlgorithm( *pair.m_pProxy0, *pair.m_pProxy1); @@ -315,10 +315,10 @@ public: { if (m_dispatchInfo.m_dispatchFunc == btDispatcherInfo::DISPATCH_DISCRETE) { - algo->ProcessCollision(pair.m_pProxy0,pair.m_pProxy1,m_dispatchInfo); + algo->processCollision(pair.m_pProxy0,pair.m_pProxy1,m_dispatchInfo); } else { - float toi = algo->CalculateTimeOfImpact(pair.m_pProxy0,pair.m_pProxy1,m_dispatchInfo); + float toi = algo->calculateTimeOfImpact(pair.m_pProxy0,pair.m_pProxy1,m_dispatchInfo); if (m_dispatchInfo.m_timeOfImpact > toi) m_dispatchInfo.m_timeOfImpact = toi; } @@ -330,15 +330,15 @@ public: }; -void btCollisionDispatcher::DispatchAllCollisionPairs(btOverlappingPairCache* pairCache,btDispatcherInfo& dispatchInfo) +void btCollisionDispatcher::dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,btDispatcherInfo& dispatchInfo) { //m_blockedForChanges = true; - int dispatcherId = GetUniqueId(); + int dispatcherId = getUniqueId(); - CollisionPairCallback collisionCallback(dispatchInfo,this,dispatcherId); + btCollisionPairCallback collisionCallback(dispatchInfo,this,dispatcherId); - pairCache->ProcessAllOverlappingPairs(&collisionCallback); + pairCache->processAllOverlappingPairs(&collisionCallback); //m_blockedForChanges = false; diff --git a/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h b/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h index 52946a876..dfe1b5eed 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h +++ b/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h @@ -46,7 +46,7 @@ class btCollisionDispatcher : public btDispatcher btCollisionAlgorithmCreateFunc* m_doubleDispatch[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES]; - btCollisionAlgorithmCreateFunc* InternalFindCreateFunc(int proxyType0,int proxyType1); + btCollisionAlgorithmCreateFunc* internalFindCreateFunc(int proxyType0,int proxyType1); //default CreationFunctions, filling the m_doubleDispatch table btCollisionAlgorithmCreateFunc* m_convexConvexCreateFunc; @@ -58,10 +58,10 @@ class btCollisionDispatcher : public btDispatcher public: - ///RegisterCollisionCreateFunc allows registration of custom/alternative collision create functions - void RegisterCollisionCreateFunc(int proxyType0,int proxyType1, btCollisionAlgorithmCreateFunc* createFunc); + ///registerCollisionCreateFunc allows registration of custom/alternative collision create functions + void registerCollisionCreateFunc(int proxyType0,int proxyType1, btCollisionAlgorithmCreateFunc* createFunc); - int GetNumManifolds() const + int getNumManifolds() const { return m_manifoldsPtr.size(); } @@ -71,12 +71,12 @@ public: return &m_manifoldsPtr[0]; } - btPersistentManifold* GetManifoldByIndexInternal(int index) + btPersistentManifold* getManifoldByIndexInternal(int index) { return m_manifoldsPtr[index]; } - const btPersistentManifold* GetManifoldByIndexInternal(int index) const + const btPersistentManifold* getManifoldByIndexInternal(int index) const { return m_manifoldsPtr[index]; } @@ -86,31 +86,31 @@ public: btCollisionDispatcher (); virtual ~btCollisionDispatcher(); - virtual btPersistentManifold* GetNewManifold(void* b0,void* b1); + virtual btPersistentManifold* getNewManifold(void* b0,void* b1); - virtual void ReleaseManifold(btPersistentManifold* manifold); + virtual void releaseManifold(btPersistentManifold* manifold); ///allows the user to get contact point callbacks - virtual btManifoldResult* GetNewManifoldResult(btCollisionObject* obj0,btCollisionObject* obj1,btPersistentManifold* manifold); + virtual btManifoldResult* getNewManifoldResult(btCollisionObject* obj0,btCollisionObject* obj1,btPersistentManifold* manifold); ///allows the user to get contact point callbacks - virtual void ReleaseManifoldResult(btManifoldResult*); + virtual void releaseManifoldResult(btManifoldResult*); - virtual void ClearManifold(btPersistentManifold* manifold); + virtual void clearManifold(btPersistentManifold* manifold); - btCollisionAlgorithm* FindAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1); + btCollisionAlgorithm* findAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1); - btCollisionAlgorithm* InternalFindAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1); + btCollisionAlgorithm* internalFindAlgorithm(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1); - virtual bool NeedsCollision(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1); + virtual bool needsCollision(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1); - virtual bool NeedsResponse(const btCollisionObject& colObj0,const btCollisionObject& colObj1); + virtual bool needsResponse(const btCollisionObject& colObj0,const btCollisionObject& colObj1); - virtual int GetUniqueId() { return RIGIDBODY_DISPATCHER;} + virtual int getUniqueId() { return RIGIDBODY_DISPATCHER;} - virtual void DispatchAllCollisionPairs(btOverlappingPairCache* pairCache,btDispatcherInfo& dispatchInfo); + virtual void dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,btDispatcherInfo& dispatchInfo); diff --git a/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp b/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp index 2b3b5d6de..f895521bf 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp +++ b/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp @@ -45,8 +45,8 @@ btCollisionWorld::~btCollisionWorld() // // only clear the cached algorithms // - GetBroadphase()->CleanProxyFromPairs(bp); - GetBroadphase()->DestroyProxy(bp); + getBroadphase()->cleanProxyFromPairs(bp); + getBroadphase()->destroyProxy(bp); } } @@ -61,7 +61,7 @@ btCollisionWorld::~btCollisionWorld() -void btCollisionWorld::AddCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup,short int collisionFilterMask) +void btCollisionWorld::addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup,short int collisionFilterMask) { m_collisionObjects.push_back(collisionObject); @@ -70,10 +70,10 @@ void btCollisionWorld::AddCollisionObject(btCollisionObject* collisionObject,sho btVector3 minAabb; btVector3 maxAabb; - collisionObject->m_collisionShape->GetAabb(trans,minAabb,maxAabb); + collisionObject->m_collisionShape->getAabb(trans,minAabb,maxAabb); - int type = collisionObject->m_collisionShape->GetShapeType(); - collisionObject->m_broadphaseHandle = GetBroadphase()->CreateProxy( + int type = collisionObject->m_collisionShape->getShapeType(); + collisionObject->m_broadphaseHandle = getBroadphase()->createProxy( minAabb, maxAabb, type, @@ -87,7 +87,7 @@ void btCollisionWorld::AddCollisionObject(btCollisionObject* collisionObject,sho } -void btCollisionWorld::PerformDiscreteCollisionDetection() +void btCollisionWorld::performDiscreteCollisionDetection() { btDispatcherInfo dispatchInfo; dispatchInfo.m_timeStep = 0.f; @@ -99,20 +99,20 @@ void btCollisionWorld::PerformDiscreteCollisionDetection() for (size_t i=0;im_cachedInvertedWorldTransform = m_collisionObjects[i]->m_worldTransform.inverse(); - m_collisionObjects[i]->m_collisionShape->GetAabb(m_collisionObjects[i]->m_worldTransform,aabbMin,aabbMax); - m_pairCache->SetAabb(m_collisionObjects[i]->m_broadphaseHandle,aabbMin,aabbMax); + m_collisionObjects[i]->m_collisionShape->getAabb(m_collisionObjects[i]->m_worldTransform,aabbMin,aabbMax); + m_pairCache->setAabb(m_collisionObjects[i]->m_broadphaseHandle,aabbMin,aabbMax); } - m_pairCache->RefreshOverlappingPairs(); + m_pairCache->refreshOverlappingPairs(); - btDispatcher* dispatcher = GetDispatcher(); + btDispatcher* dispatcher = getDispatcher(); if (dispatcher) - dispatcher->DispatchAllCollisionPairs(m_pairCache,dispatchInfo); + dispatcher->dispatchAllCollisionPairs(m_pairCache,dispatchInfo); } -void btCollisionWorld::RemoveCollisionObject(btCollisionObject* collisionObject) +void btCollisionWorld::removeCollisionObject(btCollisionObject* collisionObject) { @@ -126,8 +126,8 @@ void btCollisionWorld::RemoveCollisionObject(btCollisionObject* collisionObject) // // only clear the cached algorithms // - GetBroadphase()->CleanProxyFromPairs(bp); - GetBroadphase()->DestroyProxy(bp); + getBroadphase()->cleanProxyFromPairs(bp); + getBroadphase()->destroyProxy(bp); collisionObject->m_broadphaseHandle = 0; } } @@ -142,7 +142,7 @@ void btCollisionWorld::RemoveCollisionObject(btCollisionObject* collisionObject) } } -void btCollisionWorld::RayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans, +void btCollisionWorld::rayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans, btCollisionObject* collisionObject, const btCollisionShape* collisionShape, const btTransform& colObjWorldTransform, @@ -151,7 +151,7 @@ void btCollisionWorld::RayTestSingle(const btTransform& rayFromTrans,const btTra btSphereShape pointShape(0.0f); - if (collisionShape->IsConvex()) + if (collisionShape->isConvex()) { btConvexCast::CastResult castResult; castResult.m_fraction = 1.f;//?? @@ -189,7 +189,7 @@ void btCollisionWorld::RayTestSingle(const btTransform& rayFromTrans,const btTra else { - if (collisionShape->IsConcave()) + if (collisionShape->isConcave()) { btTriangleMeshShape* triangleMesh = (btTriangleMeshShape*)collisionShape; @@ -217,7 +217,7 @@ void btCollisionWorld::RayTestSingle(const btTransform& rayFromTrans,const btTra } - virtual float ReportHit(const btVector3& hitNormalLocal, float hitFraction, int partId, int triangleIndex ) + virtual float reportHit(const btVector3& hitNormalLocal, float hitFraction, int partId, int triangleIndex ) { btCollisionWorld::LocalShapeInfo shapeInfo; shapeInfo.m_shapePart = partId; @@ -245,21 +245,21 @@ void btCollisionWorld::RayTestSingle(const btTransform& rayFromTrans,const btTra btVector3 rayAabbMaxLocal = rayFromLocal; rayAabbMaxLocal.setMax(rayToLocal); - triangleMesh->ProcessAllTriangles(&rcb,rayAabbMinLocal,rayAabbMaxLocal); + triangleMesh->processAllTriangles(&rcb,rayAabbMinLocal,rayAabbMaxLocal); } else { //todo: use AABB tree or other BVH acceleration structure! - if (collisionShape->IsCompound()) + if (collisionShape->isCompound()) { const btCompoundShape* compoundShape = static_cast(collisionShape); int i=0; - for (i=0;iGetNumChildShapes();i++) + for (i=0;igetNumChildShapes();i++) { - btTransform childTrans = compoundShape->GetChildTransform(i); - const btCollisionShape* childCollisionShape = compoundShape->GetChildShape(i); + btTransform childTrans = compoundShape->getChildTransform(i); + const btCollisionShape* childCollisionShape = compoundShape->getChildShape(i); btTransform childWorldTrans = colObjWorldTransform * childTrans; - RayTestSingle(rayFromTrans,rayToTrans, + rayTestSingle(rayFromTrans,rayToTrans, collisionObject, childCollisionShape, childWorldTrans, @@ -273,7 +273,7 @@ void btCollisionWorld::RayTestSingle(const btTransform& rayFromTrans,const btTra } } -void btCollisionWorld::RayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) +void btCollisionWorld::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) { @@ -304,13 +304,13 @@ void btCollisionWorld::RayTest(const btVector3& rayFromWorld, const btVector3& r //RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject(); btVector3 collisionObjectAabbMin,collisionObjectAabbMax; - collisionObject->m_collisionShape->GetAabb(collisionObject->m_worldTransform,collisionObjectAabbMin,collisionObjectAabbMax); + collisionObject->m_collisionShape->getAabb(collisionObject->m_worldTransform,collisionObjectAabbMin,collisionObjectAabbMax); //check aabb overlap if (TestAabbAgainstAabb2(rayAabbMin,rayAabbMax,collisionObjectAabbMin,collisionObjectAabbMax)) { - RayTestSingle(rayFromTrans,rayToTrans, + rayTestSingle(rayFromTrans,rayToTrans, collisionObject, collisionObject->m_collisionShape, collisionObject->m_worldTransform, diff --git a/src/BulletCollision/CollisionDispatch/btCollisionWorld.h b/src/BulletCollision/CollisionDispatch/btCollisionWorld.h index 66fa52b92..c52e24d33 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionWorld.h +++ b/src/BulletCollision/CollisionDispatch/btCollisionWorld.h @@ -44,7 +44,8 @@ subject to the following restrictions: * The Dependencies can be seen in this documentation under Directories * * @subsection step4 Step 4: Integrating in your application, Full Rigid Body Simulation - * Check out CcdPhysicsDemo how to create a CcdPhysicsEnvironment , btCollisionShape and btRigidBody, Stepping the simulation and synchronizing your derived version of the PHY_IMotionState class. + * Check out CcdPhysicsDemo how to create a btDynamicsWorld, btRigidBody and btCollisionShape, Stepping the simulation and synchronizing your graphics object transform. + * PLEASE NOTE THE CcdPhysicsEnvironment and CcdPhysicsController is obsolete and will be removed. It has been replaced by classes derived frmo btDynamicsWorld and btRididBody * @subsection step5 Step 5 : Integrate the Collision Detection Library (without Dynamics and other Extras) * Bullet Collision Detection can also be used without the Dynamics/Extras. * Check out btCollisionWorld and btCollisionObject, and the CollisionInterfaceDemo. Also in Extras/test_BulletOde.cpp there is a sample Collision Detection integration with Open Dynamics Engine, ODE, http://www.ode.org @@ -101,18 +102,18 @@ public: virtual ~btCollisionWorld(); - btBroadphaseInterface* GetBroadphase() + btBroadphaseInterface* getBroadphase() { return m_pairCache; } - btOverlappingPairCache* GetPairCache() + btOverlappingPairCache* getPairCache() { return m_pairCache; } - btDispatcher* GetDispatcher() + btDispatcher* getDispatcher() { return m_dispatcher1; } @@ -200,40 +201,40 @@ public: - int GetNumCollisionObjects() const + int getNumCollisionObjects() const { return m_collisionObjects.size(); } - /// RayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback + /// rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback /// This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback. - void RayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback); + void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback); - /// RayTestSingle performs a raycast call and calls the resultCallback. It is used internally by RayTest. + /// rayTestSingle performs a raycast call and calls the resultCallback. It is used internally by rayTest. /// In a future implementation, we consider moving the ray test as a virtual method in btCollisionShape. /// This allows more customization. - void RayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans, + void rayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans, btCollisionObject* collisionObject, const btCollisionShape* collisionShape, const btTransform& colObjWorldTransform, RayResultCallback& resultCallback); - void AddCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup=1,short int collisionFilterMask=1); + void addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup=1,short int collisionFilterMask=1); - btCollisionObjectArray& GetCollisionObjectArray() + btCollisionObjectArray& getCollisionObjectArray() { return m_collisionObjects; } - const btCollisionObjectArray& GetCollisionObjectArray() const + const btCollisionObjectArray& getCollisionObjectArray() const { return m_collisionObjects; } - void RemoveCollisionObject(btCollisionObject* collisionObject); + void removeCollisionObject(btCollisionObject* collisionObject); - virtual void PerformDiscreteCollisionDetection(); + virtual void performDiscreteCollisionDetection(); }; diff --git a/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp index 7f0ee3a3f..384042c57 100644 --- a/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp @@ -24,10 +24,10 @@ m_compoundProxy(*proxy0), m_otherProxy(*proxy1) { btCollisionObject* colObj = static_cast(m_compoundProxy.m_clientObject); - assert (colObj->m_collisionShape->IsCompound()); + assert (colObj->m_collisionShape->isCompound()); btCompoundShape* compoundShape = static_cast(colObj->m_collisionShape); - int numChildren = compoundShape->GetNumChildShapes(); + int numChildren = compoundShape->getNumChildShapes(); m_childProxies.resize( numChildren ); int i; for (i=0;iGetChildShape(i); + btCollisionShape* childShape = compoundShape->getChildShape(i); btCollisionObject* colObj = static_cast(m_childProxies[i].m_clientObject); btCollisionShape* orgShape = colObj->m_collisionShape; colObj->m_collisionShape = childShape; - m_childCollisionAlgorithms[i] = m_dispatcher->FindAlgorithm(m_childProxies[i],m_otherProxy); + m_childCollisionAlgorithms[i] = m_dispatcher->findAlgorithm(m_childProxies[i],m_otherProxy); colObj->m_collisionShape =orgShape; } } @@ -58,10 +58,10 @@ btCompoundCollisionAlgorithm::~btCompoundCollisionAlgorithm() } } -void btCompoundCollisionAlgorithm::ProcessCollision (btBroadphaseProxy* ,btBroadphaseProxy* ,const btDispatcherInfo& dispatchInfo) +void btCompoundCollisionAlgorithm::processCollision (btBroadphaseProxy* ,btBroadphaseProxy* ,const btDispatcherInfo& dispatchInfo) { btCollisionObject* colObj = static_cast(m_compoundProxy.m_clientObject); - assert (colObj->m_collisionShape->IsCompound()); + assert (colObj->m_collisionShape->isCompound()); btCompoundShape* compoundShape = static_cast(colObj->m_collisionShape); @@ -78,29 +78,29 @@ void btCompoundCollisionAlgorithm::ProcessCollision (btBroadphaseProxy* ,btBroad for (i=0;iGetChildShape(i); + btCollisionShape* childShape = compoundShape->getChildShape(i); btCollisionObject* colObj = static_cast(m_childProxies[i].m_clientObject); //backup btTransform orgTrans = colObj->m_worldTransform; btCollisionShape* orgShape = colObj->m_collisionShape; - btTransform childTrans = compoundShape->GetChildTransform(i); + btTransform childTrans = compoundShape->getChildTransform(i); btTransform newChildWorldTrans = orgTrans*childTrans ; colObj->m_worldTransform = newChildWorldTrans; colObj->m_collisionShape = childShape; - m_childCollisionAlgorithms[i]->ProcessCollision(&m_childProxies[i],&m_otherProxy,dispatchInfo); + m_childCollisionAlgorithms[i]->processCollision(&m_childProxies[i],&m_otherProxy,dispatchInfo); //revert back colObj->m_collisionShape =orgShape; colObj->m_worldTransform = orgTrans; } } -float btCompoundCollisionAlgorithm::CalculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) +float btCompoundCollisionAlgorithm::calculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) { btCollisionObject* colObj = static_cast(m_compoundProxy.m_clientObject); - assert (colObj->m_collisionShape->IsCompound()); + assert (colObj->m_collisionShape->isCompound()); btCompoundShape* compoundShape = static_cast(colObj->m_collisionShape); @@ -118,19 +118,19 @@ float btCompoundCollisionAlgorithm::CalculateTimeOfImpact(btBroadphaseProxy* pro for (i=0;iGetChildShape(i); + btCollisionShape* childShape = compoundShape->getChildShape(i); btCollisionObject* colObj = static_cast(m_childProxies[i].m_clientObject); //backup btTransform orgTrans = colObj->m_worldTransform; btCollisionShape* orgShape = colObj->m_collisionShape; - btTransform childTrans = compoundShape->GetChildTransform(i); + btTransform childTrans = compoundShape->getChildTransform(i); btTransform newChildWorldTrans = orgTrans*childTrans ; colObj->m_worldTransform = newChildWorldTrans; colObj->m_collisionShape = childShape; - float frac = m_childCollisionAlgorithms[i]->CalculateTimeOfImpact(&m_childProxies[i],&m_otherProxy,dispatchInfo); + float frac = m_childCollisionAlgorithms[i]->calculateTimeOfImpact(&m_childProxies[i],&m_otherProxy,dispatchInfo); if (fracGetNewManifold(proxy0->m_clientObject,proxy1->m_clientObject); + m_manifoldPtr = m_dispatcher->getNewManifold(proxy0->m_clientObject,proxy1->m_clientObject); - ClearCache(); + clearCache(); } btConvexTriangleCallback::~btConvexTriangleCallback() { - ClearCache(); - m_dispatcher->ReleaseManifold( m_manifoldPtr ); + clearCache(); + m_dispatcher->releaseManifold( m_manifoldPtr ); } -void btConvexTriangleCallback::ClearCache() +void btConvexTriangleCallback::clearCache() { - m_dispatcher->ClearManifold(m_manifoldPtr); + m_dispatcher->clearManifold(m_manifoldPtr); }; -void btConvexTriangleCallback::ProcessTriangle(btVector3* triangle,int partId, int triangleIndex) +void btConvexTriangleCallback::processTriangle(btVector3* triangle,int partId, int triangleIndex) { //just for debugging purposes @@ -85,29 +85,29 @@ void btConvexTriangleCallback::ProcessTriangle(btVector3* triangle,int partId, i ///debug drawing of the overlapping triangles - if (m_dispatchInfoPtr && m_dispatchInfoPtr->m_debugDraw && m_dispatchInfoPtr->m_debugDraw->GetDebugMode() > 0) + if (m_dispatchInfoPtr && m_dispatchInfoPtr->m_debugDraw && m_dispatchInfoPtr->m_debugDraw->getDebugMode() > 0) { btVector3 color(255,255,0); btTransform& tr = ob->m_worldTransform; - m_dispatchInfoPtr->m_debugDraw->DrawLine(tr(triangle[0]),tr(triangle[1]),color); - m_dispatchInfoPtr->m_debugDraw->DrawLine(tr(triangle[1]),tr(triangle[2]),color); - m_dispatchInfoPtr->m_debugDraw->DrawLine(tr(triangle[2]),tr(triangle[0]),color); + m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[0]),tr(triangle[1]),color); + m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[1]),tr(triangle[2]),color); + m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[2]),tr(triangle[0]),color); //btVector3 center = triangle[0] + triangle[1]+triangle[2]; //center *= 0.333333f; - //m_dispatchInfoPtr->m_debugDraw->DrawLine(tr(triangle[0]),tr(center),color); - //m_dispatchInfoPtr->m_debugDraw->DrawLine(tr(triangle[1]),tr(center),color); - //m_dispatchInfoPtr->m_debugDraw->DrawLine(tr(triangle[2]),tr(center),color); + //m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[0]),tr(center),color); + //m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[1]),tr(center),color); + //m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[2]),tr(center),color); } btCollisionObject* colObj = static_cast(m_convexProxy->m_clientObject); - if (colObj->m_collisionShape->IsConvex()) + if (colObj->m_collisionShape->isConvex()) { btTriangleShape tm(triangle[0],triangle[1],triangle[2]); - tm.SetMargin(m_collisionMarginTriangle); + tm.setMargin(m_collisionMarginTriangle); btCollisionShape* tmpShape = ob->m_collisionShape; @@ -115,8 +115,8 @@ void btConvexTriangleCallback::ProcessTriangle(btVector3* triangle,int partId, i ///this should use the btDispatcher, so the actual registered algorithm is used btConvexConvexAlgorithm cvxcvxalgo(m_manifoldPtr,ci,m_convexProxy,&m_triangleProxy); - cvxcvxalgo.SetShapeIdentifiers(-1,-1,partId,triangleIndex); - cvxcvxalgo.ProcessCollision(m_convexProxy,&m_triangleProxy,*m_dispatchInfoPtr); + cvxcvxalgo.setShapeIdentifiers(-1,-1,partId,triangleIndex); + cvxcvxalgo.processCollision(m_convexProxy,&m_triangleProxy,*m_dispatchInfoPtr); ob->m_collisionShape = tmpShape; } @@ -127,7 +127,7 @@ void btConvexTriangleCallback::ProcessTriangle(btVector3* triangle,int partId, i -void btConvexTriangleCallback::SetTimeStepAndCounters(float collisionMarginTriangle,const btDispatcherInfo& dispatchInfo) +void btConvexTriangleCallback::setTimeStepAndCounters(float collisionMarginTriangle,const btDispatcherInfo& dispatchInfo) { m_dispatchInfoPtr = &dispatchInfo; m_collisionMarginTriangle = collisionMarginTriangle; @@ -142,7 +142,7 @@ void btConvexTriangleCallback::SetTimeStepAndCounters(float collisionMarginTrian btCollisionShape* convexShape = static_cast(convexBody->m_collisionShape); //CollisionShape* triangleShape = static_cast(triBody->m_collisionShape); - convexShape->GetAabb(convexInTriangleSpace,m_aabbMin,m_aabbMax); + convexShape->getAabb(convexInTriangleSpace,m_aabbMin,m_aabbMax); float extraMargin = collisionMarginTriangle;//CONVEX_DISTANCE_MARGIN;//+0.1f; @@ -153,22 +153,22 @@ void btConvexTriangleCallback::SetTimeStepAndCounters(float collisionMarginTrian } -void btConvexConcaveCollisionAlgorithm::ClearCache() +void btConvexConcaveCollisionAlgorithm::clearCache() { - m_btConvexTriangleCallback.ClearCache(); + m_btConvexTriangleCallback.clearCache(); } -void btConvexConcaveCollisionAlgorithm::ProcessCollision (btBroadphaseProxy* ,btBroadphaseProxy* ,const btDispatcherInfo& dispatchInfo) +void btConvexConcaveCollisionAlgorithm::processCollision (btBroadphaseProxy* ,btBroadphaseProxy* ,const btDispatcherInfo& dispatchInfo) { btCollisionObject* convexBody = static_cast(m_convex.m_clientObject); btCollisionObject* triBody = static_cast(m_concave.m_clientObject); - if (triBody->m_collisionShape->IsConcave()) + if (triBody->m_collisionShape->isConcave()) { - if (!m_dispatcher->NeedsCollision(m_convex,m_concave)) + if (!m_dispatcher->needsCollision(m_convex,m_concave)) return; @@ -176,19 +176,19 @@ void btConvexConcaveCollisionAlgorithm::ProcessCollision (btBroadphaseProxy* ,bt btCollisionObject* triOb = static_cast(m_concave.m_clientObject); ConcaveShape* concaveShape = static_cast( triOb->m_collisionShape); - if (convexBody->m_collisionShape->IsConvex()) + if (convexBody->m_collisionShape->isConvex()) { - float collisionMarginTriangle = concaveShape->GetMargin(); + float collisionMarginTriangle = concaveShape->getMargin(); - m_btConvexTriangleCallback.SetTimeStepAndCounters(collisionMarginTriangle,dispatchInfo); + m_btConvexTriangleCallback.setTimeStepAndCounters(collisionMarginTriangle,dispatchInfo); //Disable persistency. previously, some older algorithm calculated all contacts in one go, so you can clear it here. - //m_dispatcher->ClearManifold(m_btConvexTriangleCallback.m_manifoldPtr); + //m_dispatcher->clearManifold(m_btConvexTriangleCallback.m_manifoldPtr); - m_btConvexTriangleCallback.m_manifoldPtr->SetBodies(m_convex.m_clientObject,m_concave.m_clientObject); + m_btConvexTriangleCallback.m_manifoldPtr->setBodies(m_convex.m_clientObject,m_concave.m_clientObject); - concaveShape->ProcessAllTriangles( &m_btConvexTriangleCallback,m_btConvexTriangleCallback.GetAabbMin(),m_btConvexTriangleCallback.GetAabbMax()); + concaveShape->processAllTriangles( &m_btConvexTriangleCallback,m_btConvexTriangleCallback.getAabbMin(),m_btConvexTriangleCallback.getAabbMax()); } @@ -198,7 +198,7 @@ void btConvexConcaveCollisionAlgorithm::ProcessCollision (btBroadphaseProxy* ,bt } -float btConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(btBroadphaseProxy* ,btBroadphaseProxy* ,const btDispatcherInfo& dispatchInfo) +float btConvexConcaveCollisionAlgorithm::calculateTimeOfImpact(btBroadphaseProxy* ,btBroadphaseProxy* ,const btDispatcherInfo& dispatchInfo) { //quick approximation using raycast, todo: hook up to the continuous collision detection (one of the btConvexCast) @@ -239,7 +239,7 @@ float btConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(btBroadphaseProxy } - virtual void ProcessTriangle(btVector3* triangle, int partId, int triangleIndex) + virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex) { //do a swept sphere for now btTransform ident; @@ -269,7 +269,7 @@ float btConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(btBroadphaseProxy - if (triBody->m_collisionShape->IsConcave()) + if (triBody->m_collisionShape->isConcave()) { btVector3 rayAabbMin = convexFromLocal.getOrigin(); rayAabbMin.setMin(convexToLocal.getOrigin()); @@ -290,7 +290,7 @@ float btConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(btBroadphaseProxy if (triangleMesh) { - triangleMesh->ProcessAllTriangles(&raycastCallback,rayAabbMin,rayAabbMax); + triangleMesh->processAllTriangles(&raycastCallback,rayAabbMin,rayAabbMax); } diff --git a/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h b/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h index e73ed4dba..62bddb623 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h +++ b/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h @@ -25,7 +25,7 @@ class btDispatcher; #include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" #include "btCollisionCreateFunc.h" -///For each triangle in the concave mesh that overlaps with the AABB of a convex (m_convexProxy), ProcessTriangle is called. +///For each triangle in the concave mesh that overlaps with the AABB of a convex (m_convexProxy), processTriangle is called. class btConvexTriangleCallback : public btTriangleCallback { btBroadphaseProxy* m_convexProxy; @@ -45,19 +45,19 @@ int m_triangleCount; btConvexTriangleCallback(btDispatcher* dispatcher,btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); - void SetTimeStepAndCounters(float collisionMarginTriangle,const btDispatcherInfo& dispatchInfo); + void setTimeStepAndCounters(float collisionMarginTriangle,const btDispatcherInfo& dispatchInfo); virtual ~btConvexTriangleCallback(); - virtual void ProcessTriangle(btVector3* triangle, int partId, int triangleIndex); + virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex); - void ClearCache(); + void clearCache(); - inline const btVector3& GetAabbMin() const + inline const btVector3& getAabbMin() const { return m_aabbMin; } - inline const btVector3& GetAabbMax() const + inline const btVector3& getAabbMax() const { return m_aabbMax; } @@ -84,11 +84,11 @@ public: virtual ~btConvexConcaveCollisionAlgorithm(); - virtual void ProcessCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); + virtual void processCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); - float CalculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); + float calculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); - void ClearCache(); + void clearCache(); struct CreateFunc :public btCollisionAlgorithmCreateFunc { diff --git a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp index 12f5afffc..b03486903 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp @@ -91,12 +91,12 @@ m_ownManifold (false), m_manifoldPtr(mf), m_lowLevelOfDetail(false) { - CheckPenetrationDepthSolver(); + checkPenetrationDepthSolver(); { - if (!m_manifoldPtr && m_dispatcher->NeedsCollision(m_box0,m_box1)) + if (!m_manifoldPtr && m_dispatcher->needsCollision(m_box0,m_box1)) { - m_manifoldPtr = m_dispatcher->GetNewManifold(proxy0->m_clientObject,proxy1->m_clientObject); + m_manifoldPtr = m_dispatcher->getNewManifold(proxy0->m_clientObject,proxy1->m_clientObject); m_ownManifold = true; } } @@ -110,11 +110,11 @@ btConvexConvexAlgorithm::~btConvexConvexAlgorithm() if (m_ownManifold) { if (m_manifoldPtr) - m_dispatcher->ReleaseManifold(m_manifoldPtr); + m_dispatcher->releaseManifold(m_manifoldPtr); } } -void btConvexConvexAlgorithm ::SetLowLevelOfDetail(bool useLowLevel) +void btConvexConvexAlgorithm ::setLowLevelOfDetail(bool useLowLevel) { m_lowLevelOfDetail = useLowLevel; } @@ -133,11 +133,11 @@ public: } - virtual void AddContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth) + virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth) { btVector3 flippedNormal = -normalOnBInWorld; - m_org->AddContactPoint(flippedNormal,pointInWorld,depth); + m_org->addContactPoint(flippedNormal,pointInWorld,depth); } }; @@ -150,7 +150,7 @@ static btMinkowskiPenetrationDepthSolver gPenetrationDepthSolver; Solid3EpaPenetrationDepth gSolidEpaPenetrationSolver; #endif //USE_EPA -void btConvexConvexAlgorithm::CheckPenetrationDepthSolver() +void btConvexConvexAlgorithm::checkPenetrationDepthSolver() { if (m_useEpa != gUseEpa) { @@ -158,12 +158,12 @@ void btConvexConvexAlgorithm::CheckPenetrationDepthSolver() if (m_useEpa) { - // m_gjkPairDetector.SetPenetrationDepthSolver(&gEpaPenetrationDepthSolver); + // m_gjkPairDetector.setPenetrationDepthSolver(&gEpaPenetrationDepthSolver); } else { - m_gjkPairDetector.SetPenetrationDepthSolver(&gPenetrationDepthSolver); + m_gjkPairDetector.setPenetrationDepthSolver(&gPenetrationDepthSolver); } } @@ -219,7 +219,7 @@ public: //normalOnBInWorld.normalize(); btVector3 pointInWorld(positionsWorld[i].GetX(),positionsWorld[i].GetY(),positionsWorld[i].GetZ()); float depth = -depths[i]; - m_manifoldResult.AddContactPoint(normalOnBInWorld,pointInWorld,depth); + m_manifoldResult.addContactPoint(normalOnBInWorld,pointInWorld,depth); } return 0; @@ -237,17 +237,17 @@ public: // // Convex-Convex collision algorithm // -void btConvexConvexAlgorithm ::ProcessCollision (btBroadphaseProxy* ,btBroadphaseProxy* ,const btDispatcherInfo& dispatchInfo) +void btConvexConvexAlgorithm ::processCollision (btBroadphaseProxy* ,btBroadphaseProxy* ,const btDispatcherInfo& dispatchInfo) { if (!m_manifoldPtr) return; - CheckPenetrationDepthSolver(); + checkPenetrationDepthSolver(); -// printf("btConvexConvexAlgorithm::ProcessCollision\n"); +// printf("btConvexConvexAlgorithm::processCollision\n"); - bool needsCollision = m_dispatcher->NeedsCollision(m_box0,m_box1); + bool needsCollision = m_dispatcher->needsCollision(m_box0,m_box1); if (!needsCollision) return; @@ -259,8 +259,8 @@ void btConvexConvexAlgorithm ::ProcessCollision (btBroadphaseProxy* ,btBroadphas if (dispatchInfo.m_enableSatConvex) { - if ((col0->m_collisionShape->IsPolyhedral()) && - (col1->m_collisionShape->IsPolyhedral())) + if ((col0->m_collisionShape->isPolyhedral()) && + (col1->m_collisionShape->isPolyhedral())) { @@ -283,8 +283,8 @@ void btConvexConvexAlgorithm ::ProcessCollision (btBroadphaseProxy* ,btBroadphas Transform trB = GetTransformFrombtTransform(col1->m_worldTransform); //either use persistent manifold or clear it every time - m_dispatcher->ClearManifold(m_manifoldPtr); - btManifoldResult* resultOut = m_dispatcher->GetNewManifoldResult(col0,col1,m_manifoldPtr); + m_dispatcher->clearManifold(m_manifoldPtr); + btManifoldResult* resultOut = m_dispatcher->getNewManifoldResult(col0,col1,m_manifoldPtr); btManifoldResultCollector hullContactCollector(*resultOut); @@ -301,7 +301,7 @@ void btConvexConvexAlgorithm ::ProcessCollision (btBroadphaseProxy* ,btBroadphas #endif //USE_HULL - btManifoldResult* resultOut = m_dispatcher->GetNewManifoldResult(col0,col1,m_manifoldPtr); + btManifoldResult* resultOut = m_dispatcher->getNewManifoldResult(col0,col1,m_manifoldPtr); btConvexShape* min0 = static_cast(col0->m_collisionShape); btConvexShape* min1 = static_cast(col1->m_collisionShape); @@ -310,9 +310,9 @@ void btConvexConvexAlgorithm ::ProcessCollision (btBroadphaseProxy* ,btBroadphas //TODO: if (dispatchInfo.m_useContinuous) - m_gjkPairDetector.SetMinkowskiA(min0); - m_gjkPairDetector.SetMinkowskiB(min1); - input.m_maximumDistanceSquared = min0->GetMargin() + min1->GetMargin() + m_manifoldPtr->GetContactBreakingTreshold(); + m_gjkPairDetector.setMinkowskiA(min0); + m_gjkPairDetector.setMinkowskiB(min1); + input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactBreakingTreshold(); input.m_maximumDistanceSquared*= input.m_maximumDistanceSquared; // input.m_maximumDistanceSquared = 1e30f; @@ -320,15 +320,15 @@ void btConvexConvexAlgorithm ::ProcessCollision (btBroadphaseProxy* ,btBroadphas input.m_transformA = col0->m_worldTransform; input.m_transformB = col1->m_worldTransform; - m_gjkPairDetector.GetClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw); + m_gjkPairDetector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw); - m_dispatcher->ReleaseManifoldResult(resultOut); + m_dispatcher->releaseManifoldResult(resultOut); } bool disableCcd = false; -float btConvexConvexAlgorithm::CalculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) +float btConvexConvexAlgorithm::calculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) { ///Rather then checking ALL pairs, only calculate TOI when motion exceeds treshold @@ -350,7 +350,7 @@ float btConvexConvexAlgorithm::CalculateTimeOfImpact(btBroadphaseProxy* proxy0,b if (disableCcd) return 1.f; - CheckPenetrationDepthSolver(); + checkPenetrationDepthSolver(); //An adhoc way of testing the Continuous Collision Detection algorithms //One object is approximated as a sphere, to simplify things @@ -358,7 +358,7 @@ float btConvexConvexAlgorithm::CalculateTimeOfImpact(btBroadphaseProxy* proxy0,b //For proper CCD, better accuracy and handling of 'allowed' penetration should be added //also the mainloop of the physics should have a kind of toi queue (something like Brian Mirtich's application of Timewarp for Rigidbodies) - bool needsCollision = m_dispatcher->NeedsCollision(m_box0,m_box1); + bool needsCollision = m_dispatcher->needsCollision(m_box0,m_box1); if (!needsCollision) return 1.f; diff --git a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h index cae7e055d..7942ba682 100644 --- a/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h +++ b/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h @@ -40,7 +40,7 @@ public: btPersistentManifold* m_manifoldPtr; bool m_lowLevelOfDetail; - void CheckPenetrationDepthSolver(); + void checkPenetrationDepthSolver(); @@ -50,13 +50,13 @@ public: virtual ~btConvexConvexAlgorithm(); - virtual void ProcessCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); + virtual void processCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); - virtual float CalculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); + virtual float calculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); - void SetLowLevelOfDetail(bool useLowLevel); + void setLowLevelOfDetail(bool useLowLevel); - virtual void SetShapeIdentifiers(int partId0,int index0, int partId1,int index1) + virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1) { m_gjkPairDetector.m_partId0=partId0; m_gjkPairDetector.m_partId1=partId1; @@ -64,7 +64,7 @@ public: m_gjkPairDetector.m_index1=index1; } - const btPersistentManifold* GetManifold() + const btPersistentManifold* getManifold() { return m_manifoldPtr; } diff --git a/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp index 0b45f26a6..0e0f4a338 100644 --- a/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp @@ -22,12 +22,12 @@ btEmptyAlgorithm::btEmptyAlgorithm(const btCollisionAlgorithmConstructionInfo& c { } -void btEmptyAlgorithm::ProcessCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) +void btEmptyAlgorithm::processCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) { } -float btEmptyAlgorithm::CalculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) +float btEmptyAlgorithm::calculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) { return 1.f; } diff --git a/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h b/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h index 33606ddd3..8561cbfc8 100644 --- a/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h +++ b/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h @@ -29,9 +29,9 @@ public: btEmptyAlgorithm(const btCollisionAlgorithmConstructionInfo& ci); - virtual void ProcessCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); + virtual void processCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); - virtual float CalculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); + virtual float calculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); struct CreateFunc :public btCollisionAlgorithmCreateFunc { diff --git a/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp b/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp index 589efd708..1156e36a2 100644 --- a/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp +++ b/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp @@ -51,9 +51,9 @@ btManifoldResult::btManifoldResult(btCollisionObject* body0,btCollisionObject* b } -void btManifoldResult::AddContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth) +void btManifoldResult::addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth) { - if (depth > m_manifoldPtr->GetContactBreakingTreshold()) + if (depth > m_manifoldPtr->getContactBreakingTreshold()) return; @@ -69,14 +69,14 @@ void btManifoldResult::AddContactPoint(const btVector3& normalOnBInWorld,const b - int insertIndex = m_manifoldPtr->GetCacheEntry(newPt); + int insertIndex = m_manifoldPtr->getCacheEntry(newPt); if (insertIndex >= 0) { // This is not needed, just use the old info! -// const btManifoldPoint& oldPoint = m_manifoldPtr->GetContactPoint(insertIndex); +// const btManifoldPoint& oldPoint = m_manifoldPtr->getContactPoint(insertIndex); // newPt.CopyPersistentInformation(oldPoint); -// m_manifoldPtr->ReplaceContactPoint(newPt,insertIndex); +// m_manifoldPtr->replaceContactPoint(newPt,insertIndex); } else diff --git a/src/BulletCollision/CollisionDispatch/btManifoldResult.h b/src/BulletCollision/CollisionDispatch/btManifoldResult.h index 8e6980422..bf6e54535 100644 --- a/src/BulletCollision/CollisionDispatch/btManifoldResult.h +++ b/src/BulletCollision/CollisionDispatch/btManifoldResult.h @@ -43,7 +43,7 @@ public: virtual ~btManifoldResult() {}; - virtual void SetShapeIdentifiers(int partId0,int index0, int partId1,int index1) + virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1) { m_partId0=partId0; m_partId1=partId1; @@ -51,7 +51,7 @@ public: m_index1=index1; } - virtual void AddContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth); + virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth); diff --git a/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp b/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp index 48ad8fa80..cce334d36 100644 --- a/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp +++ b/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp @@ -18,23 +18,23 @@ btSimulationIslandManager::~btSimulationIslandManager() } -void btSimulationIslandManager::InitUnionFind(int n) +void btSimulationIslandManager::initUnionFind(int n) { m_unionFind.reset(n); } -void btSimulationIslandManager::FindUnions(btDispatcher* dispatcher) +void btSimulationIslandManager::findUnions(btDispatcher* dispatcher) { { - for (int i=0;iGetNumManifolds();i++) + for (int i=0;igetNumManifolds();i++) { - const btPersistentManifold* manifold = dispatcher->GetManifoldByIndexInternal(i); + const btPersistentManifold* manifold = dispatcher->getManifoldByIndexInternal(i); //static objects (invmass 0.f) don't merge ! - const btCollisionObject* colObj0 = static_cast(manifold->GetBody0()); - const btCollisionObject* colObj1 = static_cast(manifold->GetBody1()); + const btCollisionObject* colObj0 = static_cast(manifold->getBody0()); + const btCollisionObject* colObj1 = static_cast(manifold->getBody1()); if (((colObj0) && ((colObj0)->mergesSimulationIslands())) && ((colObj1) && ((colObj1)->mergesSimulationIslands()))) @@ -48,18 +48,18 @@ void btSimulationIslandManager::FindUnions(btDispatcher* dispatcher) } -void btSimulationIslandManager::UpdateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher) +void btSimulationIslandManager::updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher) { - InitUnionFind(colWorld->GetCollisionObjectArray().size()); + initUnionFind(colWorld->getCollisionObjectArray().size()); // put the index into m_controllers into m_tag { std::vector::iterator i; int index = 0; - for (i=colWorld->GetCollisionObjectArray().begin(); - !(i==colWorld->GetCollisionObjectArray().end()); i++) + for (i=colWorld->getCollisionObjectArray().begin(); + !(i==colWorld->getCollisionObjectArray().end()); i++) { btCollisionObject* collisionObject= (*i); @@ -71,7 +71,7 @@ void btSimulationIslandManager::UpdateActivationState(btCollisionWorld* colWorld } // do the union find - FindUnions(dispatcher); + findUnions(dispatcher); @@ -80,7 +80,7 @@ void btSimulationIslandManager::UpdateActivationState(btCollisionWorld* colWorld -void btSimulationIslandManager::StoreIslandActivationState(btCollisionWorld* colWorld) +void btSimulationIslandManager::storeIslandActivationState(btCollisionWorld* colWorld) { // put the islandId ('find' value) into m_tag { @@ -89,8 +89,8 @@ void btSimulationIslandManager::StoreIslandActivationState(btCollisionWorld* col std::vector::iterator i; int index = 0; - for (i=colWorld->GetCollisionObjectArray().begin(); - !(i==colWorld->GetCollisionObjectArray().end()); i++) + for (i=colWorld->getCollisionObjectArray().begin(); + !(i==colWorld->getCollisionObjectArray().end()); i++) { btCollisionObject* collisionObject= (*i); @@ -109,8 +109,8 @@ void btSimulationIslandManager::StoreIslandActivationState(btCollisionWorld* col inline int getIslandId(const btPersistentManifold* lhs) { int islandId; - const btCollisionObject* rcolObj0 = static_cast(lhs->GetBody0()); - const btCollisionObject* rcolObj1 = static_cast(lhs->GetBody1()); + const btCollisionObject* rcolObj0 = static_cast(lhs->getBody0()); + const btCollisionObject* rcolObj1 = static_cast(lhs->getBody1()); islandId= rcolObj0->m_islandTag1>=0?rcolObj0->m_islandTag1:rcolObj1->m_islandTag1; return islandId; @@ -128,21 +128,21 @@ bool btPersistentManifoldSortPredicate(const btPersistentManifold* lhs, const bt // // todo: this is random access, it can be walked 'cache friendly'! // -void btSimulationIslandManager::BuildAndProcessIslands(btDispatcher* dispatcher,btCollisionObjectArray& collisionObjects, IslandCallback* callback) +void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,btCollisionObjectArray& collisionObjects, IslandCallback* callback) { //we are going to sort the unionfind array, and store the element id in the size //afterwards, we clean unionfind, to make sure no-one uses it anymore - GetUnionFind().sortIslands(); - int numElem = GetUnionFind().getNumElements(); + getUnionFind().sortIslands(); + int numElem = getUnionFind().getNumElements(); int endIslandIndex=1; //update the sleeping state for bodies, if all are sleeping for (int startIslandIndex=0;startIslandIndexm_islandTag1 != islandId) && (colObj0->m_islandTag1 != -1)) @@ -180,7 +180,7 @@ void btSimulationIslandManager::BuildAndProcessIslands(btDispatcher* dispatcher, int idx; for (idx=startIslandIndex;idxm_islandTag1 != islandId) && (colObj0->m_islandTag1 != -1)) { @@ -200,7 +200,7 @@ void btSimulationIslandManager::BuildAndProcessIslands(btDispatcher* dispatcher, int idx; for (idx=startIslandIndex;idxm_islandTag1 != islandId) && (colObj0->m_islandTag1 != -1)) @@ -223,22 +223,22 @@ void btSimulationIslandManager::BuildAndProcessIslands(btDispatcher* dispatcher, std::vector islandmanifold; int i; - int maxNumManifolds = dispatcher->GetNumManifolds(); + int maxNumManifolds = dispatcher->getNumManifolds(); islandmanifold.reserve(maxNumManifolds); for (i=0;iGetManifoldByIndexInternal(i); + btPersistentManifold* manifold = dispatcher->getManifoldByIndexInternal(i); - btCollisionObject* colObj0 = static_cast(manifold->GetBody0()); - btCollisionObject* colObj1 = static_cast(manifold->GetBody1()); + btCollisionObject* colObj0 = static_cast(manifold->getBody0()); + btCollisionObject* colObj1 = static_cast(manifold->getBody1()); //todo: check sleeping conditions! if (((colObj0) && colObj0->GetActivationState() != ISLAND_SLEEPING) || ((colObj1) && colObj1->GetActivationState() != ISLAND_SLEEPING)) { //filtering for response - if (dispatcher->NeedsResponse(*colObj0,*colObj1)) + if (dispatcher->needsResponse(*colObj0,*colObj1)) islandmanifold.push_back(manifold); } } diff --git a/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h b/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h index 6a28a960c..6f55e2476 100644 --- a/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h +++ b/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h @@ -32,16 +32,16 @@ public: virtual ~btSimulationIslandManager(); - void InitUnionFind(int n); + void initUnionFind(int n); - btUnionFind& GetUnionFind() { return m_unionFind;} + btUnionFind& getUnionFind() { return m_unionFind;} - virtual void UpdateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher); - virtual void StoreIslandActivationState(btCollisionWorld* world); + virtual void updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher); + virtual void storeIslandActivationState(btCollisionWorld* world); - void FindUnions(btDispatcher* dispatcher); + void findUnions(btDispatcher* dispatcher); @@ -52,7 +52,7 @@ public: virtual void ProcessIsland(class btPersistentManifold** manifolds,int numManifolds) = 0; }; - void BuildAndProcessIslands(btDispatcher* dispatcher,btCollisionObjectArray& collisionObjects, IslandCallback* callback); + void buildAndProcessIslands(btDispatcher* dispatcher,btCollisionObjectArray& collisionObjects, IslandCallback* callback); }; diff --git a/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp index 09a4f15b8..9fe82da79 100644 --- a/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp @@ -23,9 +23,9 @@ btSphereSphereCollisionAlgorithm::btSphereSphereCollisionAlgorithm(btPersistentM m_ownManifold(false), m_manifoldPtr(mf) { - if (!m_manifoldPtr && m_dispatcher->NeedsCollision(*proxy0,*proxy1)) + if (!m_manifoldPtr && m_dispatcher->needsCollision(*proxy0,*proxy1)) { - m_manifoldPtr = m_dispatcher->GetNewManifold(proxy0->m_clientObject,proxy1->m_clientObject); + m_manifoldPtr = m_dispatcher->getNewManifold(proxy0->m_clientObject,proxy1->m_clientObject); m_ownManifold = true; } } @@ -35,11 +35,11 @@ btSphereSphereCollisionAlgorithm::~btSphereSphereCollisionAlgorithm() if (m_ownManifold) { if (m_manifoldPtr) - m_dispatcher->ReleaseManifold(m_manifoldPtr); + m_dispatcher->releaseManifold(m_manifoldPtr); } } -void btSphereSphereCollisionAlgorithm::ProcessCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) +void btSphereSphereCollisionAlgorithm::processCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) { if (!m_manifoldPtr) return; @@ -51,8 +51,8 @@ void btSphereSphereCollisionAlgorithm::ProcessCollision (btBroadphaseProxy* prox btVector3 diff = col0->m_worldTransform.getOrigin()- col1->m_worldTransform.getOrigin(); float len = diff.length(); - btScalar radius0 = sphere0->GetRadius(); - btScalar radius1 = sphere1->GetRadius(); + btScalar radius0 = sphere0->getRadius(); + btScalar radius1 = sphere1->getRadius(); ///iff distance positive, don't generate a new contact if ( len > (radius0+radius1)) @@ -68,13 +68,13 @@ void btSphereSphereCollisionAlgorithm::ProcessCollision (btBroadphaseProxy* prox btVector3 pos1 = col1->m_worldTransform.getOrigin() + radius1* normalOnSurfaceB; /// report a contact. internally this will be kept persistent, and contact reduction is done - btManifoldResult* resultOut = m_dispatcher->GetNewManifoldResult(col0,col1,m_manifoldPtr); - resultOut->AddContactPoint(normalOnSurfaceB,pos1,dist); - m_dispatcher->ReleaseManifoldResult(resultOut); + btManifoldResult* resultOut = m_dispatcher->getNewManifoldResult(col0,col1,m_manifoldPtr); + resultOut->addContactPoint(normalOnSurfaceB,pos1,dist); + m_dispatcher->releaseManifoldResult(resultOut); } -float btSphereSphereCollisionAlgorithm::CalculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) +float btSphereSphereCollisionAlgorithm::calculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo) { //not yet return 1.f; diff --git a/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h b/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h index d0a1a75c0..588dcb0c1 100644 --- a/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h +++ b/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h @@ -33,9 +33,9 @@ public: btSphereSphereCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci) : btCollisionAlgorithm(ci) {} - virtual void ProcessCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); + virtual void processCollision (btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); - virtual float CalculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); + virtual float calculateTimeOfImpact(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,const btDispatcherInfo& dispatchInfo); btSphereSphereCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); diff --git a/src/BulletCollision/CollisionDispatch/btUnionFind.cpp b/src/BulletCollision/CollisionDispatch/btUnionFind.cpp index 7a71d479a..046f348a1 100644 --- a/src/BulletCollision/CollisionDispatch/btUnionFind.cpp +++ b/src/BulletCollision/CollisionDispatch/btUnionFind.cpp @@ -30,7 +30,7 @@ btUnionFind::btUnionFind() } -void btUnionFind::Allocate(int N) +void btUnionFind::allocate(int N) { m_elements.resize(N); } @@ -42,7 +42,7 @@ void btUnionFind::Free() void btUnionFind::reset(int N) { - Allocate(N); + allocate(N); for (int i = 0; i < N; i++) { diff --git a/src/BulletCollision/CollisionDispatch/btUnionFind.h b/src/BulletCollision/CollisionDispatch/btUnionFind.h index 2afe01c16..8db1580e4 100644 --- a/src/BulletCollision/CollisionDispatch/btUnionFind.h +++ b/src/BulletCollision/CollisionDispatch/btUnionFind.h @@ -61,7 +61,7 @@ class btUnionFind return m_elements[index]; } - void Allocate(int N); + void allocate(int N); void Free(); diff --git a/src/BulletCollision/CollisionShapes/btBoxShape.cpp b/src/BulletCollision/CollisionShapes/btBoxShape.cpp index f08b6248b..cb14caa64 100644 --- a/src/BulletCollision/CollisionShapes/btBoxShape.cpp +++ b/src/BulletCollision/CollisionShapes/btBoxShape.cpp @@ -15,23 +15,23 @@ subject to the following restrictions: #include "btBoxShape.h" -btVector3 btBoxShape::GetHalfExtents() const +btVector3 btBoxShape::getHalfExtents() const { return m_boxHalfExtents1 * m_localScaling; } //{ -void btBoxShape::GetAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const +void btBoxShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const { - btVector3 halfExtents = GetHalfExtents(); + btVector3 halfExtents = getHalfExtents(); btMatrix3x3 abs_b = t.getBasis().absolute(); btPoint3 center = t.getOrigin(); btVector3 extent = btVector3(abs_b[0].dot(halfExtents), abs_b[1].dot(halfExtents), abs_b[2].dot(halfExtents)); - extent += btVector3(GetMargin(),GetMargin(),GetMargin()); + extent += btVector3(getMargin(),getMargin(),getMargin()); aabbMin = center - extent; aabbMax = center + extent; @@ -40,10 +40,10 @@ void btBoxShape::GetAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabb } -void btBoxShape::CalculateLocalInertia(btScalar mass,btVector3& inertia) +void btBoxShape::calculateLocalInertia(btScalar mass,btVector3& inertia) { //float margin = 0.f; - btVector3 halfExtents = GetHalfExtents(); + btVector3 halfExtents = getHalfExtents(); btScalar lx=2.f*(halfExtents.x()); btScalar ly=2.f*(halfExtents.y()); diff --git a/src/BulletCollision/CollisionShapes/btBoxShape.h b/src/BulletCollision/CollisionShapes/btBoxShape.h index dc4990894..76aa9224f 100644 --- a/src/BulletCollision/CollisionShapes/btBoxShape.h +++ b/src/BulletCollision/CollisionShapes/btBoxShape.h @@ -31,18 +31,18 @@ class btBoxShape: public btPolyhedralConvexShape public: - btVector3 GetHalfExtents() const; + btVector3 getHalfExtents() const; //{ return m_boxHalfExtents1 * m_localScaling;} - //const btVector3& GetHalfExtents() const{ return m_boxHalfExtents1;} + //const btVector3& getHalfExtents() const{ return m_boxHalfExtents1;} - virtual int GetShapeType() const { return BOX_SHAPE_PROXYTYPE;} + virtual int getShapeType() const { return BOX_SHAPE_PROXYTYPE;} - virtual btVector3 LocalGetSupportingVertex(const btVector3& vec) const + virtual btVector3 localGetSupportingVertex(const btVector3& vec) const { - btVector3 halfExtents = GetHalfExtents(); + btVector3 halfExtents = getHalfExtents(); btVector3 supVertex; supVertex = btPoint3(vec.x() < btScalar(0.0f) ? -halfExtents.x() : halfExtents.x(), @@ -52,10 +52,10 @@ public: return supVertex; } - virtual inline btVector3 LocalGetSupportingVertexWithoutMargin(const btVector3& vec)const + virtual inline btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const { - btVector3 halfExtents = GetHalfExtents(); - btVector3 margin(GetMargin(),GetMargin(),GetMargin()); + btVector3 halfExtents = getHalfExtents(); + btVector3 margin(getMargin(),getMargin(),getMargin()); halfExtents -= margin; return btVector3(vec.x() < btScalar(0.0f) ? -halfExtents.x() : halfExtents.x(), @@ -63,10 +63,10 @@ public: vec.z() < btScalar(0.0f) ? -halfExtents.z() : halfExtents.z()); } - virtual void BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const { - btVector3 halfExtents = GetHalfExtents(); - btVector3 margin(GetMargin(),GetMargin(),GetMargin()); + btVector3 halfExtents = getHalfExtents(); + btVector3 margin(getMargin(),getMargin(),getMargin()); halfExtents -= margin; @@ -83,41 +83,41 @@ public: btBoxShape( const btVector3& boxHalfExtents) : m_boxHalfExtents1(boxHalfExtents){}; - virtual void GetAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; + virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; - virtual void CalculateLocalInertia(btScalar mass,btVector3& inertia); + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia); - virtual void GetPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const + virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const { //this plane might not be aligned... btVector4 plane ; - GetPlaneEquation(plane,i); + getPlaneEquation(plane,i); planeNormal = btVector3(plane.getX(),plane.getY(),plane.getZ()); - planeSupport = LocalGetSupportingVertex(-planeNormal); + planeSupport = localGetSupportingVertex(-planeNormal); } - virtual int GetNumPlanes() const + virtual int getNumPlanes() const { return 6; } - virtual int GetNumVertices() const + virtual int getNumVertices() const { return 8; } - virtual int GetNumEdges() const + virtual int getNumEdges() const { return 12; } - virtual void GetVertex(int i,btVector3& vtx) const + virtual void getVertex(int i,btVector3& vtx) const { - btVector3 halfExtents = GetHalfExtents(); + btVector3 halfExtents = getHalfExtents(); vtx = btVector3( halfExtents.x() * (1-(i&1)) - halfExtents.x() * (i&1), @@ -126,9 +126,9 @@ public: } - virtual void GetPlaneEquation(btVector4& plane,int i) const + virtual void getPlaneEquation(btVector4& plane,int i) const { - btVector3 halfExtents = GetHalfExtents(); + btVector3 halfExtents = getHalfExtents(); switch (i) { @@ -162,8 +162,8 @@ public: } - virtual void GetEdge(int i,btPoint3& pa,btPoint3& pb) const - //virtual void GetEdge(int i,Edge& edge) const + virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const + //virtual void getEdge(int i,Edge& edge) const { int edgeVert0 = 0; int edgeVert1 = 0; @@ -225,17 +225,17 @@ public: } - GetVertex(edgeVert0,pa ); - GetVertex(edgeVert1,pb ); + getVertex(edgeVert0,pa ); + getVertex(edgeVert1,pb ); } - virtual bool IsInside(const btPoint3& pt,btScalar tolerance) const + virtual bool isInside(const btPoint3& pt,btScalar tolerance) const { - btVector3 halfExtents = GetHalfExtents(); + btVector3 halfExtents = getHalfExtents(); //btScalar minDist = 2*tolerance; @@ -251,7 +251,7 @@ public: //debugging - virtual char* GetName()const + virtual char* getName()const { return "Box"; } diff --git a/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp b/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp index cc8f734e2..338527d58 100644 --- a/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp +++ b/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp @@ -28,7 +28,7 @@ btBvhTriangleMeshShape::btBvhTriangleMeshShape(btStridingMeshInterface* meshInte #ifndef DISABLE_BVH m_bvh = new btOptimizedBvh(); - m_bvh->Build(meshInterface); + m_bvh->build(meshInterface); #endif //DISABLE_BVH @@ -40,12 +40,12 @@ btBvhTriangleMeshShape::~btBvhTriangleMeshShape() } //perform bvh tree traversal and report overlapping triangles to 'callback' -void btBvhTriangleMeshShape::ProcessAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const +void btBvhTriangleMeshShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const { #ifdef DISABLE_BVH //brute force traverse all triangles - btTriangleMeshShape::ProcessAllTriangles(callback,aabbMin,aabbMax); + btTriangleMeshShape::processAllTriangles(callback,aabbMin,aabbMax); #else //first get all the nodes @@ -64,7 +64,7 @@ void btBvhTriangleMeshShape::ProcessAllTriangles(btTriangleCallback* callback,co { } - virtual void ProcessNode(const btOptimizedBvhNode* node) + virtual void processNode(const btOptimizedBvhNode* node) { const unsigned char *vertexbase; int numverts; @@ -108,7 +108,7 @@ void btBvhTriangleMeshShape::ProcessAllTriangles(btTriangleCallback* callback,co #endif //DEBUG_TRIANGLE_MESH } - m_callback->ProcessTriangle(m_triangle,node->m_subPart,node->m_triangleIndex); + m_callback->processTriangle(m_triangle,node->m_subPart,node->m_triangleIndex); m_meshInterface->unLockReadOnlyVertexBase(node->m_subPart); } @@ -116,7 +116,7 @@ void btBvhTriangleMeshShape::ProcessAllTriangles(btTriangleCallback* callback,co MyNodeOverlapCallback myNodeCallback(callback,m_meshInterface); - m_bvh->ReportAabbOverlappingNodex(&myNodeCallback,aabbMin,aabbMax); + m_bvh->reportAabbOverlappingNodex(&myNodeCallback,aabbMin,aabbMax); #endif//DISABLE_BVH @@ -132,7 +132,7 @@ void btBvhTriangleMeshShape::setLocalScaling(const btVector3& scaling) btTriangleMeshShape::setLocalScaling(scaling); delete m_bvh; m_bvh = new btOptimizedBvh(); - m_bvh->Build(m_meshInterface); + m_bvh->build(m_meshInterface); //rebuild the bvh... } } diff --git a/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h b/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h index 6e1d23b2f..59a27e864 100644 --- a/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h +++ b/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h @@ -34,7 +34,7 @@ public: /* - virtual int GetShapeType() const + virtual int getShapeType() const { return TRIANGLE_MESH_SHAPE_PROXYTYPE; } @@ -42,11 +42,11 @@ public: - virtual void ProcessAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const; + virtual void processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const; //debugging - virtual char* GetName()const {return "BVHTRIANGLEMESH";} + virtual char* getName()const {return "BVHTRIANGLEMESH";} virtual void setLocalScaling(const btVector3& scaling); diff --git a/src/BulletCollision/CollisionShapes/btCollisionShape.cpp b/src/BulletCollision/CollisionShapes/btCollisionShape.cpp index 42d73cf9f..5474a201c 100644 --- a/src/BulletCollision/CollisionShapes/btCollisionShape.cpp +++ b/src/BulletCollision/CollisionShapes/btCollisionShape.cpp @@ -15,31 +15,31 @@ subject to the following restrictions: #include "BulletCollision/CollisionShapes/btCollisionShape.h" -void btCollisionShape::GetBoundingSphere(btVector3& center,btScalar& radius) const +void btCollisionShape::getBoundingSphere(btVector3& center,btScalar& radius) const { btTransform tr; tr.setIdentity(); btVector3 aabbMin,aabbMax; - GetAabb(tr,aabbMin,aabbMax); + getAabb(tr,aabbMin,aabbMax); radius = (aabbMax-aabbMin).length()*0.5f; center = (aabbMin+aabbMax)*0.5f; } -float btCollisionShape::GetAngularMotionDisc() const +float btCollisionShape::getAngularMotionDisc() const { btVector3 center; float disc; - GetBoundingSphere(center,disc); + getBoundingSphere(center,disc); disc += (center).length(); return disc; } -void btCollisionShape::CalculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax) +void btCollisionShape::calculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax) { //start with static aabb - GetAabb(curTrans,temporalAabbMin,temporalAabbMax); + getAabb(curTrans,temporalAabbMin,temporalAabbMax); float temporalAabbMaxx = temporalAabbMax.getX(); float temporalAabbMaxy = temporalAabbMax.getY(); @@ -65,7 +65,7 @@ void btCollisionShape::CalculateTemporalAabb(const btTransform& curTrans,const b temporalAabbMinz += linMotion.z(); //add conservative angular motion - btScalar angularMotion = angvel.length() * GetAngularMotionDisc() * timeStep; + btScalar angularMotion = angvel.length() * getAngularMotionDisc() * timeStep; btVector3 angularMotion3d(angularMotion,angularMotion,angularMotion); temporalAabbMin = btVector3(temporalAabbMinx,temporalAabbMiny,temporalAabbMinz); temporalAabbMax = btVector3(temporalAabbMaxx,temporalAabbMaxy,temporalAabbMaxz); diff --git a/src/BulletCollision/CollisionShapes/btCollisionShape.h b/src/BulletCollision/CollisionShapes/btCollisionShape.h index 291a49220..393a76026 100644 --- a/src/BulletCollision/CollisionShapes/btCollisionShape.h +++ b/src/BulletCollision/CollisionShapes/btCollisionShape.h @@ -34,50 +34,50 @@ public: { } - virtual void GetAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const =0; + virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const =0; - virtual void GetBoundingSphere(btVector3& center,btScalar& radius) const; + virtual void getBoundingSphere(btVector3& center,btScalar& radius) const; - virtual float GetAngularMotionDisc() const; + virtual float getAngularMotionDisc() const; - virtual int GetShapeType() const=0; + virtual int getShapeType() const=0; - ///CalculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0..timeStep) + ///calculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0..timeStep) ///result is conservative - void CalculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax); + void calculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax); - inline bool IsPolyhedral() const + inline bool isPolyhedral() const { - return btBroadphaseProxy::IsPolyhedral(GetShapeType()); + return btBroadphaseProxy::isPolyhedral(getShapeType()); } - inline bool IsConvex() const + inline bool isConvex() const { - return btBroadphaseProxy::IsConvex(GetShapeType()); + return btBroadphaseProxy::isConvex(getShapeType()); } - inline bool IsConcave() const + inline bool isConcave() const { - return btBroadphaseProxy::IsConcave(GetShapeType()); + return btBroadphaseProxy::isConcave(getShapeType()); } - inline bool IsCompound() const + inline bool isCompound() const { - return btBroadphaseProxy::IsCompound(GetShapeType()); + return btBroadphaseProxy::isCompound(getShapeType()); } virtual void setLocalScaling(const btVector3& scaling) =0; virtual const btVector3& getLocalScaling() const =0; - virtual void CalculateLocalInertia(btScalar mass,btVector3& inertia) = 0; + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) = 0; //debugging support - virtual char* GetName()const =0 ; - const char* GetExtraDebugInfo() const { return m_tempDebug;} - void SetExtraDebugInfo(const char* extraDebugInfo) { m_tempDebug = extraDebugInfo;} + virtual char* getName()const =0 ; + const char* getExtraDebugInfo() const { return m_tempDebug;} + void setExtraDebugInfo(const char* extraDebugInfo) { m_tempDebug = extraDebugInfo;} const char * m_tempDebug; //endif debugging support - virtual void SetMargin(float margin) = 0; - virtual float GetMargin() const = 0; + virtual void setMargin(float margin) = 0; + virtual float getMargin() const = 0; }; diff --git a/src/BulletCollision/CollisionShapes/btCompoundShape.cpp b/src/BulletCollision/CollisionShapes/btCompoundShape.cpp index a4453a3ae..88ae8c7df 100644 --- a/src/BulletCollision/CollisionShapes/btCompoundShape.cpp +++ b/src/BulletCollision/CollisionShapes/btCompoundShape.cpp @@ -33,14 +33,14 @@ btCompoundShape::~btCompoundShape() { } -void btCompoundShape::AddChildShape(const btTransform& localTransform,btCollisionShape* shape) +void btCompoundShape::addChildShape(const btTransform& localTransform,btCollisionShape* shape) { m_childTransforms.push_back(localTransform); m_childShapes.push_back(shape); //extend the local aabbMin/aabbMax btVector3 localAabbMin,localAabbMax; - shape->GetAabb(localTransform,localAabbMin,localAabbMax); + shape->getAabb(localTransform,localAabbMin,localAabbMax); for (int i=0;i<3;i++) { if (m_localAabbMin[i] > localAabbMin[i]) @@ -57,8 +57,8 @@ void btCompoundShape::AddChildShape(const btTransform& localTransform,btCollisio - ///GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version -void btCompoundShape::GetAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const + ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version +void btCompoundShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const { btVector3 localHalfExtents = 0.5f*(m_localAabbMax-m_localAabbMin); btVector3 localCenter = 0.5f*(m_localAabbMax+m_localAabbMin); @@ -70,19 +70,19 @@ void btCompoundShape::GetAabb(const btTransform& trans,btVector3& aabbMin,btVect btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents), abs_b[1].dot(localHalfExtents), abs_b[2].dot(localHalfExtents)); - extent += btVector3(GetMargin(),GetMargin(),GetMargin()); + extent += btVector3(getMargin(),getMargin(),getMargin()); aabbMin = center - extent; aabbMax = center + extent; } -void btCompoundShape::CalculateLocalInertia(btScalar mass,btVector3& inertia) +void btCompoundShape::calculateLocalInertia(btScalar mass,btVector3& inertia) { //approximation: take the inertia from the aabb for now btTransform ident; ident.setIdentity(); btVector3 aabbMin,aabbMax; - GetAabb(ident,aabbMin,aabbMax); + getAabb(ident,aabbMin,aabbMax); btVector3 halfExtents = (aabbMax-aabbMin)*0.5f; diff --git a/src/BulletCollision/CollisionShapes/btCompoundShape.h b/src/BulletCollision/CollisionShapes/btCompoundShape.h index a2428b263..65a6809d4 100644 --- a/src/BulletCollision/CollisionShapes/btCompoundShape.h +++ b/src/BulletCollision/CollisionShapes/btCompoundShape.h @@ -42,33 +42,33 @@ public: virtual ~btCompoundShape(); - void AddChildShape(const btTransform& localTransform,btCollisionShape* shape); + void addChildShape(const btTransform& localTransform,btCollisionShape* shape); - int GetNumChildShapes() const + int getNumChildShapes() const { return m_childShapes.size(); } - btCollisionShape* GetChildShape(int index) + btCollisionShape* getChildShape(int index) { return m_childShapes[index]; } - const btCollisionShape* GetChildShape(int index) const + const btCollisionShape* getChildShape(int index) const { return m_childShapes[index]; } - btTransform GetChildTransform(int index) + btTransform getChildTransform(int index) { return m_childTransforms[index]; } - const btTransform GetChildTransform(int index) const + const btTransform getChildTransform(int index) const { return m_childTransforms[index]; } - ///GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version - void GetAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; + ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version + void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; virtual void setLocalScaling(const btVector3& scaling) @@ -80,27 +80,27 @@ public: return m_localScaling; } - virtual void CalculateLocalInertia(btScalar mass,btVector3& inertia); + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia); - virtual int GetShapeType() const { return COMPOUND_SHAPE_PROXYTYPE;} + virtual int getShapeType() const { return COMPOUND_SHAPE_PROXYTYPE;} - virtual void SetMargin(float margin) + virtual void setMargin(float margin) { m_collisionMargin = margin; } - virtual float GetMargin() const + virtual float getMargin() const { return m_collisionMargin; } - virtual char* GetName()const + virtual char* getName()const { return "Compound"; } //this is optional, but should make collision queries faster, by culling non-overlapping nodes - void CreateAabbTreeFromChildren(); + void createAabbTreeFromChildren(); - const btOptimizedBvh* GetAabbTree() const + const btOptimizedBvh* getAabbTree() const { return m_aabbTree; } diff --git a/src/BulletCollision/CollisionShapes/btConcaveShape.h b/src/BulletCollision/CollisionShapes/btConcaveShape.h index 7e6816011..304654531 100644 --- a/src/BulletCollision/CollisionShapes/btConcaveShape.h +++ b/src/BulletCollision/CollisionShapes/btConcaveShape.h @@ -34,12 +34,12 @@ public: virtual ~ConcaveShape(); - virtual void ProcessAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const = 0; + virtual void processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const = 0; - virtual float GetMargin() const { + virtual float getMargin() const { return m_collisionMargin; } - virtual void SetMargin(float collisionMargin) + virtual void setMargin(float collisionMargin) { m_collisionMargin = collisionMargin; } diff --git a/src/BulletCollision/CollisionShapes/btConeShape.cpp b/src/BulletCollision/CollisionShapes/btConeShape.cpp index c87abacbc..13875fc5f 100644 --- a/src/BulletCollision/CollisionShapes/btConeShape.cpp +++ b/src/BulletCollision/CollisionShapes/btConeShape.cpp @@ -31,7 +31,7 @@ m_height(height) } -btVector3 btConeShape::ConeLocalSupport(const btVector3& v) const +btVector3 btConeShape::coneLocalSupport(const btVector3& v) const { float halfHeight = m_height * 0.5f; @@ -66,25 +66,25 @@ btVector3 btConeShape::ConeLocalSupport(const btVector3& v) const } -btVector3 btConeShape::LocalGetSupportingVertexWithoutMargin(const btVector3& vec) const +btVector3 btConeShape::localGetSupportingVertexWithoutMargin(const btVector3& vec) const { - return ConeLocalSupport(vec); + return coneLocalSupport(vec); } -void btConeShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +void btConeShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const { for (int i=0;i ///ConvexHullShape implements an implicit (getSupportingVertex) Convex Hull of a Point Cloud (vertices) -///No connectivity is needed. LocalGetSupportingVertex iterates linearly though all vertices. +///No connectivity is needed. localGetSupportingVertex iterates linearly though all vertices. ///on modern hardware, due to cache coherency this isn't that bad. Complex algorithms tend to trash the cash. ///(memory is much slower then the cpu) class btConvexHullShape : public btPolyhedralConvexShape @@ -32,28 +32,28 @@ class btConvexHullShape : public btPolyhedralConvexShape public: btConvexHullShape(btPoint3* points,int numPoints, int stride=sizeof(btPoint3)); - void AddPoint(const btPoint3& point) + void addPoint(const btPoint3& point) { m_points.push_back(point); } - virtual btVector3 LocalGetSupportingVertex(const btVector3& vec)const; - virtual btVector3 LocalGetSupportingVertexWithoutMargin(const btVector3& vec)const; - virtual void BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; + virtual btVector3 localGetSupportingVertex(const btVector3& vec)const; + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; - virtual int GetShapeType()const { return CONVEX_HULL_SHAPE_PROXYTYPE; } + virtual int getShapeType()const { return CONVEX_HULL_SHAPE_PROXYTYPE; } //debugging - virtual char* GetName()const {return "Convex";} + virtual char* getName()const {return "Convex";} - virtual int GetNumVertices() const; - virtual int GetNumEdges() const; - virtual void GetEdge(int i,btPoint3& pa,btPoint3& pb) const; - virtual void GetVertex(int i,btPoint3& vtx) const; - virtual int GetNumPlanes() const; - virtual void GetPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const; - virtual bool IsInside(const btPoint3& pt,btScalar tolerance) const; + virtual int getNumVertices() const; + virtual int getNumEdges() const; + virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const; + virtual void getVertex(int i,btPoint3& vtx) const; + virtual int getNumPlanes() const; + virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const; + virtual bool isInside(const btPoint3& pt,btScalar tolerance) const; diff --git a/src/BulletCollision/CollisionShapes/btConvexShape.cpp b/src/BulletCollision/CollisionShapes/btConvexShape.cpp index 84c1918a3..6f8dfaad5 100644 --- a/src/BulletCollision/CollisionShapes/btConvexShape.cpp +++ b/src/BulletCollision/CollisionShapes/btConvexShape.cpp @@ -29,30 +29,30 @@ void btConvexShape::setLocalScaling(const btVector3& scaling) -void btConvexShape::GetAabbSlow(const btTransform& trans,btVector3&minAabb,btVector3&maxAabb) const +void btConvexShape::getAabbSlow(const btTransform& trans,btVector3&minAabb,btVector3&maxAabb) const { - btScalar margin = GetMargin(); + btScalar margin = getMargin(); for (int i=0;i<3;i++) { btVector3 vec(0.f,0.f,0.f); vec[i] = 1.f; - btVector3 sv = LocalGetSupportingVertex(vec*trans.getBasis()); + btVector3 sv = localGetSupportingVertex(vec*trans.getBasis()); btVector3 tmp = trans(sv); maxAabb[i] = tmp[i]+margin; vec[i] = -1.f; - tmp = trans(LocalGetSupportingVertex(vec*trans.getBasis())); + tmp = trans(localGetSupportingVertex(vec*trans.getBasis())); minAabb[i] = tmp[i]-margin; } }; -btVector3 btConvexShape::LocalGetSupportingVertex(const btVector3& vec)const +btVector3 btConvexShape::localGetSupportingVertex(const btVector3& vec)const { - btVector3 supVertex = LocalGetSupportingVertexWithoutMargin(vec); + btVector3 supVertex = localGetSupportingVertexWithoutMargin(vec); - if ( GetMargin()!=0.f ) + if ( getMargin()!=0.f ) { btVector3 vecnorm = vec; if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON)) @@ -60,7 +60,7 @@ btVector3 btConvexShape::LocalGetSupportingVertex(const btVector3& vec)const vecnorm.setValue(-1.f,-1.f,-1.f); } vecnorm.normalize(); - supVertex+= GetMargin() * vecnorm; + supVertex+= getMargin() * vecnorm; } return supVertex; diff --git a/src/BulletCollision/CollisionShapes/btConvexShape.h b/src/BulletCollision/CollisionShapes/btConvexShape.h index 2413bca14..acc14c8ff 100644 --- a/src/BulletCollision/CollisionShapes/btConvexShape.h +++ b/src/BulletCollision/CollisionShapes/btConvexShape.h @@ -36,23 +36,23 @@ class btConvexShape : public btCollisionShape public: btConvexShape(); - virtual btVector3 LocalGetSupportingVertex(const btVector3& vec)const; - virtual btVector3 LocalGetSupportingVertexWithoutMargin(const btVector3& vec) const= 0; + virtual btVector3 localGetSupportingVertex(const btVector3& vec)const; + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec) const= 0; //notice that the vectors should be unit length - virtual void BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const= 0; + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const= 0; // testing for hullnode code - ///GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version - void GetAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const + ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version + void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const { - GetAabbSlow(t,aabbMin,aabbMax); + getAabbSlow(t,aabbMin,aabbMax); } - virtual void GetAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; + virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; virtual void setLocalScaling(const btVector3& scaling); @@ -62,11 +62,11 @@ public: } - virtual void SetMargin(float margin) + virtual void setMargin(float margin) { m_collisionMargin = margin; } - virtual float GetMargin() const + virtual float getMargin() const { return m_collisionMargin; } diff --git a/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp b/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp index 2698fe6aa..840428201 100644 --- a/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp +++ b/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp @@ -45,7 +45,7 @@ public: { } - virtual void InternalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) + virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) { for (int i=0;i<3;i++) { @@ -69,7 +69,7 @@ public: -btVector3 btConvexTriangleMeshShape::LocalGetSupportingVertexWithoutMargin(const btVector3& vec0)const +btVector3 btConvexTriangleMeshShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const { btVector3 supVec(0.f,0.f,0.f); @@ -92,7 +92,7 @@ btVector3 btConvexTriangleMeshShape::LocalGetSupportingVertexWithoutMargin(const return supVec; } -void btConvexTriangleMeshShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +void btConvexTriangleMeshShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const { //use 'w' component of supportVerticesOut? { @@ -118,11 +118,11 @@ void btConvexTriangleMeshShape::BatchedUnitVectorGetSupportingVertexWithoutMargi -btVector3 btConvexTriangleMeshShape::LocalGetSupportingVertex(const btVector3& vec)const +btVector3 btConvexTriangleMeshShape::localGetSupportingVertex(const btVector3& vec)const { - btVector3 supVertex = LocalGetSupportingVertexWithoutMargin(vec); + btVector3 supVertex = localGetSupportingVertexWithoutMargin(vec); - if ( GetMargin()!=0.f ) + if ( getMargin()!=0.f ) { btVector3 vecnorm = vec; if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON)) @@ -130,7 +130,7 @@ btVector3 btConvexTriangleMeshShape::LocalGetSupportingVertex(const btVector3& v vecnorm.setValue(-1.f,-1.f,-1.f); } vecnorm.normalize(); - supVertex+= GetMargin() * vecnorm; + supVertex+= getMargin() * vecnorm; } return supVertex; } @@ -145,7 +145,7 @@ btVector3 btConvexTriangleMeshShape::LocalGetSupportingVertex(const btVector3& v //currently just for debugging (drawing), perhaps future support for algebraic continuous collision detection //Please note that you can debug-draw btConvexTriangleMeshShape with the Raytracer Demo -int btConvexTriangleMeshShape::GetNumVertices() const +int btConvexTriangleMeshShape::getNumVertices() const { //cache this? assert(0); @@ -153,34 +153,34 @@ int btConvexTriangleMeshShape::GetNumVertices() const } -int btConvexTriangleMeshShape::GetNumEdges() const +int btConvexTriangleMeshShape::getNumEdges() const { assert(0); return 0; } -void btConvexTriangleMeshShape::GetEdge(int i,btPoint3& pa,btPoint3& pb) const +void btConvexTriangleMeshShape::getEdge(int i,btPoint3& pa,btPoint3& pb) const { assert(0); } -void btConvexTriangleMeshShape::GetVertex(int i,btPoint3& vtx) const +void btConvexTriangleMeshShape::getVertex(int i,btPoint3& vtx) const { assert(0); } -int btConvexTriangleMeshShape::GetNumPlanes() const +int btConvexTriangleMeshShape::getNumPlanes() const { return 0; } -void btConvexTriangleMeshShape::GetPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const +void btConvexTriangleMeshShape::getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const { assert(0); } //not yet -bool btConvexTriangleMeshShape::IsInside(const btPoint3& pt,btScalar tolerance) const +bool btConvexTriangleMeshShape::isInside(const btPoint3& pt,btScalar tolerance) const { assert(0); return false; diff --git a/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h b/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h index 4d167dbd8..56f953f24 100644 --- a/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h +++ b/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h @@ -17,27 +17,27 @@ class btConvexTriangleMeshShape : public btPolyhedralConvexShape public: btConvexTriangleMeshShape(btStridingMeshInterface* meshInterface); - class btStridingMeshInterface* GetStridingMesh() + class btStridingMeshInterface* getStridingMesh() { return m_stridingMesh; } - virtual btVector3 LocalGetSupportingVertex(const btVector3& vec)const; - virtual btVector3 LocalGetSupportingVertexWithoutMargin(const btVector3& vec)const; - virtual void BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; + virtual btVector3 localGetSupportingVertex(const btVector3& vec)const; + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; - virtual int GetShapeType()const { return CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE; } + virtual int getShapeType()const { return CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE; } //debugging - virtual char* GetName()const {return "ConvexTrimesh";} + virtual char* getName()const {return "ConvexTrimesh";} - virtual int GetNumVertices() const; - virtual int GetNumEdges() const; - virtual void GetEdge(int i,btPoint3& pa,btPoint3& pb) const; - virtual void GetVertex(int i,btPoint3& vtx) const; - virtual int GetNumPlanes() const; - virtual void GetPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const; - virtual bool IsInside(const btPoint3& pt,btScalar tolerance) const; + virtual int getNumVertices() const; + virtual int getNumEdges() const; + virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const; + virtual void getVertex(int i,btPoint3& vtx) const; + virtual int getNumPlanes() const; + virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const; + virtual bool isInside(const btPoint3& pt,btScalar tolerance) const; void setLocalScaling(const btVector3& scaling); diff --git a/src/BulletCollision/CollisionShapes/btCylinderShape.cpp b/src/BulletCollision/CollisionShapes/btCylinderShape.cpp index aeceed9ae..16b263474 100644 --- a/src/BulletCollision/CollisionShapes/btCylinderShape.cpp +++ b/src/BulletCollision/CollisionShapes/btCylinderShape.cpp @@ -151,45 +151,45 @@ const int ZZ = 1; } -btVector3 btCylinderShapeX::LocalGetSupportingVertexWithoutMargin(const btVector3& vec)const +btVector3 btCylinderShapeX::localGetSupportingVertexWithoutMargin(const btVector3& vec)const { - return CylinderLocalSupportX(GetHalfExtents(),vec); + return CylinderLocalSupportX(getHalfExtents(),vec); } -btVector3 btCylinderShapeZ::LocalGetSupportingVertexWithoutMargin(const btVector3& vec)const +btVector3 btCylinderShapeZ::localGetSupportingVertexWithoutMargin(const btVector3& vec)const { - return CylinderLocalSupportZ(GetHalfExtents(),vec); + return CylinderLocalSupportZ(getHalfExtents(),vec); } -btVector3 btCylinderShape::LocalGetSupportingVertexWithoutMargin(const btVector3& vec)const +btVector3 btCylinderShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const { - return CylinderLocalSupportY(GetHalfExtents(),vec); + return CylinderLocalSupportY(getHalfExtents(),vec); } -void btCylinderShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +void btCylinderShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const { for (int i=0;iLocalGetSupportingVertexWithoutMargin(vec*m_transA.getBasis())); - btVector3 supVertexB = m_transB(m_shapeB->LocalGetSupportingVertexWithoutMargin(vec*m_transB.getBasis())); + btVector3 supVertexA = m_transA(m_shapeA->localGetSupportingVertexWithoutMargin(vec*m_transA.getBasis())); + btVector3 supVertexB = m_transB(m_shapeB->localGetSupportingVertexWithoutMargin(vec*m_transB.getBasis())); return supVertexA + supVertexB; } -void btMinkowskiSumShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +void btMinkowskiSumShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const { //todo: could make recursive use of batching. probably this shape is not used frequently. for (int i=0;iGetMargin() + m_shapeB->GetMargin(); + return m_shapeA->getMargin() + m_shapeB->getMargin(); } -void btMinkowskiSumShape::CalculateLocalInertia(btScalar mass,btVector3& inertia) +void btMinkowskiSumShape::calculateLocalInertia(btScalar mass,btVector3& inertia) { assert(0); inertia.setValue(0,0,0); diff --git a/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h b/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h index be25cb70d..e974f57a4 100644 --- a/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h +++ b/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h @@ -32,28 +32,28 @@ public: btMinkowskiSumShape(btConvexShape* shapeA,btConvexShape* shapeB); - virtual btVector3 LocalGetSupportingVertexWithoutMargin(const btVector3& vec)const; + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; - virtual void BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; - virtual void CalculateLocalInertia(btScalar mass,btVector3& inertia); + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia); - void SetTransformA(const btTransform& transA) { m_transA = transA;} - void SetTransformB(const btTransform& transB) { m_transB = transB;} + void setTransformA(const btTransform& transA) { m_transA = transA;} + void setTransformB(const btTransform& transB) { m_transB = transB;} - const btTransform& GetTransformA()const { return m_transA;} + const btTransform& getTransformA()const { return m_transA;} const btTransform& GetTransformB()const { return m_transB;} - virtual int GetShapeType() const { return MINKOWSKI_SUM_SHAPE_PROXYTYPE; } + virtual int getShapeType() const { return MINKOWSKI_SUM_SHAPE_PROXYTYPE; } - virtual float GetMargin() const; + virtual float getMargin() const; - const btConvexShape* GetShapeA() const { return m_shapeA;} - const btConvexShape* GetShapeB() const { return m_shapeB;} + const btConvexShape* getShapeA() const { return m_shapeA;} + const btConvexShape* getShapeB() const { return m_shapeB;} - virtual char* GetName()const + virtual char* getName()const { return "MinkowskiSum"; } diff --git a/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp b/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp index 3ea4fd8a3..aaadb82eb 100644 --- a/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp +++ b/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp @@ -30,14 +30,14 @@ btMultiSphereShape::btMultiSphereShape (const btVector3& inertiaHalfExtents,cons if (radi[i] < m_minRadius) m_minRadius = radi[i]; } - SetMargin(m_minRadius); + setMargin(m_minRadius); } - btVector3 btMultiSphereShape::LocalGetSupportingVertexWithoutMargin(const btVector3& vec0)const + btVector3 btMultiSphereShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const { int i; btVector3 supVec(0,0,0); @@ -79,7 +79,7 @@ btMultiSphereShape::btMultiSphereShape (const btVector3& inertiaHalfExtents,cons } - void btMultiSphereShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const + void btMultiSphereShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const { for (int j=0;jm_escapeIndex; - internalNode->m_leftChild = BuildTree(leafNodes,startIndex,splitIndex); - internalNode->m_rightChild = BuildTree(leafNodes,splitIndex,endIndex); + internalNode->m_leftChild = buildTree(leafNodes,startIndex,splitIndex); + internalNode->m_rightChild = buildTree(leafNodes,splitIndex,endIndex); internalNode->m_escapeIndex = m_curNodeIndex - curIndex; return internalNode; } -int btOptimizedBvh::SortAndCalcSplittingIndex(NodeArray& leafNodes,int startIndex,int endIndex,int splitAxis) +int btOptimizedBvh::sortAndCalcSplittingIndex(NodeArray& leafNodes,int startIndex,int endIndex,int splitAxis) { int i; int splitIndex =startIndex; @@ -170,7 +170,7 @@ int btOptimizedBvh::SortAndCalcSplittingIndex(NodeArray& leafNodes,int startInde } -int btOptimizedBvh::CalcSplittingAxis(NodeArray& leafNodes,int startIndex,int endIndex) +int btOptimizedBvh::calcSplittingAxis(NodeArray& leafNodes,int startIndex,int endIndex) { int i; @@ -199,16 +199,16 @@ int btOptimizedBvh::CalcSplittingAxis(NodeArray& leafNodes,int startIndex,int en -void btOptimizedBvh::ReportAabbOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const +void btOptimizedBvh::reportAabbOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const { - //either choose recursive traversal (WalkTree) or stackless (WalkStacklessTree) + //either choose recursive traversal (walkTree) or stackless (walkStacklessTree) - //WalkTree(m_rootNode1,nodeCallback,aabbMin,aabbMax); + //walkTree(m_rootNode1,nodeCallback,aabbMin,aabbMax); - WalkStacklessTree(m_rootNode1,nodeCallback,aabbMin,aabbMax); + walkStacklessTree(m_rootNode1,nodeCallback,aabbMin,aabbMax); } -void btOptimizedBvh::WalkTree(btOptimizedBvhNode* rootNode,btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const +void btOptimizedBvh::walkTree(btOptimizedBvhNode* rootNode,btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const { bool isLeafNode, aabbOverlap = TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMin,rootNode->m_aabbMax); if (aabbOverlap) @@ -216,11 +216,11 @@ void btOptimizedBvh::WalkTree(btOptimizedBvhNode* rootNode,btNodeOverlapCallback isLeafNode = (!rootNode->m_leftChild && !rootNode->m_rightChild); if (isLeafNode) { - nodeCallback->ProcessNode(rootNode); + nodeCallback->processNode(rootNode); } else { - WalkTree(rootNode->m_leftChild,nodeCallback,aabbMin,aabbMax); - WalkTree(rootNode->m_rightChild,nodeCallback,aabbMin,aabbMax); + walkTree(rootNode->m_leftChild,nodeCallback,aabbMin,aabbMax); + walkTree(rootNode->m_rightChild,nodeCallback,aabbMin,aabbMax); } } @@ -228,7 +228,7 @@ void btOptimizedBvh::WalkTree(btOptimizedBvhNode* rootNode,btNodeOverlapCallback int maxIterations = 0; -void btOptimizedBvh::WalkStacklessTree(btOptimizedBvhNode* rootNode,btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const +void btOptimizedBvh::walkStacklessTree(btOptimizedBvhNode* rootNode,btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const { int escapeIndex, curIndex = 0; int walkIterations = 0; @@ -245,7 +245,7 @@ void btOptimizedBvh::WalkStacklessTree(btOptimizedBvhNode* rootNode,btNodeOverla if (isLeafNode && aabbOverlap) { - nodeCallback->ProcessNode(rootNode); + nodeCallback->processNode(rootNode); } if (aabbOverlap || isLeafNode) @@ -267,7 +267,7 @@ void btOptimizedBvh::WalkStacklessTree(btOptimizedBvhNode* rootNode,btNodeOverla } -void btOptimizedBvh::ReportSphereOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const +void btOptimizedBvh::reportSphereOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const { } diff --git a/src/BulletCollision/CollisionShapes/btOptimizedBvh.h b/src/BulletCollision/CollisionShapes/btOptimizedBvh.h index 92431c9dd..96172c4e2 100644 --- a/src/BulletCollision/CollisionShapes/btOptimizedBvh.h +++ b/src/BulletCollision/CollisionShapes/btOptimizedBvh.h @@ -49,7 +49,7 @@ class btNodeOverlapCallback public: virtual ~btNodeOverlapCallback() {}; - virtual void ProcessNode(const btOptimizedBvhNode* node) = 0; + virtual void processNode(const btOptimizedBvhNode* node) = 0; }; typedef std::vector NodeArray; @@ -71,26 +71,26 @@ public: btOptimizedBvh() :m_rootNode1(0), m_numNodes(0) { } virtual ~btOptimizedBvh(); - void Build(btStridingMeshInterface* triangles); + void build(btStridingMeshInterface* triangles); - btOptimizedBvhNode* BuildTree (NodeArray& leafNodes,int startIndex,int endIndex); + btOptimizedBvhNode* buildTree (NodeArray& leafNodes,int startIndex,int endIndex); - int CalcSplittingAxis(NodeArray& leafNodes,int startIndex,int endIndex); + int calcSplittingAxis(NodeArray& leafNodes,int startIndex,int endIndex); - int SortAndCalcSplittingIndex(NodeArray& leafNodes,int startIndex,int endIndex,int splitAxis); + int sortAndCalcSplittingIndex(NodeArray& leafNodes,int startIndex,int endIndex,int splitAxis); - void WalkTree(btOptimizedBvhNode* rootNode,btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const; + void walkTree(btOptimizedBvhNode* rootNode,btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const; - void WalkStacklessTree(btOptimizedBvhNode* rootNode,btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const; + void walkStacklessTree(btOptimizedBvhNode* rootNode,btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const; //OptimizedBvhNode* GetRootNode() { return m_rootNode1;} - int GetNumNodes() { return m_numNodes;} + int getNumNodes() { return m_numNodes;} - void ReportAabbOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const; + void reportAabbOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const; - void ReportSphereOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const; + void reportSphereOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const; }; diff --git a/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp b/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp index 99eaf56f0..cf2d2deb1 100644 --- a/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp +++ b/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp @@ -23,7 +23,7 @@ btPolyhedralConvexShape::btPolyhedralConvexShape() -btVector3 btPolyhedralConvexShape::LocalGetSupportingVertexWithoutMargin(const btVector3& vec0)const +btVector3 btPolyhedralConvexShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const { int i; btVector3 supVec(0,0,0); @@ -44,9 +44,9 @@ btVector3 btPolyhedralConvexShape::LocalGetSupportingVertexWithoutMargin(const b btVector3 vtx; btScalar newDot; - for (i=0;i maxDot) { @@ -59,7 +59,7 @@ btVector3 btPolyhedralConvexShape::LocalGetSupportingVertexWithoutMargin(const b } -void btPolyhedralConvexShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +void btPolyhedralConvexShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const { int i; @@ -76,9 +76,9 @@ void btPolyhedralConvexShape::BatchedUnitVectorGetSupportingVertexWithoutMargin( const btVector3& vec = vectors[j]; - for (i=0;i supportVerticesOut[j][3]) { @@ -92,16 +92,16 @@ void btPolyhedralConvexShape::BatchedUnitVectorGetSupportingVertexWithoutMargin( -void btPolyhedralConvexShape::CalculateLocalInertia(btScalar mass,btVector3& inertia) +void btPolyhedralConvexShape::calculateLocalInertia(btScalar mass,btVector3& inertia) { //not yet, return box inertia - float margin = GetMargin(); + float margin = getMargin(); btTransform ident; ident.setIdentity(); btVector3 aabbMin,aabbMax; - GetAabb(ident,aabbMin,aabbMax); + getAabb(ident,aabbMin,aabbMax); btVector3 halfExtents = (aabbMax-aabbMin)*0.5f; btScalar lx=2.f*(halfExtents.x()+margin); diff --git a/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h b/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h index 3e9520279..a404504ba 100644 --- a/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h +++ b/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h @@ -30,22 +30,22 @@ public: btPolyhedralConvexShape(); //brute force implementations - virtual btVector3 LocalGetSupportingVertexWithoutMargin(const btVector3& vec)const; - virtual void BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; - virtual void CalculateLocalInertia(btScalar mass,btVector3& inertia); + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia); - virtual int GetNumVertices() const = 0 ; - virtual int GetNumEdges() const = 0; - virtual void GetEdge(int i,btPoint3& pa,btPoint3& pb) const = 0; - virtual void GetVertex(int i,btPoint3& vtx) const = 0; - virtual int GetNumPlanes() const = 0; - virtual void GetPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const = 0; -// virtual int GetIndex(int i) const = 0 ; + virtual int getNumVertices() const = 0 ; + virtual int getNumEdges() const = 0; + virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const = 0; + virtual void getVertex(int i,btPoint3& vtx) const = 0; + virtual int getNumPlanes() const = 0; + virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const = 0; +// virtual int getIndex(int i) const = 0 ; - virtual bool IsInside(const btPoint3& pt,btScalar tolerance) const = 0; + virtual bool isInside(const btPoint3& pt,btScalar tolerance) const = 0; /// optional Hull is for optional Separating Axis Test Hull collision detection, see Hull.cpp class Hull* m_optionalHull; diff --git a/src/BulletCollision/CollisionShapes/btSphereShape.cpp b/src/BulletCollision/CollisionShapes/btSphereShape.cpp index 14b35e7ec..add22888b 100644 --- a/src/BulletCollision/CollisionShapes/btSphereShape.cpp +++ b/src/BulletCollision/CollisionShapes/btSphereShape.cpp @@ -24,12 +24,12 @@ btSphereShape ::btSphereShape (btScalar radius) { } -btVector3 btSphereShape::LocalGetSupportingVertexWithoutMargin(const btVector3& vec)const +btVector3 btSphereShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const { return btVector3(0.f,0.f,0.f); } -void btSphereShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const +void btSphereShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const { for (int i=0;iProcessTriangle(triangle,0,0); + callback->processTriangle(triangle,0,0); triangle[0] = projectedCenter - tangentDir0*radius - tangentDir1*radius; triangle[1] = projectedCenter - tangentDir0*radius + tangentDir1*radius; triangle[2] = projectedCenter + tangentDir0*radius + tangentDir1*radius; - callback->ProcessTriangle(triangle,0,1); + callback->processTriangle(triangle,0,1); } -void btStaticPlaneShape::CalculateLocalInertia(btScalar mass,btVector3& inertia) +void btStaticPlaneShape::calculateLocalInertia(btScalar mass,btVector3& inertia) { //moving concave objects not supported diff --git a/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h b/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h index 21c5ed513..7414d470d 100644 --- a/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h +++ b/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h @@ -37,23 +37,23 @@ public: virtual ~btStaticPlaneShape(); - virtual int GetShapeType() const + virtual int getShapeType() const { return STATIC_PLANE_PROXYTYPE; } - virtual void GetAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; + virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; - virtual void ProcessAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const; + virtual void processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const; - virtual void CalculateLocalInertia(btScalar mass,btVector3& inertia); + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia); virtual void setLocalScaling(const btVector3& scaling); virtual const btVector3& getLocalScaling() const; //debugging - virtual char* GetName()const {return "STATICPLANE";} + virtual char* getName()const {return "STATICPLANE";} }; diff --git a/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp b/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp index 4d129674c..f7507b293 100644 --- a/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp +++ b/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp @@ -56,7 +56,7 @@ void btStridingMeshInterface::InternalProcessAllTriangles(btInternalTriangleInde triangle[1].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(), graphicsbase[2]*meshScaling.getZ()); graphicsbase = (float*)(vertexbase+tri_indices[2]*stride); triangle[2].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(), graphicsbase[2]*meshScaling.getZ()); - callback->InternalProcessTriangleIndex(triangle,part,gfxindex); + callback->internalProcessTriangleIndex(triangle,part,gfxindex); } break; } @@ -71,7 +71,7 @@ void btStridingMeshInterface::InternalProcessAllTriangles(btInternalTriangleInde triangle[1].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(), graphicsbase[2]*meshScaling.getZ()); graphicsbase = (float*)(vertexbase+tri_indices[2]*stride); triangle[2].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(), graphicsbase[2]*meshScaling.getZ()); - callback->InternalProcessTriangleIndex(triangle,part,gfxindex); + callback->internalProcessTriangleIndex(triangle,part,gfxindex); } break; } diff --git a/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp b/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp index d540af071..7cb40c4fa 100644 --- a/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp +++ b/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp @@ -24,49 +24,49 @@ btBU_Simplex1to4::btBU_Simplex1to4() btBU_Simplex1to4::btBU_Simplex1to4(const btPoint3& pt0) :m_numVertices(0) { - AddVertex(pt0); + addVertex(pt0); } btBU_Simplex1to4::btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1) :m_numVertices(0) { - AddVertex(pt0); - AddVertex(pt1); + addVertex(pt0); + addVertex(pt1); } btBU_Simplex1to4::btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1,const btPoint3& pt2) :m_numVertices(0) { - AddVertex(pt0); - AddVertex(pt1); - AddVertex(pt2); + addVertex(pt0); + addVertex(pt1); + addVertex(pt2); } btBU_Simplex1to4::btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1,const btPoint3& pt2,const btPoint3& pt3) :m_numVertices(0) { - AddVertex(pt0); - AddVertex(pt1); - AddVertex(pt2); - AddVertex(pt3); + addVertex(pt0); + addVertex(pt1); + addVertex(pt2); + addVertex(pt3); } -void btBU_Simplex1to4::AddVertex(const btPoint3& pt) +void btBU_Simplex1to4::addVertex(const btPoint3& pt) { m_vertices[m_numVertices++] = pt; } -int btBU_Simplex1to4::GetNumVertices() const +int btBU_Simplex1to4::getNumVertices() const { return m_numVertices; } -int btBU_Simplex1to4::GetNumEdges() const +int btBU_Simplex1to4::getNumEdges() const { //euler formula, F-E+V = 2, so E = F+V-2 @@ -85,7 +85,7 @@ int btBU_Simplex1to4::GetNumEdges() const return 0; } -void btBU_Simplex1to4::GetEdge(int i,btPoint3& pa,btPoint3& pb) const +void btBU_Simplex1to4::getEdge(int i,btPoint3& pa,btPoint3& pb) const { switch (m_numVertices) @@ -149,12 +149,12 @@ void btBU_Simplex1to4::GetEdge(int i,btPoint3& pa,btPoint3& pb) const } -void btBU_Simplex1to4::GetVertex(int i,btPoint3& vtx) const +void btBU_Simplex1to4::getVertex(int i,btPoint3& vtx) const { vtx = m_vertices[i]; } -int btBU_Simplex1to4::GetNumPlanes() const +int btBU_Simplex1to4::getNumPlanes() const { switch (m_numVertices) { @@ -176,17 +176,17 @@ int btBU_Simplex1to4::GetNumPlanes() const } -void btBU_Simplex1to4::GetPlane(btVector3& planeNormal,btPoint3& planeSupport,int i) const +void btBU_Simplex1to4::getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i) const { } -int btBU_Simplex1to4::GetIndex(int i) const +int btBU_Simplex1to4::getIndex(int i) const { return 0; } -bool btBU_Simplex1to4::IsInside(const btPoint3& pt,btScalar tolerance) const +bool btBU_Simplex1to4::isInside(const btPoint3& pt,btScalar tolerance) const { return false; } diff --git a/src/BulletCollision/CollisionShapes/btTetrahedronShape.h b/src/BulletCollision/CollisionShapes/btTetrahedronShape.h index 8068b8349..9e17a248f 100644 --- a/src/BulletCollision/CollisionShapes/btTetrahedronShape.h +++ b/src/BulletCollision/CollisionShapes/btTetrahedronShape.h @@ -38,37 +38,37 @@ public: btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1,const btPoint3& pt2,const btPoint3& pt3); - void Reset() + void reset() { m_numVertices = 0; } - virtual int GetShapeType() const{ return TETRAHEDRAL_SHAPE_PROXYTYPE; } + virtual int getShapeType() const{ return TETRAHEDRAL_SHAPE_PROXYTYPE; } - void AddVertex(const btPoint3& pt); + void addVertex(const btPoint3& pt); //PolyhedralConvexShape interface - virtual int GetNumVertices() const; + virtual int getNumVertices() const; - virtual int GetNumEdges() const; + virtual int getNumEdges() const; - virtual void GetEdge(int i,btPoint3& pa,btPoint3& pb) const; + virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const; - virtual void GetVertex(int i,btPoint3& vtx) const; + virtual void getVertex(int i,btPoint3& vtx) const; - virtual int GetNumPlanes() const; + virtual int getNumPlanes() const; - virtual void GetPlane(btVector3& planeNormal,btPoint3& planeSupport,int i) const; + virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i) const; - virtual int GetIndex(int i) const; + virtual int getIndex(int i) const; - virtual bool IsInside(const btPoint3& pt,btScalar tolerance) const; + virtual bool isInside(const btPoint3& pt,btScalar tolerance) const; - ///GetName is for debugging - virtual char* GetName()const { return "btBU_Simplex1to4";} + ///getName is for debugging + virtual char* getName()const { return "btBU_Simplex1to4";} }; diff --git a/src/BulletCollision/CollisionShapes/btTriangleCallback.h b/src/BulletCollision/CollisionShapes/btTriangleCallback.h index 49b43a8a7..7b2337498 100644 --- a/src/BulletCollision/CollisionShapes/btTriangleCallback.h +++ b/src/BulletCollision/CollisionShapes/btTriangleCallback.h @@ -24,7 +24,7 @@ class btTriangleCallback public: virtual ~btTriangleCallback(); - virtual void ProcessTriangle(btVector3* triangle, int partId, int triangleIndex) = 0; + virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex) = 0; }; class btInternalTriangleIndexCallback @@ -32,7 +32,7 @@ class btInternalTriangleIndexCallback public: virtual ~btInternalTriangleIndexCallback(); - virtual void InternalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) = 0; + virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) = 0; }; diff --git a/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp b/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp index e71ad6fc2..154b7145e 100644 --- a/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp +++ b/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp @@ -26,7 +26,7 @@ btTriangleIndexVertexArray::btTriangleIndexVertexArray(int numTriangles,int* tri mesh.m_vertexBase = vertexBase; mesh.m_vertexStride = vertexStride; - AddIndexedMesh(mesh); + addIndexedMesh(mesh); } diff --git a/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h b/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h index 328417704..0cf609dc7 100644 --- a/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h +++ b/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h @@ -30,7 +30,7 @@ struct btIndexedMesh }; ///TriangleIndexVertexArray allows to use multiple meshes, by indexing into existing triangle/index arrays. -///Additional meshes can be added using AddIndexedMesh +///Additional meshes can be added using addIndexedMesh ///No duplcate is made of the vertex/index data, it only indexes into external vertex/index arrays. ///So keep those arrays around during the lifetime of this btTriangleIndexVertexArray. class btTriangleIndexVertexArray : public btStridingMeshInterface @@ -49,7 +49,7 @@ public: //just to be backwards compatible btTriangleIndexVertexArray(int numTriangleIndices,int* triangleIndexBase,int triangleIndexStride,int numVertices,float* vertexBase,int vertexStride); - void AddIndexedMesh(const btIndexedMesh& mesh) + void addIndexedMesh(const btIndexedMesh& mesh) { m_indexedMeshes.push_back(mesh); } diff --git a/src/BulletCollision/CollisionShapes/btTriangleMesh.h b/src/BulletCollision/CollisionShapes/btTriangleMesh.h index b13d76d98..690d1e849 100644 --- a/src/BulletCollision/CollisionShapes/btTriangleMesh.h +++ b/src/BulletCollision/CollisionShapes/btTriangleMesh.h @@ -37,7 +37,7 @@ class btTriangleMesh : public btStridingMeshInterface public: btTriangleMesh (); - void AddTriangle(const btVector3& vertex0,const btVector3& vertex1,const btVector3& vertex2) + void addTriangle(const btVector3& vertex0,const btVector3& vertex1,const btVector3& vertex2) { btMyTriangle tri; tri.m_vert0 = vertex0; diff --git a/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp b/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp index 86b60439a..cd2bf7261 100644 --- a/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp +++ b/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp @@ -25,7 +25,7 @@ subject to the following restrictions: btTriangleMeshShape::btTriangleMeshShape(btStridingMeshInterface* meshInterface) : m_meshInterface(meshInterface) { - RecalcLocalAabb(); + recalcLocalAabb(); } @@ -37,7 +37,7 @@ btTriangleMeshShape::~btTriangleMeshShape() -void btTriangleMeshShape::GetAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const +void btTriangleMeshShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const { btVector3 localHalfExtents = 0.5f*(m_localAabbMax-m_localAabbMin); @@ -50,7 +50,7 @@ void btTriangleMeshShape::GetAabb(const btTransform& trans,btVector3& aabbMin,bt btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents), abs_b[1].dot(localHalfExtents), abs_b[2].dot(localHalfExtents)); - extent += btVector3(GetMargin(),GetMargin(),GetMargin()); + extent += btVector3(getMargin(),getMargin(),getMargin()); aabbMin = center - extent; aabbMax = center + extent; @@ -58,16 +58,16 @@ void btTriangleMeshShape::GetAabb(const btTransform& trans,btVector3& aabbMin,bt } -void btTriangleMeshShape::RecalcLocalAabb() +void btTriangleMeshShape::recalcLocalAabb() { for (int i=0;i<3;i++) { btVector3 vec(0.f,0.f,0.f); vec[i] = 1.f; - btVector3 tmp = LocalGetSupportingVertex(vec); + btVector3 tmp = localGetSupportingVertex(vec); m_localAabbMax[i] = tmp[i]+m_collisionMargin; vec[i] = -1.f; - tmp = LocalGetSupportingVertex(vec); + tmp = localGetSupportingVertex(vec); m_localAabbMin[i] = tmp[i]-m_collisionMargin; } } @@ -91,7 +91,7 @@ public: m_supportVecLocal = supportVecWorld * m_worldTrans.getBasis(); } - virtual void ProcessTriangle( btVector3* triangle,int partId, int triangleIndex) + virtual void processTriangle( btVector3* triangle,int partId, int triangleIndex) { for (int i=0;i<3;i++) { @@ -120,7 +120,7 @@ public: void btTriangleMeshShape::setLocalScaling(const btVector3& scaling) { m_meshInterface->setScaling(scaling); - RecalcLocalAabb(); + recalcLocalAabb(); } const btVector3& btTriangleMeshShape::getLocalScaling() const @@ -136,7 +136,7 @@ const btVector3& btTriangleMeshShape::getLocalScaling() const //#define DEBUG_TRIANGLE_MESH -void btTriangleMeshShape::ProcessAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const +void btTriangleMeshShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const { struct FilteredCallback : public btInternalTriangleIndexCallback @@ -152,12 +152,12 @@ void btTriangleMeshShape::ProcessAllTriangles(btTriangleCallback* callback,const { } - virtual void InternalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) + virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex) { if (TestTriangleAgainstAabb2(&triangle[0],m_aabbMin,m_aabbMax)) { //check aabb in triangle-space, before doing this - m_callback->ProcessTriangle(triangle,partId,triangleIndex); + m_callback->processTriangle(triangle,partId,triangleIndex); } } @@ -174,7 +174,7 @@ void btTriangleMeshShape::ProcessAllTriangles(btTriangleCallback* callback,const -void btTriangleMeshShape::CalculateLocalInertia(btScalar mass,btVector3& inertia) +void btTriangleMeshShape::calculateLocalInertia(btScalar mass,btVector3& inertia) { //moving concave objects not supported assert(0); @@ -182,7 +182,7 @@ void btTriangleMeshShape::CalculateLocalInertia(btScalar mass,btVector3& inertia } -btVector3 btTriangleMeshShape::LocalGetSupportingVertex(const btVector3& vec) const +btVector3 btTriangleMeshShape::localGetSupportingVertex(const btVector3& vec) const { btVector3 supportVertex; @@ -193,7 +193,7 @@ btVector3 btTriangleMeshShape::LocalGetSupportingVertex(const btVector3& vec) co btVector3 aabbMax(1e30f,1e30f,1e30f); - ProcessAllTriangles(&supportCallback,-aabbMax,aabbMax); + processAllTriangles(&supportCallback,-aabbMax,aabbMax); supportVertex = supportCallback.GetSupportVertexLocal(); diff --git a/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h b/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h index fa305ad12..81cb1412d 100644 --- a/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h +++ b/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h @@ -34,33 +34,33 @@ public: virtual ~btTriangleMeshShape(); - virtual btVector3 LocalGetSupportingVertex(const btVector3& vec) const; + virtual btVector3 localGetSupportingVertex(const btVector3& vec) const; - virtual btVector3 LocalGetSupportingVertexWithoutMargin(const btVector3& vec)const + virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const { assert(0); - return LocalGetSupportingVertex(vec); + return localGetSupportingVertex(vec); } - void RecalcLocalAabb(); + void recalcLocalAabb(); - virtual int GetShapeType() const + virtual int getShapeType() const { return TRIANGLE_MESH_SHAPE_PROXYTYPE; } - virtual void GetAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; + virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; - virtual void ProcessAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const; + virtual void processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const; - virtual void CalculateLocalInertia(btScalar mass,btVector3& inertia); + virtual void calculateLocalInertia(btScalar mass,btVector3& inertia); virtual void setLocalScaling(const btVector3& scaling); virtual const btVector3& getLocalScaling() const; //debugging - virtual char* GetName()const {return "TRIANGLEMESH";} + virtual char* getName()const {return "TRIANGLEMESH";} }; diff --git a/src/BulletCollision/CollisionShapes/btTriangleShape.h b/src/BulletCollision/CollisionShapes/btTriangleShape.h index 4cc63dd3d..8f0a06f75 100644 --- a/src/BulletCollision/CollisionShapes/btTriangleShape.h +++ b/src/BulletCollision/CollisionShapes/btTriangleShape.h @@ -28,49 +28,49 @@ public: btVector3 m_vertices1[3]; - virtual int GetNumVertices() const + virtual int getNumVertices() const { return 3; } - const btVector3& GetVertexPtr(int index) const + const btVector3& getVertexPtr(int index) const { return m_vertices1[index]; } - virtual void GetVertex(int index,btVector3& vert) const + virtual void getVertex(int index,btVector3& vert) const { vert = m_vertices1[index]; } - virtual int GetShapeType() const + virtual int getShapeType() const { return TRIANGLE_SHAPE_PROXYTYPE; } - virtual int GetNumEdges() const + virtual int getNumEdges() const { return 3; } - virtual void GetEdge(int i,btPoint3& pa,btPoint3& pb) const + virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const { - GetVertex(i,pa); - GetVertex((i+1)%3,pb); + getVertex(i,pa); + getVertex((i+1)%3,pb); } - virtual void GetAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax)const + virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax)const { // ASSERT(0); - GetAabbSlow(t,aabbMin,aabbMax); + getAabbSlow(t,aabbMin,aabbMax); } - btVector3 LocalGetSupportingVertexWithoutMargin(const btVector3& dir)const + btVector3 localGetSupportingVertexWithoutMargin(const btVector3& dir)const { btVector3 dots(dir.dot(m_vertices1[0]), dir.dot(m_vertices1[1]), dir.dot(m_vertices1[2])); return m_vertices1[dots.maxAxis()]; } - virtual void BatchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const + virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const { for (int i=0;iGetAngularMotionDisc(); - btScalar boundingRadiusB = m_convexB->GetAngularMotionDisc(); + btScalar boundingRadiusA = m_convexA->getAngularMotionDisc(); + btScalar boundingRadiusB = m_convexB->getAngularMotionDisc(); btScalar maxAngularProjectedVelocity = angVelA.length() * boundingRadiusA + angVelB.length() * boundingRadiusB; @@ -80,10 +80,10 @@ bool btContinuousConvexCollision::calcTimeOfImpact( identityTrans.setIdentity(); btSphereShape raySphere(0.0f); - raySphere.SetMargin(0.f); + raySphere.setMargin(0.f); -// result.DrawCoordSystem(sphereTr); +// result.drawCoordSystem(sphereTr); btPointCollector pointCollector1; @@ -93,11 +93,11 @@ bool btContinuousConvexCollision::calcTimeOfImpact( btGjkPairDetector::ClosestPointInput input; //we don't use margins during CCD - gjk.SetIgnoreMargin(true); + gjk.setIgnoreMargin(true); input.m_transformA = fromA; input.m_transformB = fromB; - gjk.GetClosestPoints(input,pointCollector1,0); + gjk.getClosestPoints(input,pointCollector1,0); hasResult = pointCollector1.m_hasResult; c = pointCollector1.m_pointInWorld; @@ -145,8 +145,8 @@ bool btContinuousConvexCollision::calcTimeOfImpact( //interpolate to next lambda btTransform interpolatedTransA,interpolatedTransB,relativeTrans; - btTransformUtil::IntegrateTransform(fromA,linVelA,angVelA,lambda,interpolatedTransA); - btTransformUtil::IntegrateTransform(fromB,linVelB,angVelB,lambda,interpolatedTransB); + btTransformUtil::integrateTransform(fromA,linVelA,angVelA,lambda,interpolatedTransA); + btTransformUtil::integrateTransform(fromB,linVelB,angVelB,lambda,interpolatedTransB); relativeTrans = interpolatedTransB.inverseTimes(interpolatedTransA); result.DebugDraw( lambda ); @@ -156,7 +156,7 @@ bool btContinuousConvexCollision::calcTimeOfImpact( btGjkPairDetector::ClosestPointInput input; input.m_transformA = interpolatedTransA; input.m_transformB = interpolatedTransB; - gjk.GetClosestPoints(input,pointCollector,0); + gjk.getClosestPoints(input,pointCollector,0); if (pointCollector.m_hasResult) { if (pointCollector.m_distance < 0.f) diff --git a/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h b/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h index 35e8baf96..4258d829c 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h +++ b/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h @@ -38,7 +38,7 @@ public: //virtual bool addRayResult(const btVector3& normal,btScalar fraction) = 0; virtual void DebugDraw(btScalar fraction) {} - virtual void DrawCoordSystem(const btTransform& trans) {} + virtual void drawCoordSystem(const btTransform& trans) {} CastResult() :m_fraction(1e30f), diff --git a/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h b/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h index 5a5875d61..ba02ea56e 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h +++ b/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h @@ -29,7 +29,7 @@ class btConvexPenetrationDepthSolver public: virtual ~btConvexPenetrationDepthSolver() {}; - virtual bool CalcPenDepth( btSimplexSolverInterface& simplexSolver, + virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver, btConvexShape* convexA,btConvexShape* convexB, const btTransform& transA,const btTransform& transB, btVector3& v, btPoint3& pa, btPoint3& pb, diff --git a/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h b/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h index 9871ef7b2..3f675f23e 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h +++ b/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h @@ -35,9 +35,9 @@ struct btDiscreteCollisionDetectorInterface virtual ~Result(){} - ///SetShapeIdentifiers provides experimental support for per-triangle material / custom material combiner - virtual void SetShapeIdentifiers(int partId0,int index0, int partId1,int index1)=0; - virtual void AddContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth)=0; + ///setShapeIdentifiers provides experimental support for per-triangle material / custom material combiner + virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1)=0; + virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth)=0; }; struct ClosestPointInput @@ -58,7 +58,7 @@ struct btDiscreteCollisionDetectorInterface // give either closest points (distance > 0) or penetration (distance) // the normal always points from B towards A // - virtual void GetClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw) = 0; + virtual void getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw) = 0; btScalar getCollisionMargin() { return 0.2f;} }; @@ -75,7 +75,7 @@ struct btStorageResult : public btDiscreteCollisionDetectorInterface::Result } virtual ~btStorageResult() {}; - virtual void AddContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth) + virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth) { if (depth < m_distance) { diff --git a/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp b/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp index f65ed52f7..bf465b618 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp +++ b/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp @@ -54,8 +54,8 @@ bool btGjkConvexCast::calcTimeOfImpact( trA.setOrigin(btPoint3(0,0,0)); trB.setOrigin(btPoint3(0,0,0)); - convex->SetTransformA(trA); - convex->SetTransformB(trB); + convex->setTransformA(trA); + convex->setTransformB(trB); @@ -82,13 +82,13 @@ bool btGjkConvexCast::calcTimeOfImpact( identityTrans.setIdentity(); btSphereShape raySphere(0.0f); - raySphere.SetMargin(0.f); + raySphere.setMargin(0.f); btTransform sphereTr; sphereTr.setIdentity(); sphereTr.setOrigin( rayFromLocalA.getOrigin()); - result.DrawCoordSystem(sphereTr); + result.drawCoordSystem(sphereTr); { btPointCollector pointCollector1; btGjkPairDetector gjk(&raySphere,convex,m_simplexSolver,penSolverPtr); @@ -96,7 +96,7 @@ bool btGjkConvexCast::calcTimeOfImpact( btGjkPairDetector::ClosestPointInput input; input.m_transformA = sphereTr; input.m_transformB = identityTrans; - gjk.GetClosestPoints(input,pointCollector1,0); + gjk.getClosestPoints(input,pointCollector1,0); hasResult = pointCollector1.m_hasResult; c = pointCollector1.m_pointInWorld; @@ -134,13 +134,13 @@ bool btGjkConvexCast::calcTimeOfImpact( x = s + lambda * r; sphereTr.setOrigin( x ); - result.DrawCoordSystem(sphereTr); + result.drawCoordSystem(sphereTr); btPointCollector pointCollector; btGjkPairDetector gjk(&raySphere,convex,m_simplexSolver,penSolverPtr); btGjkPairDetector::ClosestPointInput input; input.m_transformA = sphereTr; input.m_transformB = identityTrans; - gjk.GetClosestPoints(input,pointCollector,0); + gjk.getClosestPoints(input,pointCollector,0); if (pointCollector.m_hasResult) { if (pointCollector.m_distance < 0.f) diff --git a/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp b/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp index 7979b2e5f..75b1c9809 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp +++ b/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp @@ -43,14 +43,14 @@ m_index1(-1) { } -void btGjkPairDetector::GetClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw) +void btGjkPairDetector::getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw) { btScalar distance=0.f; btVector3 normalInB(0.f,0.f,0.f); btVector3 pointOnA,pointOnB; - float marginA = m_minkowskiA->GetMargin(); - float marginB = m_minkowskiB->GetMargin(); + float marginA = m_minkowskiA->getMargin(); + float marginB = m_minkowskiB->getMargin(); //for CCD we don't use margins if (m_ignoreMargin) @@ -87,8 +87,8 @@ int curIter = 0; m_cachedSeparatingAxis.getY(), m_cachedSeparatingAxis.getZ(), squaredDistance, - m_minkowskiA->GetShapeType(), - m_minkowskiB->GetShapeType()); + m_minkowskiA->getShapeType(), + m_minkowskiB->getShapeType()); #endif break; @@ -97,8 +97,8 @@ int curIter = 0; btVector3 seperatingAxisInA = (-m_cachedSeparatingAxis)* input.m_transformA.getBasis(); btVector3 seperatingAxisInB = m_cachedSeparatingAxis* input.m_transformB.getBasis(); - btVector3 pInA = m_minkowskiA->LocalGetSupportingVertexWithoutMargin(seperatingAxisInA); - btVector3 qInB = m_minkowskiB->LocalGetSupportingVertexWithoutMargin(seperatingAxisInB); + btVector3 pInA = m_minkowskiA->localGetSupportingVertexWithoutMargin(seperatingAxisInA); + btVector3 qInB = m_minkowskiB->localGetSupportingVertexWithoutMargin(seperatingAxisInB); btPoint3 pWorld = input.m_transformA(pInA); btPoint3 qWorld = input.m_transformB(qInB); @@ -184,7 +184,7 @@ int curIter = 0; if (m_penetrationDepthSolver) { // Penetration depth case. - isValid = m_penetrationDepthSolver->CalcPenDepth( + isValid = m_penetrationDepthSolver->calcPenDepth( *m_simplexSolver, m_minkowskiA,m_minkowskiB, input.m_transformA,input.m_transformB, @@ -211,9 +211,9 @@ int curIter = 0; if (isValid) { - output.SetShapeIdentifiers(m_partId0,m_index0,m_partId1,m_index1); + output.setShapeIdentifiers(m_partId0,m_index0,m_partId1,m_index1); - output.AddContactPoint( + output.addContactPoint( normalInB, pointOnB, distance); diff --git a/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h b/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h index 017428f97..bccb05423 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h +++ b/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h @@ -53,28 +53,28 @@ public: btGjkPairDetector(btConvexShape* objectA,btConvexShape* objectB,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver* penetrationDepthSolver); virtual ~btGjkPairDetector() {}; - virtual void GetClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw); + virtual void getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw); - void SetMinkowskiA(btConvexShape* minkA) + void setMinkowskiA(btConvexShape* minkA) { m_minkowskiA = minkA; } - void SetMinkowskiB(btConvexShape* minkB) + void setMinkowskiB(btConvexShape* minkB) { m_minkowskiB = minkB; } - void SetCachedSeperatingAxis(const btVector3& seperatingAxis) + void setCachedSeperatingAxis(const btVector3& seperatingAxis) { m_cachedSeparatingAxis = seperatingAxis; } - void SetPenetrationDepthSolver(btConvexPenetrationDepthSolver* penetrationDepthSolver) + void setPenetrationDepthSolver(btConvexPenetrationDepthSolver* penetrationDepthSolver) { m_penetrationDepthSolver = penetrationDepthSolver; } - void SetIgnoreMargin(bool ignoreMargin) + void setIgnoreMargin(bool ignoreMargin) { m_ignoreMargin = ignoreMargin; } diff --git a/src/BulletCollision/NarrowPhaseCollision/btManifoldContactAddResult.cpp b/src/BulletCollision/NarrowPhaseCollision/btManifoldContactAddResult.cpp index 44cb994c5..0b0741907 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btManifoldContactAddResult.cpp +++ b/src/BulletCollision/NarrowPhaseCollision/btManifoldContactAddResult.cpp @@ -25,9 +25,9 @@ btManifoldContactAddResult::btManifoldContactAddResult(btTransform transA,btTran } -void btManifoldContactAddResult::AddContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth) +void btManifoldContactAddResult::addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth) { - if (depth > m_manifoldPtr->GetContactBreakingTreshold()) + if (depth > m_manifoldPtr->getContactBreakingTreshold()) return; @@ -36,10 +36,10 @@ void btManifoldContactAddResult::AddContactPoint(const btVector3& normalOnBInWor btVector3 localB = m_transBInv(pointInWorld); btManifoldPoint newPt(localA,localB,normalOnBInWorld,depth); - int insertIndex = m_manifoldPtr->GetCacheEntry(newPt); + int insertIndex = m_manifoldPtr->getCacheEntry(newPt); if (insertIndex >= 0) { - m_manifoldPtr->ReplaceContactPoint(newPt,insertIndex); + m_manifoldPtr->replaceContactPoint(newPt,insertIndex); } else { m_manifoldPtr->AddManifoldPoint(newPt); diff --git a/src/BulletCollision/NarrowPhaseCollision/btManifoldContactAddResult.h b/src/BulletCollision/NarrowPhaseCollision/btManifoldContactAddResult.h index e4702d288..9fcc049f5 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btManifoldContactAddResult.h +++ b/src/BulletCollision/NarrowPhaseCollision/btManifoldContactAddResult.h @@ -30,7 +30,7 @@ public: btManifoldContactAddResult(btTransform transA,btTransform transB,btPersistentManifold* manifoldPtr); - virtual void AddContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth); + virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth); }; diff --git a/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h b/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h index 654779305..00a9206fe 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h +++ b/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h @@ -54,7 +54,7 @@ class btManifoldPoint btVector3 m_localPointA; btVector3 m_localPointB; btVector3 m_positionWorldOnB; - ///m_positionWorldOnA is redundant information, see GetPositionWorldOnA(), but for clarity + ///m_positionWorldOnA is redundant information, see getPositionWorldOnA(), but for clarity btVector3 m_positionWorldOnA; btVector3 m_normalWorldOnB; @@ -67,26 +67,26 @@ class btManifoldPoint int m_lifeTime;//lifetime of the contactpoint in frames - float GetDistance() const + float getDistance() const { return m_distance1; } - int GetLifeTime() const + int getLifeTime() const { return m_lifeTime; } - btVector3 GetPositionWorldOnA() { + btVector3 getPositionWorldOnA() { return m_positionWorldOnA; // return m_positionWorldOnB + m_normalWorldOnB * m_distance1; } - const btVector3& GetPositionWorldOnB() + const btVector3& getPositionWorldOnB() { return m_positionWorldOnB; } - void SetDistance(float dist) + void setDistance(float dist) { m_distance1 = dist; } diff --git a/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp b/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp index cd54639dd..34daacf26 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp +++ b/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp @@ -32,10 +32,10 @@ struct MyResult : public btDiscreteCollisionDetectorInterface::Result float m_depth; bool m_hasResult; - virtual void SetShapeIdentifiers(int partId0,int index0, int partId1,int index1) + virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1) { } - void AddContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth) + void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth) { m_normalOnBInWorld = normalOnBInWorld; m_pointInWorld = pointInWorld; @@ -92,7 +92,7 @@ btVector3(0.162456f , 0.499995f,0.850654f) }; -bool btMinkowskiPenetrationDepthSolver::CalcPenDepth(btSimplexSolverInterface& simplexSolver, +bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& simplexSolver, btConvexShape* convexA,btConvexShape* convexB, const btTransform& transA,const btTransform& transB, btVector3& v, btPoint3& pa, btPoint3& pb, @@ -123,8 +123,8 @@ bool btMinkowskiPenetrationDepthSolver::CalcPenDepth(btSimplexSolverInterface& s seperatingAxisInBBatch[i] = norm * transB.getBasis(); } - convexA->BatchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInABatch,supportVerticesABatch,NUM_UNITSPHERE_POINTS); - convexB->BatchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInBBatch,supportVerticesBBatch,NUM_UNITSPHERE_POINTS); + convexA->batchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInABatch,supportVerticesABatch,NUM_UNITSPHERE_POINTS); + convexB->batchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInBBatch,supportVerticesBBatch,NUM_UNITSPHERE_POINTS); for (i=0;iLocalGetSupportingVertexWithoutMargin(seperatingAxisInA); - qInB = convexB->LocalGetSupportingVertexWithoutMargin(seperatingAxisInB); + pInA = convexA->localGetSupportingVertexWithoutMargin(seperatingAxisInA); + qInB = convexB->localGetSupportingVertexWithoutMargin(seperatingAxisInB); pWorld = transA(pInA); qWorld = transB(qInB); w = qWorld - pWorld; @@ -172,9 +172,9 @@ bool btMinkowskiPenetrationDepthSolver::CalcPenDepth(btSimplexSolverInterface& s //add the margins - minA += minNorm*convexA->GetMargin(); - minB -= minNorm*convexB->GetMargin(); - minProj += (convexA->GetMargin() + convexB->GetMargin()); + minA += minNorm*convexA->getMargin(); + minB -= minNorm*convexB->getMargin(); + minProj += (convexA->getMargin() + convexB->getMargin()); @@ -184,11 +184,11 @@ bool btMinkowskiPenetrationDepthSolver::CalcPenDepth(btSimplexSolverInterface& s if (debugDraw) { btVector3 color(0,1,0); - debugDraw->DrawLine(minA,minB,color); + debugDraw->drawLine(minA,minB,color); color = btVector3 (1,1,1); btVector3 vec = minB-minA; float prj2 = minNorm.dot(vec); - debugDraw->DrawLine(minA,minA+(minNorm*minProj),color); + debugDraw->drawLine(minA,minA+(minNorm*minProj),color); } #endif //DEBUG_DRAW @@ -214,7 +214,7 @@ bool btMinkowskiPenetrationDepthSolver::CalcPenDepth(btSimplexSolverInterface& s input.m_maximumDistanceSquared = 1e30f;//minProj; MyResult res; - gjkdet.GetClosestPoints(input,res,debugDraw); + gjkdet.getClosestPoints(input,res,debugDraw); float correctedMinNorm = minProj - res.m_depth; @@ -233,7 +233,7 @@ bool btMinkowskiPenetrationDepthSolver::CalcPenDepth(btSimplexSolverInterface& s if (debugDraw) { btVector3 color(1,0,0); - debugDraw->DrawLine(pa,pb,color); + debugDraw->drawLine(pa,pb,color); } #endif//DEBUG_DRAW diff --git a/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h b/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h index 4009f7c63..c28719531 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h +++ b/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h @@ -24,7 +24,7 @@ class btMinkowskiPenetrationDepthSolver : public btConvexPenetrationDepthSolver { public: - virtual bool CalcPenDepth( btSimplexSolverInterface& simplexSolver, + virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver, btConvexShape* convexA,btConvexShape* convexB, const btTransform& transA,const btTransform& transB, btVector3& v, btPoint3& pa, btPoint3& pb, diff --git a/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp b/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp index a3e48849c..fafceafa5 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp +++ b/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp @@ -32,12 +32,12 @@ m_index1(0) } -void btPersistentManifold::ClearManifold() +void btPersistentManifold::clearManifold() { int i; for (i=0;i1) - printf("error in ClearUserCache\n"); + printf("error in clearUserCache\n"); } } assert(occurance<=0); @@ -91,7 +91,7 @@ void btPersistentManifold::ClearUserCache(btManifoldPoint& pt) } -int btPersistentManifold::SortCachedPoints(const btManifoldPoint& pt) +int btPersistentManifold::sortCachedPoints(const btManifoldPoint& pt) { //calculate 4 possible cases areas, and take biggest area @@ -100,13 +100,13 @@ int btPersistentManifold::SortCachedPoints(const btManifoldPoint& pt) int maxPenetrationIndex = -1; #define KEEP_DEEPEST_POINT 1 #ifdef KEEP_DEEPEST_POINT - float maxPenetration = pt.GetDistance(); + float maxPenetration = pt.getDistance(); for (int i=0;i<4;i++) { - if (m_pointCache[i].GetDistance() < maxPenetration) + if (m_pointCache[i].getDistance() < maxPenetration) { maxPenetrationIndex = i; - maxPenetration = m_pointCache[i].GetDistance(); + maxPenetration = m_pointCache[i].getDistance(); } } #endif //KEEP_DEEPEST_POINT @@ -149,10 +149,10 @@ int btPersistentManifold::SortCachedPoints(const btManifoldPoint& pt) } -int btPersistentManifold::GetCacheEntry(const btManifoldPoint& newPoint) const +int btPersistentManifold::getCacheEntry(const btManifoldPoint& newPoint) const { - btScalar shortestDist = GetContactBreakingTreshold() * GetContactBreakingTreshold(); - int size = GetNumContacts(); + btScalar shortestDist = getContactBreakingTreshold() * getContactBreakingTreshold(); + int size = getNumContacts(); int nearestPoint = -1; for( int i = 0; i < size; i++ ) { @@ -171,14 +171,14 @@ int btPersistentManifold::GetCacheEntry(const btManifoldPoint& newPoint) const void btPersistentManifold::AddManifoldPoint(const btManifoldPoint& newPoint) { - assert(ValidContactDistance(newPoint)); + assert(validContactDistance(newPoint)); - int insertIndex = GetNumContacts(); + int insertIndex = getNumContacts(); if (insertIndex == MANIFOLD_CACHE_SIZE) { #if MANIFOLD_CACHE_SIZE >= 4 //sort cache so best points come first, based on area - insertIndex = SortCachedPoints(newPoint); + insertIndex = sortCachedPoints(newPoint); #else insertIndex = 0; #endif @@ -190,20 +190,20 @@ void btPersistentManifold::AddManifoldPoint(const btManifoldPoint& newPoint) } - ReplaceContactPoint(newPoint,insertIndex); + replaceContactPoint(newPoint,insertIndex); } -float btPersistentManifold::GetContactBreakingTreshold() const +float btPersistentManifold::getContactBreakingTreshold() const { return gContactBreakingTreshold; } -void btPersistentManifold::RefreshContactPoints(const btTransform& trA,const btTransform& trB) +void btPersistentManifold::refreshContactPoints(const btTransform& trA,const btTransform& trB) { int i; /// first refresh worldspace positions and distance - for (i=GetNumContacts()-1;i>=0;i--) + for (i=getNumContacts()-1;i>=0;i--) { btManifoldPoint &manifoldPoint = m_pointCache[i]; manifoldPoint.m_positionWorldOnA = trA( manifoldPoint.m_localPointA ); @@ -215,23 +215,23 @@ void btPersistentManifold::RefreshContactPoints(const btTransform& trA,const btT /// then btScalar distance2d; btVector3 projectedDifference,projectedPoint; - for (i=GetNumContacts()-1;i>=0;i--) + for (i=getNumContacts()-1;i>=0;i--) { btManifoldPoint &manifoldPoint = m_pointCache[i]; //contact becomes invalid when signed distance exceeds margin (projected on contactnormal direction) - if (!ValidContactDistance(manifoldPoint)) + if (!validContactDistance(manifoldPoint)) { - RemoveContactPoint(i); + removeContactPoint(i); } else { //contact also becomes invalid when relative movement orthogonal to normal exceeds margin projectedPoint = manifoldPoint.m_positionWorldOnA - manifoldPoint.m_normalWorldOnB * manifoldPoint.m_distance1; projectedDifference = manifoldPoint.m_positionWorldOnB - projectedPoint; distance2d = projectedDifference.dot(projectedDifference); - if (distance2d > GetContactBreakingTreshold()*GetContactBreakingTreshold() ) + if (distance2d > getContactBreakingTreshold()*getContactBreakingTreshold() ) { - RemoveContactPoint(i); + removeContactPoint(i); } } } diff --git a/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h b/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h index 00012d218..cbe4cca92 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h +++ b/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h @@ -49,9 +49,9 @@ class btPersistentManifold /// sort cached points so most isolated points come first - int SortCachedPoints(const btManifoldPoint& pt); + int sortCachedPoints(const btManifoldPoint& pt); - int FindContactPoint(const btManifoldPoint* unUsed, int numUnused,const btManifoldPoint& pt); + int findContactPoint(const btManifoldPoint* unUsed, int numUnused,const btManifoldPoint& pt); public: @@ -64,72 +64,72 @@ public: { } - inline void* GetBody0() { return m_body0;} - inline void* GetBody1() { return m_body1;} + inline void* getBody0() { return m_body0;} + inline void* getBody1() { return m_body1;} - inline const void* GetBody0() const { return m_body0;} - inline const void* GetBody1() const { return m_body1;} + inline const void* getBody0() const { return m_body0;} + inline const void* getBody1() const { return m_body1;} - void SetBodies(void* body0,void* body1) + void setBodies(void* body0,void* body1) { m_body0 = body0; m_body1 = body1; } - void ClearUserCache(btManifoldPoint& pt); + void clearUserCache(btManifoldPoint& pt); #ifdef DEBUG_PERSISTENCY void DebugPersistency(); #endif // - inline int GetNumContacts() const { return m_cachedPoints;} + inline int getNumContacts() const { return m_cachedPoints;} - inline const btManifoldPoint& GetContactPoint(int index) const + inline const btManifoldPoint& getContactPoint(int index) const { ASSERT(index < m_cachedPoints); return m_pointCache[index]; } - inline btManifoldPoint& GetContactPoint(int index) + inline btManifoldPoint& getContactPoint(int index) { ASSERT(index < m_cachedPoints); return m_pointCache[index]; } /// todo: get this margin from the current physics / collision environment - float GetContactBreakingTreshold() const; + float getContactBreakingTreshold() const; - int GetCacheEntry(const btManifoldPoint& newPoint) const; + int getCacheEntry(const btManifoldPoint& newPoint) const; void AddManifoldPoint( const btManifoldPoint& newPoint); - void RemoveContactPoint (int index) + void removeContactPoint (int index) { - ClearUserCache(m_pointCache[index]); + clearUserCache(m_pointCache[index]); - int lastUsedIndex = GetNumContacts() - 1; + int lastUsedIndex = getNumContacts() - 1; m_pointCache[index] = m_pointCache[lastUsedIndex]; //get rid of duplicated userPersistentData pointer m_pointCache[lastUsedIndex].m_userPersistentData = 0; m_cachedPoints--; } - void ReplaceContactPoint(const btManifoldPoint& newPoint,int insertIndex) + void replaceContactPoint(const btManifoldPoint& newPoint,int insertIndex) { - assert(ValidContactDistance(newPoint)); + assert(validContactDistance(newPoint)); - ClearUserCache(m_pointCache[insertIndex]); + clearUserCache(m_pointCache[insertIndex]); m_pointCache[insertIndex] = newPoint; } - bool ValidContactDistance(const btManifoldPoint& pt) const + bool validContactDistance(const btManifoldPoint& pt) const { - return pt.m_distance1 <= GetContactBreakingTreshold(); + return pt.m_distance1 <= getContactBreakingTreshold(); } /// calculated new worldspace coordinates and depth, and reject points that exceed the collision margin - void RefreshContactPoints( const btTransform& trA,const btTransform& trB); + void refreshContactPoints( const btTransform& trA,const btTransform& trB); - void ClearManifold(); + void clearManifold(); diff --git a/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h b/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h index 0e25f19bd..a51e2d5e1 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h +++ b/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h @@ -35,12 +35,12 @@ struct btPointCollector : public btDiscreteCollisionDetectorInterface::Result { } - virtual void SetShapeIdentifiers(int partId0,int index0, int partId1,int index1) + virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1) { //?? } - virtual void AddContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth) + virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,float depth) { if (depth< m_distance) { diff --git a/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp b/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp index 5c4460b19..88ee00579 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp +++ b/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp @@ -27,7 +27,7 @@ btTriangleRaycastCallback::btTriangleRaycastCallback(const btVector3& from,const -void btTriangleRaycastCallback::ProcessTriangle(btVector3* triangle,int partId, int triangleIndex) +void btTriangleRaycastCallback::processTriangle(btVector3* triangle,int partId, int triangleIndex) { @@ -87,11 +87,11 @@ void btTriangleRaycastCallback::ProcessTriangle(btVector3* triangle,int partId, if ( dist_a > 0 ) { - m_hitFraction = ReportHit(triangleNormal,distance,partId,triangleIndex); + m_hitFraction = reportHit(triangleNormal,distance,partId,triangleIndex); } else { - m_hitFraction = ReportHit(-triangleNormal,distance,partId,triangleIndex); + m_hitFraction = reportHit(-triangleNormal,distance,partId,triangleIndex); } } } diff --git a/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h b/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h index 86e344e5c..fbb51d305 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h +++ b/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h @@ -32,9 +32,9 @@ public: btTriangleRaycastCallback(const btVector3& from,const btVector3& to); - virtual void ProcessTriangle(btVector3* triangle, int partId, int triangleIndex); + virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex); - virtual float ReportHit(const btVector3& hitNormalLocal, float hitFraction, int partId, int triangleIndex ) = 0; + virtual float reportHit(const btVector3& hitNormalLocal, float hitFraction, int partId, int triangleIndex ) = 0; }; diff --git a/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp b/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp index 55fef5f05..8f164f288 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp +++ b/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp @@ -49,7 +49,7 @@ bool btSubsimplexConvexCast::calcTimeOfImpact( m_simplexSolver->reset(); - convex->SetTransformB(btTransform(rayFromLocalA.getBasis())); + convex->setTransformB(btTransform(rayFromLocalA.getBasis())); //float radius = 0.01f; @@ -61,7 +61,7 @@ bool btSubsimplexConvexCast::calcTimeOfImpact( btVector3 r = -(rayToLocalA.getOrigin()-rayFromLocalA.getOrigin()); btVector3 x = s; btVector3 v; - btVector3 arbitraryPoint = convex->LocalGetSupportingVertex(r); + btVector3 arbitraryPoint = convex->localGetSupportingVertex(r); v = x - arbitraryPoint; @@ -83,7 +83,7 @@ bool btSubsimplexConvexCast::calcTimeOfImpact( while ( (dist2 > epsilon) && maxIter--) { - p = convex->LocalGetSupportingVertex( v); + p = convex->localGetSupportingVertex( v); w = x - p; float VdotW = v.dot(w); diff --git a/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp b/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp index d72ac545e..23d66a3bb 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp +++ b/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp @@ -44,7 +44,7 @@ void btVoronoiSimplexSolver::removeVertex(int index) m_simplexPointsQ[index] = m_simplexPointsQ[m_numVertices]; } -void btVoronoiSimplexSolver::ReduceVertices (const btUsageBitfield& usedVerts) +void btVoronoiSimplexSolver::reduceVertices (const btUsageBitfield& usedVerts) { if ((numVertices() >= 4) && (!usedVerts.usedVertexD)) removeVertex(3); @@ -71,7 +71,7 @@ void btVoronoiSimplexSolver::reset() m_numVertices = 0; m_needsUpdate = true; m_lastW = btVector3(1e30f,1e30f,1e30f); - m_cachedBC.Reset(); + m_cachedBC.reset(); } @@ -89,12 +89,12 @@ void btVoronoiSimplexSolver::addVertex(const btVector3& w, const btPoint3& p, co m_numVertices++; } -bool btVoronoiSimplexSolver::UpdateClosestVectorAndPoints() +bool btVoronoiSimplexSolver::updateClosestVectorAndPoints() { if (m_needsUpdate) { - m_cachedBC.Reset(); + m_cachedBC.reset(); m_needsUpdate = false; @@ -108,9 +108,9 @@ bool btVoronoiSimplexSolver::UpdateClosestVectorAndPoints() m_cachedP1 = m_simplexPointsP[0]; m_cachedP2 = m_simplexPointsQ[0]; m_cachedV = m_cachedP1-m_cachedP2; //== m_simplexVectorW[0] - m_cachedBC.Reset(); - m_cachedBC.SetBarycentricCoordinates(1.f,0.f,0.f,0.f); - m_cachedValidClosest = m_cachedBC.IsValid(); + m_cachedBC.reset(); + m_cachedBC.setBarycentricCoordinates(1.f,0.f,0.f,0.f); + m_cachedValidClosest = m_cachedBC.isValid(); break; }; case 2: @@ -144,16 +144,16 @@ bool btVoronoiSimplexSolver::UpdateClosestVectorAndPoints() //reduce to 1 point m_cachedBC.m_usedVertices.usedVertexA = true; } - m_cachedBC.SetBarycentricCoordinates(1-t,t); + m_cachedBC.setBarycentricCoordinates(1-t,t); nearest = from + t*v; m_cachedP1 = m_simplexPointsP[0] + t * (m_simplexPointsP[1] - m_simplexPointsP[0]); m_cachedP2 = m_simplexPointsQ[0] + t * (m_simplexPointsQ[1] - m_simplexPointsQ[0]); m_cachedV = m_cachedP1 - m_cachedP2; - ReduceVertices(m_cachedBC.m_usedVertices); + reduceVertices(m_cachedBC.m_usedVertices); - m_cachedValidClosest = m_cachedBC.IsValid(); + m_cachedValidClosest = m_cachedBC.isValid(); break; } case 3: @@ -165,7 +165,7 @@ bool btVoronoiSimplexSolver::UpdateClosestVectorAndPoints() const btVector3& b = m_simplexVectorW[1]; const btVector3& c = m_simplexVectorW[2]; - ClosestPtPointTriangle(p,a,b,c,m_cachedBC); + closestPtPointTriangle(p,a,b,c,m_cachedBC); m_cachedP1 = m_simplexPointsP[0] * m_cachedBC.m_barycentricCoords[0] + m_simplexPointsP[1] * m_cachedBC.m_barycentricCoords[1] + m_simplexPointsP[2] * m_cachedBC.m_barycentricCoords[2] + @@ -178,8 +178,8 @@ bool btVoronoiSimplexSolver::UpdateClosestVectorAndPoints() m_cachedV = m_cachedP1-m_cachedP2; - ReduceVertices (m_cachedBC.m_usedVertices); - m_cachedValidClosest = m_cachedBC.IsValid(); + reduceVertices (m_cachedBC.m_usedVertices); + m_cachedValidClosest = m_cachedBC.isValid(); break; } @@ -194,7 +194,7 @@ bool btVoronoiSimplexSolver::UpdateClosestVectorAndPoints() const btVector3& c = m_simplexVectorW[2]; const btVector3& d = m_simplexVectorW[3]; - bool hasSeperation = ClosestPtPointTetrahedron(p,a,b,c,d,m_cachedBC); + bool hasSeperation = closestPtPointTetrahedron(p,a,b,c,d,m_cachedBC); if (hasSeperation) { @@ -210,7 +210,7 @@ bool btVoronoiSimplexSolver::UpdateClosestVectorAndPoints() m_simplexPointsQ[3] * m_cachedBC.m_barycentricCoords[3]; m_cachedV = m_cachedP1-m_cachedP2; - ReduceVertices (m_cachedBC.m_usedVertices); + reduceVertices (m_cachedBC.m_usedVertices); } else { // printf("sub distance got penetration\n"); @@ -227,7 +227,7 @@ bool btVoronoiSimplexSolver::UpdateClosestVectorAndPoints() break; } - m_cachedValidClosest = m_cachedBC.IsValid(); + m_cachedValidClosest = m_cachedBC.isValid(); //closest point origin from tetrahedron break; @@ -246,7 +246,7 @@ bool btVoronoiSimplexSolver::UpdateClosestVectorAndPoints() //return/calculate the closest vertex bool btVoronoiSimplexSolver::closest(btVector3& v) { - bool succes = UpdateClosestVectorAndPoints(); + bool succes = updateClosestVectorAndPoints(); v = m_cachedV; return succes; } @@ -318,7 +318,7 @@ bool btVoronoiSimplexSolver::emptySimplex() const void btVoronoiSimplexSolver::compute_points(btPoint3& p1, btPoint3& p2) { - UpdateClosestVectorAndPoints(); + updateClosestVectorAndPoints(); p1 = m_cachedP1; p2 = m_cachedP2; @@ -327,7 +327,7 @@ void btVoronoiSimplexSolver::compute_points(btPoint3& p1, btPoint3& p2) -bool btVoronoiSimplexSolver::ClosestPtPointTriangle(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c,btSubSimplexClosestResult& result) +bool btVoronoiSimplexSolver::closestPtPointTriangle(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c,btSubSimplexClosestResult& result) { result.m_usedVertices.reset(); @@ -341,7 +341,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTriangle(const btPoint3& p, const btP { result.m_closestPointOnSimplex = a; result.m_usedVertices.usedVertexA = true; - result.SetBarycentricCoordinates(1,0,0); + result.setBarycentricCoordinates(1,0,0); return true;// a; // barycentric coordinates (1,0,0) } @@ -353,7 +353,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTriangle(const btPoint3& p, const btP { result.m_closestPointOnSimplex = b; result.m_usedVertices.usedVertexB = true; - result.SetBarycentricCoordinates(0,1,0); + result.setBarycentricCoordinates(0,1,0); return true; // b; // barycentric coordinates (0,1,0) } @@ -364,7 +364,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTriangle(const btPoint3& p, const btP result.m_closestPointOnSimplex = a + v * ab; result.m_usedVertices.usedVertexA = true; result.m_usedVertices.usedVertexB = true; - result.SetBarycentricCoordinates(1-v,v,0); + result.setBarycentricCoordinates(1-v,v,0); return true; //return a + v * ab; // barycentric coordinates (1-v,v,0) } @@ -377,7 +377,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTriangle(const btPoint3& p, const btP { result.m_closestPointOnSimplex = c; result.m_usedVertices.usedVertexC = true; - result.SetBarycentricCoordinates(0,0,1); + result.setBarycentricCoordinates(0,0,1); return true;//c; // barycentric coordinates (0,0,1) } @@ -388,7 +388,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTriangle(const btPoint3& p, const btP result.m_closestPointOnSimplex = a + w * ac; result.m_usedVertices.usedVertexA = true; result.m_usedVertices.usedVertexC = true; - result.SetBarycentricCoordinates(1-w,0,w); + result.setBarycentricCoordinates(1-w,0,w); return true; //return a + w * ac; // barycentric coordinates (1-w,0,w) } @@ -401,7 +401,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTriangle(const btPoint3& p, const btP result.m_closestPointOnSimplex = b + w * (c - b); result.m_usedVertices.usedVertexB = true; result.m_usedVertices.usedVertexC = true; - result.SetBarycentricCoordinates(0,1-w,w); + result.setBarycentricCoordinates(0,1-w,w); return true; // return b + w * (c - b); // barycentric coordinates (0,1-w,w) } @@ -415,7 +415,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTriangle(const btPoint3& p, const btP result.m_usedVertices.usedVertexA = true; result.m_usedVertices.usedVertexB = true; result.m_usedVertices.usedVertexC = true; - result.SetBarycentricCoordinates(1-v-w,v,w); + result.setBarycentricCoordinates(1-v-w,v,w); return true; // return a + ab * v + ac * w; // = u*a + v*b + w*c, u = va * denom = 1.0f - v - w @@ -427,7 +427,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTriangle(const btPoint3& p, const btP /// Test if point p and d lie on opposite sides of plane through abc -int btVoronoiSimplexSolver::PointOutsideOfPlane(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c, const btPoint3& d) +int btVoronoiSimplexSolver::pointOutsideOfPlane(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c, const btPoint3& d) { btVector3 normal = (b-a).cross(c-a); @@ -446,7 +446,7 @@ int btVoronoiSimplexSolver::PointOutsideOfPlane(const btPoint3& p, const btPoint } -bool btVoronoiSimplexSolver::ClosestPtPointTetrahedron(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c, const btPoint3& d, btSubSimplexClosestResult& finalResult) +bool btVoronoiSimplexSolver::closestPtPointTetrahedron(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c, const btPoint3& d, btSubSimplexClosestResult& finalResult) { btSubSimplexClosestResult tempResult; @@ -458,10 +458,10 @@ bool btVoronoiSimplexSolver::ClosestPtPointTetrahedron(const btPoint3& p, const finalResult.m_usedVertices.usedVertexC = true; finalResult.m_usedVertices.usedVertexD = true; - int pointOutsideABC = PointOutsideOfPlane(p, a, b, c, d); - int pointOutsideACD = PointOutsideOfPlane(p, a, c, d, b); - int pointOutsideADB = PointOutsideOfPlane(p, a, d, b, c); - int pointOutsideBDC = PointOutsideOfPlane(p, b, d, c, a); + int pointOutsideABC = pointOutsideOfPlane(p, a, b, c, d); + int pointOutsideACD = pointOutsideOfPlane(p, a, c, d, b); + int pointOutsideADB = pointOutsideOfPlane(p, a, d, b, c); + int pointOutsideBDC = pointOutsideOfPlane(p, b, d, c, a); if (pointOutsideABC < 0 || pointOutsideACD < 0 || pointOutsideADB < 0 || pointOutsideBDC < 0) { @@ -479,7 +479,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTetrahedron(const btPoint3& p, const // If point outside face abc then compute closest point on abc if (pointOutsideABC) { - ClosestPtPointTriangle(p, a, b, c,tempResult); + closestPtPointTriangle(p, a, b, c,tempResult); btPoint3 q = tempResult.m_closestPointOnSimplex; float sqDist = (q - p).dot( q - p); @@ -492,7 +492,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTetrahedron(const btPoint3& p, const finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA; finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexB; finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexC; - finalResult.SetBarycentricCoordinates( + finalResult.setBarycentricCoordinates( tempResult.m_barycentricCoords[VERTA], tempResult.m_barycentricCoords[VERTB], tempResult.m_barycentricCoords[VERTC], @@ -506,7 +506,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTetrahedron(const btPoint3& p, const // Repeat test for face acd if (pointOutsideACD) { - ClosestPtPointTriangle(p, a, c, d,tempResult); + closestPtPointTriangle(p, a, c, d,tempResult); btPoint3 q = tempResult.m_closestPointOnSimplex; //convert result bitmask! @@ -519,7 +519,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTetrahedron(const btPoint3& p, const finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA; finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexB; finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexC; - finalResult.SetBarycentricCoordinates( + finalResult.setBarycentricCoordinates( tempResult.m_barycentricCoords[VERTA], 0, tempResult.m_barycentricCoords[VERTB], @@ -533,7 +533,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTetrahedron(const btPoint3& p, const if (pointOutsideADB) { - ClosestPtPointTriangle(p, a, d, b,tempResult); + closestPtPointTriangle(p, a, d, b,tempResult); btPoint3 q = tempResult.m_closestPointOnSimplex; //convert result bitmask! @@ -546,7 +546,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTetrahedron(const btPoint3& p, const finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA; finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexB; finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexC; - finalResult.SetBarycentricCoordinates( + finalResult.setBarycentricCoordinates( tempResult.m_barycentricCoords[VERTA], tempResult.m_barycentricCoords[VERTC], 0, @@ -560,7 +560,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTetrahedron(const btPoint3& p, const if (pointOutsideBDC) { - ClosestPtPointTriangle(p, b, d, c,tempResult); + closestPtPointTriangle(p, b, d, c,tempResult); btPoint3 q = tempResult.m_closestPointOnSimplex; //convert result bitmask! float sqDist = (q - p).dot( q - p); @@ -573,7 +573,7 @@ bool btVoronoiSimplexSolver::ClosestPtPointTetrahedron(const btPoint3& p, const finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexB; finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexC; - finalResult.SetBarycentricCoordinates( + finalResult.setBarycentricCoordinates( 0, tempResult.m_barycentricCoords[VERTA], tempResult.m_barycentricCoords[VERTC], diff --git a/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h b/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h index da6aa9680..8b7439969 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h +++ b/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h @@ -58,13 +58,13 @@ struct btSubSimplexClosestResult float m_barycentricCoords[4]; bool m_degenerate; - void Reset() + void reset() { m_degenerate = false; - SetBarycentricCoordinates(); + setBarycentricCoordinates(); m_usedVertices.reset(); } - bool IsValid() + bool isValid() { bool valid = (m_barycentricCoords[0] >= 0.f) && (m_barycentricCoords[1] >= 0.f) && @@ -74,7 +74,7 @@ struct btSubSimplexClosestResult return valid; } - void SetBarycentricCoordinates(float a=0.f,float b=0.f,float c=0.f,float d=0.f) + void setBarycentricCoordinates(float a=0.f,float b=0.f,float c=0.f,float d=0.f) { m_barycentricCoords[0] = a; m_barycentricCoords[1] = b; @@ -113,12 +113,12 @@ public: bool m_needsUpdate; void removeVertex(int index); - void ReduceVertices (const btUsageBitfield& usedVerts); - bool UpdateClosestVectorAndPoints(); + void reduceVertices (const btUsageBitfield& usedVerts); + bool updateClosestVectorAndPoints(); - bool ClosestPtPointTetrahedron(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c, const btPoint3& d, btSubSimplexClosestResult& finalResult); - int PointOutsideOfPlane(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c, const btPoint3& d); - bool ClosestPtPointTriangle(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c,btSubSimplexClosestResult& result); + bool closestPtPointTetrahedron(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c, const btPoint3& d, btSubSimplexClosestResult& finalResult); + int pointOutsideOfPlane(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c, const btPoint3& d); + bool closestPtPointTriangle(const btPoint3& p, const btPoint3& a, const btPoint3& b, const btPoint3& c,btSubSimplexClosestResult& result); public: diff --git a/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h b/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h index 52c7abbfe..e073797f9 100644 --- a/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h +++ b/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h @@ -31,7 +31,7 @@ public: virtual ~btConstraintSolver() {} - virtual float SolveGroup(btPersistentManifold** manifold,int numManifolds,const btContactSolverInfo& info,class btIDebugDraw* debugDrawer = 0) = 0; + virtual float solveGroup(btPersistentManifold** manifold,int numManifolds,const btContactSolverInfo& info,class btIDebugDraw* debugDrawer = 0) = 0; }; diff --git a/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp index f468d2755..9019035f5 100644 --- a/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp @@ -100,8 +100,8 @@ float resolveSingleCollision( ) { - const btVector3& pos1 = contactPoint.GetPositionWorldOnA(); - const btVector3& pos2 = contactPoint.GetPositionWorldOnB(); + const btVector3& pos1 = contactPoint.getPositionWorldOnA(); + const btVector3& pos2 = contactPoint.getPositionWorldOnB(); // printf("distance=%f\n",distance); @@ -136,7 +136,7 @@ float resolveSingleCollision( btConstraintPersistentData* cpd = (btConstraintPersistentData*) contactPoint.m_userPersistentData; assert(cpd); - btScalar distance = cpd->m_penetration;//contactPoint.GetDistance(); + btScalar distance = cpd->m_penetration;//contactPoint.getDistance(); //distance = 0.f; @@ -174,8 +174,8 @@ float resolveSingleFriction( ) { - const btVector3& pos1 = contactPoint.GetPositionWorldOnA(); - const btVector3& pos2 = contactPoint.GetPositionWorldOnB(); + const btVector3& pos1 = contactPoint.getPositionWorldOnA(); + const btVector3& pos2 = contactPoint.getPositionWorldOnB(); btVector3 rel_pos1 = pos1 - body1.getCenterOfMassPosition(); btVector3 rel_pos2 = pos2 - body2.getCenterOfMassPosition(); diff --git a/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp index 0422a62c5..4d0b442ab 100644 --- a/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp @@ -46,7 +46,7 @@ btGeneric6DofConstraint::btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& } -void btGeneric6DofConstraint::BuildJacobian() +void btGeneric6DofConstraint::buildJacobian() { btVector3 normal(0,0,0); @@ -116,7 +116,7 @@ void btGeneric6DofConstraint::BuildJacobian() } } -void btGeneric6DofConstraint::SolveConstraint(btScalar timeStep) +void btGeneric6DofConstraint::solveConstraint(btScalar timeStep) { btScalar tau = 0.1f; btScalar damping = 1.0f; @@ -194,12 +194,12 @@ void btGeneric6DofConstraint::SolveConstraint(btScalar timeStep) } } -void btGeneric6DofConstraint::UpdateRHS(btScalar timeStep) +void btGeneric6DofConstraint::updateRHS(btScalar timeStep) { } -btScalar btGeneric6DofConstraint::ComputeAngle(int axis) const +btScalar btGeneric6DofConstraint::computeAngle(int axis) const { btScalar angle; diff --git a/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h b/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h index ec31df72a..329048b57 100644 --- a/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h +++ b/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h @@ -47,13 +47,13 @@ public: btGeneric6DofConstraint(); - virtual void BuildJacobian(); + virtual void buildJacobian(); - virtual void SolveConstraint(btScalar timeStep); + virtual void solveConstraint(btScalar timeStep); - void UpdateRHS(btScalar timeStep); + void updateRHS(btScalar timeStep); - btScalar ComputeAngle(int axis) const; + btScalar computeAngle(int axis) const; void setLinearLowerLimit(const btVector3& linearLower) { @@ -99,11 +99,11 @@ public: return (m_upperLimit[limitIndex] >= m_lowerLimit[limitIndex]); } - const btRigidBody& GetRigidBodyA() const + const btRigidBody& getRigidBodyA() const { return m_rbA; } - const btRigidBody& GetRigidBodyB() const + const btRigidBody& getRigidBodyB() const { return m_rbB; } diff --git a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp index b359ca0b4..ea58cf0b5 100644 --- a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp @@ -45,7 +45,7 @@ m_angularOnly(false) } -void btHingeConstraint::BuildJacobian() +void btHingeConstraint::buildJacobian() { m_appliedImpulse = 0.f; @@ -74,7 +74,7 @@ void btHingeConstraint::BuildJacobian() //these two jointAxis require equal angular velocities for both bodies //this is unused for now, it's a todo - btVector3 axisWorldA = GetRigidBodyA().getCenterOfMassTransform().getBasis() * m_axisInA; + btVector3 axisWorldA = getRigidBodyA().getCenterOfMassTransform().getBasis() * m_axisInA; btVector3 jointAxis0; btVector3 jointAxis1; btPlaneSpace1(axisWorldA,jointAxis0,jointAxis1); @@ -94,7 +94,7 @@ void btHingeConstraint::BuildJacobian() } -void btHingeConstraint::SolveConstraint(btScalar timeStep) +void btHingeConstraint::solveConstraint(btScalar timeStep) { //#define NEW_IMPLEMENTATION @@ -150,8 +150,8 @@ void btHingeConstraint::SolveConstraint(btScalar timeStep) ///solve angular part // get axes in world space - btVector3 axisA = GetRigidBodyA().getCenterOfMassTransform().getBasis() * m_axisInA; - btVector3 axisB = GetRigidBodyB().getCenterOfMassTransform().getBasis() * m_axisInB; + btVector3 axisA = getRigidBodyA().getCenterOfMassTransform().getBasis() * m_axisInA; + btVector3 axisB = getRigidBodyB().getCenterOfMassTransform().getBasis() * m_axisInB; // constraint axes in world space btVector3 jointAxis0; @@ -230,11 +230,11 @@ void btHingeConstraint::SolveConstraint(btScalar timeStep) ///solve angular part // get axes in world space - btVector3 axisA = GetRigidBodyA().getCenterOfMassTransform().getBasis() * m_axisInA; - btVector3 axisB = GetRigidBodyB().getCenterOfMassTransform().getBasis() * m_axisInB; + btVector3 axisA = getRigidBodyA().getCenterOfMassTransform().getBasis() * m_axisInA; + btVector3 axisB = getRigidBodyB().getCenterOfMassTransform().getBasis() * m_axisInB; - const btVector3& angVelA = GetRigidBodyA().getAngularVelocity(); - const btVector3& angVelB = GetRigidBodyB().getAngularVelocity(); + const btVector3& angVelA = getRigidBodyA().getAngularVelocity(); + const btVector3& angVelB = getRigidBodyB().getAngularVelocity(); btVector3 angA = angVelA - axisA * axisA.dot(angVelA); btVector3 angB = angVelB - axisB * axisB.dot(angVelB); btVector3 velrel = angA-angB; @@ -245,8 +245,8 @@ void btHingeConstraint::SolveConstraint(btScalar timeStep) if (len > 0.00001f) { btVector3 normal = velrel.normalized(); - float denom = GetRigidBodyA().ComputeAngularImpulseDenominator(normal) + - GetRigidBodyB().ComputeAngularImpulseDenominator(normal); + float denom = getRigidBodyA().computeAngularImpulseDenominator(normal) + + getRigidBodyB().computeAngularImpulseDenominator(normal); // scale for mass and relaxation velrel *= (1.f/denom) * 0.9; } @@ -257,8 +257,8 @@ void btHingeConstraint::SolveConstraint(btScalar timeStep) if (len2>0.00001f) { btVector3 normal2 = angularError.normalized(); - float denom2 = GetRigidBodyA().ComputeAngularImpulseDenominator(normal2) + - GetRigidBodyB().ComputeAngularImpulseDenominator(normal2); + float denom2 = getRigidBodyA().computeAngularImpulseDenominator(normal2) + + getRigidBodyB().computeAngularImpulseDenominator(normal2); angularError *= (1.f/denom2) * relaxation; } @@ -269,7 +269,7 @@ void btHingeConstraint::SolveConstraint(btScalar timeStep) } -void btHingeConstraint::UpdateRHS(btScalar timeStep) +void btHingeConstraint::updateRHS(btScalar timeStep) { } diff --git a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h index 8b9dfae46..3bade2b09 100644 --- a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h +++ b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h @@ -46,17 +46,17 @@ public: btHingeConstraint(); - virtual void BuildJacobian(); + virtual void buildJacobian(); - virtual void SolveConstraint(btScalar timeStep); + virtual void solveConstraint(btScalar timeStep); - void UpdateRHS(btScalar timeStep); + void updateRHS(btScalar timeStep); - const btRigidBody& GetRigidBodyA() const + const btRigidBody& getRigidBodyA() const { return m_rbA; } - const btRigidBody& GetRigidBodyB() const + const btRigidBody& getRigidBodyB() const { return m_rbB; } diff --git a/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp index 4c436ad32..4497e720f 100644 --- a/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp @@ -38,7 +38,7 @@ btPoint2PointConstraint::btPoint2PointConstraint(btRigidBody& rbA,const btVector } -void btPoint2PointConstraint::BuildJacobian() +void btPoint2PointConstraint::buildJacobian() { m_appliedImpulse = 0.f; @@ -62,7 +62,7 @@ void btPoint2PointConstraint::BuildJacobian() } -void btPoint2PointConstraint::SolveConstraint(btScalar timeStep) +void btPoint2PointConstraint::solveConstraint(btScalar timeStep) { btVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_pivotInA; btVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_pivotInB; @@ -109,7 +109,7 @@ void btPoint2PointConstraint::SolveConstraint(btScalar timeStep) } } -void btPoint2PointConstraint::UpdateRHS(btScalar timeStep) +void btPoint2PointConstraint::updateRHS(btScalar timeStep) { } diff --git a/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h b/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h index eea32b01d..8aae8d74c 100644 --- a/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h +++ b/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h @@ -54,19 +54,19 @@ public: btPoint2PointConstraint(); - virtual void BuildJacobian(); + virtual void buildJacobian(); - virtual void SolveConstraint(btScalar timeStep); + virtual void solveConstraint(btScalar timeStep); - void UpdateRHS(btScalar timeStep); + void updateRHS(btScalar timeStep); - void SetPivotA(const btVector3& pivotA) + void setPivotA(const btVector3& pivotA) { m_pivotInA = pivotA; } - void SetPivotB(const btVector3& pivotB) + void setPivotB(const btVector3& pivotB) { m_pivotInB = pivotB; } diff --git a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp index 763a3a3e9..e747177a5 100644 --- a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp +++ b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp @@ -59,14 +59,14 @@ btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver() } /// btSequentialImpulseConstraintSolver Sequentially applies impulses -float btSequentialImpulseConstraintSolver::SolveGroup(btPersistentManifold** manifoldPtr, int numManifolds,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer) +float btSequentialImpulseConstraintSolver::solveGroup(btPersistentManifold** manifoldPtr, int numManifolds,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer) { btContactSolverInfo info = infoGlobal; int numiter = infoGlobal.m_numIterations; #ifdef USE_PROFILE - btProfiler::beginBlock("Solve"); + btProfiler::beginBlock("solve"); #endif //USE_PROFILE { @@ -76,8 +76,8 @@ float btSequentialImpulseConstraintSolver::SolveGroup(btPersistentManifold** man int k=j; //interleaving the preparation with solving impacts the behaviour a lot, todo: find out why - PrepareConstraints(manifoldPtr[k],info,debugDrawer); - Solve(manifoldPtr[k],info,0,debugDrawer); + prepareConstraints(manifoldPtr[k],info,debugDrawer); + solve(manifoldPtr[k],info,0,debugDrawer); } } @@ -93,14 +93,14 @@ float btSequentialImpulseConstraintSolver::SolveGroup(btPersistentManifold** man if (i&1) k=numManifolds-j-1; - Solve(manifoldPtr[k],info,i,debugDrawer); + solve(manifoldPtr[k],info,i,debugDrawer); } } #ifdef USE_PROFILE - btProfiler::endBlock("Solve"); + btProfiler::endBlock("solve"); - btProfiler::beginBlock("SolveFriction"); + btProfiler::beginBlock("solveFriction"); #endif //USE_PROFILE //now solve the friction @@ -112,11 +112,11 @@ float btSequentialImpulseConstraintSolver::SolveGroup(btPersistentManifold** man int k = j; if (i&1) k=numManifolds-j-1; - SolveFriction(manifoldPtr[k],info,i,debugDrawer); + solveFriction(manifoldPtr[k],info,i,debugDrawer); } } #ifdef USE_PROFILE - btProfiler::endBlock("SolveFriction"); + btProfiler::endBlock("solveFriction"); #endif //USE_PROFILE return 0.f; @@ -131,29 +131,29 @@ btScalar restitutionCurve(btScalar rel_vel, btScalar restitution) } -void btSequentialImpulseConstraintSolver::PrepareConstraints(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,btIDebugDraw* debugDrawer) +void btSequentialImpulseConstraintSolver::prepareConstraints(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,btIDebugDraw* debugDrawer) { - btRigidBody* body0 = (btRigidBody*)manifoldPtr->GetBody0(); - btRigidBody* body1 = (btRigidBody*)manifoldPtr->GetBody1(); + btRigidBody* body0 = (btRigidBody*)manifoldPtr->getBody0(); + btRigidBody* body1 = (btRigidBody*)manifoldPtr->getBody1(); //only necessary to refresh the manifold once (first iteration). The integration is done outside the loop { - manifoldPtr->RefreshContactPoints(body0->getCenterOfMassTransform(),body1->getCenterOfMassTransform()); + manifoldPtr->refreshContactPoints(body0->getCenterOfMassTransform(),body1->getCenterOfMassTransform()); - int numpoints = manifoldPtr->GetNumContacts(); + int numpoints = manifoldPtr->getNumContacts(); gTotalContactPoints += numpoints; btVector3 color(0,1,0); for (int i=0;iGetContactPoint(i); - if (cp.GetDistance() <= 0.f) + btManifoldPoint& cp = manifoldPtr->getContactPoint(i); + if (cp.getDistance() <= 0.f) { - const btVector3& pos1 = cp.GetPositionWorldOnA(); - const btVector3& pos2 = cp.GetPositionWorldOnB(); + const btVector3& pos1 = cp.getPositionWorldOnA(); + const btVector3& pos2 = cp.getPositionWorldOnB(); btVector3 rel_pos1 = pos1 - body0->getCenterOfMassPosition(); btVector3 rel_pos2 = pos2 - body1->getCenterOfMassPosition(); @@ -173,15 +173,15 @@ void btSequentialImpulseConstraintSolver::PrepareConstraints(btPersistentManifol { //might be invalid cpd->m_persistentLifeTime++; - if (cpd->m_persistentLifeTime != cp.GetLifeTime()) + if (cpd->m_persistentLifeTime != cp.getLifeTime()) { - //printf("Invalid: cpd->m_persistentLifeTime = %i cp.GetLifeTime() = %i\n",cpd->m_persistentLifeTime,cp.GetLifeTime()); + //printf("Invalid: cpd->m_persistentLifeTime = %i cp.getLifeTime() = %i\n",cpd->m_persistentLifeTime,cp.getLifeTime()); new (cpd) btConstraintPersistentData; - cpd->m_persistentLifeTime = cp.GetLifeTime(); + cpd->m_persistentLifeTime = cp.getLifeTime(); } else { - //printf("Persistent: cpd->m_persistentLifeTime = %i cp.GetLifeTime() = %i\n",cpd->m_persistentLifeTime,cp.GetLifeTime()); + //printf("Persistent: cpd->m_persistentLifeTime = %i cp.getLifeTime() = %i\n",cpd->m_persistentLifeTime,cp.getLifeTime()); } } else @@ -191,8 +191,8 @@ void btSequentialImpulseConstraintSolver::PrepareConstraints(btPersistentManifol totalCpd ++; //printf("totalCpd = %i Created Ptr %x\n",totalCpd,cpd); cp.m_userPersistentData = cpd; - cpd->m_persistentLifeTime = cp.GetLifeTime(); - //printf("CREATED: %x . cpd->m_persistentLifeTime = %i cp.GetLifeTime() = %i\n",cpd,cpd->m_persistentLifeTime,cp.GetLifeTime()); + cpd->m_persistentLifeTime = cp.getLifeTime(); + //printf("CREATED: %x . cpd->m_persistentLifeTime = %i cp.getLifeTime() = %i\n",cpd,cpd->m_persistentLifeTime,cp.getLifeTime()); } assert(cpd); @@ -213,7 +213,7 @@ void btSequentialImpulseConstraintSolver::PrepareConstraints(btPersistentManifol float combinedRestitution = cp.m_combinedRestitution; - cpd->m_penetration = cp.GetDistance(); + cpd->m_penetration = cp.getDistance(); cpd->m_friction = cp.m_combinedFriction; cpd->m_restitution = restitutionCurve(rel_vel, combinedRestitution); if (cpd->m_restitution <= 0.) //0.f) @@ -248,14 +248,14 @@ void btSequentialImpulseConstraintSolver::PrepareConstraints(btPersistentManifol cpd->m_accumulatedTangentImpulse0 = 0.f; cpd->m_accumulatedTangentImpulse1 = 0.f; #endif //NO_FRICTION_WARMSTART - float denom0 = body0->ComputeImpulseDenominator(pos1,cpd->m_frictionWorldTangential0); - float denom1 = body1->ComputeImpulseDenominator(pos2,cpd->m_frictionWorldTangential0); + float denom0 = body0->computeImpulseDenominator(pos1,cpd->m_frictionWorldTangential0); + float denom1 = body1->computeImpulseDenominator(pos2,cpd->m_frictionWorldTangential0); float denom = relaxation/(denom0+denom1); cpd->m_jacDiagABInvTangent0 = denom; - denom0 = body0->ComputeImpulseDenominator(pos1,cpd->m_frictionWorldTangential1); - denom1 = body1->ComputeImpulseDenominator(pos2,cpd->m_frictionWorldTangential1); + denom0 = body0->computeImpulseDenominator(pos1,cpd->m_frictionWorldTangential1); + denom1 = body1->computeImpulseDenominator(pos2,cpd->m_frictionWorldTangential1); denom = relaxation/(denom0+denom1); cpd->m_jacDiagABInvTangent1 = denom; @@ -275,16 +275,16 @@ void btSequentialImpulseConstraintSolver::PrepareConstraints(btPersistentManifol } } -float btSequentialImpulseConstraintSolver::Solve(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer) +float btSequentialImpulseConstraintSolver::solve(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer) { - btRigidBody* body0 = (btRigidBody*)manifoldPtr->GetBody0(); - btRigidBody* body1 = (btRigidBody*)manifoldPtr->GetBody1(); + btRigidBody* body0 = (btRigidBody*)manifoldPtr->getBody0(); + btRigidBody* body1 = (btRigidBody*)manifoldPtr->getBody1(); float maxImpulse = 0.f; { - const int numpoints = manifoldPtr->GetNumContacts(); + const int numpoints = manifoldPtr->getNumContacts(); btVector3 color(0,1,0); for (int i=0;iGetContactPoint(j); - if (cp.GetDistance() <= 0.f) + btManifoldPoint& cp = manifoldPtr->getContactPoint(j); + if (cp.getDistance() <= 0.f) { if (iter == 0) { if (debugDrawer) - debugDrawer->DrawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.GetDistance(),cp.GetLifeTime(),color); + debugDrawer->drawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.getDistance(),cp.getLifeTime(),color); } { @@ -324,14 +324,14 @@ float btSequentialImpulseConstraintSolver::Solve(btPersistentManifold* manifoldP return maxImpulse; } -float btSequentialImpulseConstraintSolver::SolveFriction(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer) +float btSequentialImpulseConstraintSolver::solveFriction(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer) { - btRigidBody* body0 = (btRigidBody*)manifoldPtr->GetBody0(); - btRigidBody* body1 = (btRigidBody*)manifoldPtr->GetBody1(); + btRigidBody* body0 = (btRigidBody*)manifoldPtr->getBody0(); + btRigidBody* body1 = (btRigidBody*)manifoldPtr->getBody1(); { - const int numpoints = manifoldPtr->GetNumContacts(); + const int numpoints = manifoldPtr->getNumContacts(); btVector3 color(0,1,0); for (int i=0;iGetContactPoint(j); - if (cp.GetDistance() <= 0.f) + btManifoldPoint& cp = manifoldPtr->getContactPoint(j); + if (cp.getDistance() <= 0.f) { btConstraintPersistentData* cpd = (btConstraintPersistentData*) cp.m_userPersistentData; diff --git a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h index 9d630ff00..e399a5cd7 100644 --- a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h +++ b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h @@ -29,9 +29,9 @@ class btIDebugDraw; /// Applies impulses for combined restitution and penetration recovery and to simulate friction class btSequentialImpulseConstraintSolver : public btConstraintSolver { - float Solve(btPersistentManifold* manifold, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer); - float SolveFriction(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer); - void PrepareConstraints(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,btIDebugDraw* debugDrawer); + float solve(btPersistentManifold* manifold, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer); + float solveFriction(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer); + void prepareConstraints(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,btIDebugDraw* debugDrawer); ContactSolverFunc m_contactDispatch[MAX_CONTACT_SOLVER_TYPES][MAX_CONTACT_SOLVER_TYPES]; ContactSolverFunc m_frictionDispatch[MAX_CONTACT_SOLVER_TYPES][MAX_CONTACT_SOLVER_TYPES]; @@ -42,7 +42,7 @@ public: ///Advanced: Override the default contact solving function for contacts, for certain types of rigidbody ///See btRigidBody::m_contactSolverType and btRigidBody::m_frictionSolverType - void SetContactSolverFunc(ContactSolverFunc func,int type0,int type1) + void setContactSolverFunc(ContactSolverFunc func,int type0,int type1) { m_contactDispatch[type0][type1] = func; } @@ -56,7 +56,7 @@ public: virtual ~btSequentialImpulseConstraintSolver() {} - virtual float SolveGroup(btPersistentManifold** manifold,int numManifolds,const btContactSolverInfo& info, btIDebugDraw* debugDrawer=0); + virtual float solveGroup(btPersistentManifold** manifold,int numManifolds,const btContactSolverInfo& info, btIDebugDraw* debugDrawer=0); }; diff --git a/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h b/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h index 84fc4ae68..b9d290db3 100644 --- a/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h +++ b/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h @@ -40,48 +40,48 @@ public: btTypedConstraint(btRigidBody& rbA,btRigidBody& rbB); - virtual void BuildJacobian() = 0; + virtual void buildJacobian() = 0; - virtual void SolveConstraint(btScalar timeStep) = 0; + virtual void solveConstraint(btScalar timeStep) = 0; - const btRigidBody& GetRigidBodyA() const + const btRigidBody& getRigidBodyA() const { return m_rbA; } - const btRigidBody& GetRigidBodyB() const + const btRigidBody& getRigidBodyB() const { return m_rbB; } - btRigidBody& GetRigidBodyA() + btRigidBody& getRigidBodyA() { return m_rbA; } - btRigidBody& GetRigidBodyB() + btRigidBody& getRigidBodyB() { return m_rbB; } - int GetUserConstraintType() const + int getUserConstraintType() const { return m_userConstraintType ; } - void SetUserConstraintType(int userConstraintType) + void setUserConstraintType(int userConstraintType) { m_userConstraintType = userConstraintType; }; - void SetUserConstraintId(int uid) + void setUserConstraintId(int uid) { m_userConstraintId = uid; } - int GetUserConstraintId() + int getUserConstraintId() { return m_userConstraintId; } - float GetAppliedImpulse() + float getAppliedImpulse() { return m_appliedImpulse; } diff --git a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp index e9343f221..6d40fd14c 100644 --- a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp +++ b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp @@ -72,7 +72,7 @@ void btDiscreteDynamicsWorld::stepSimulation(float timeStep) predictUnconstraintMotion(timeStep); ///perform collision detection - PerformDiscreteCollisionDetection(); + performDiscreteCollisionDetection(); calculateSimulationIslands(); @@ -104,7 +104,7 @@ void btDiscreteDynamicsWorld::updateVehicles(float timeStep) for (int i=0;iUpdateVehicle( timeStep); + vehicle->updateVehicle( timeStep); } } @@ -184,7 +184,7 @@ void btDiscreteDynamicsWorld::solveContactConstraints(btContactSolverInfo& solve virtual void ProcessIsland(btPersistentManifold** manifolds,int numManifolds) { - m_solver->SolveGroup( manifolds, numManifolds,m_solverInfo,m_debugDrawer); + m_solver->solveGroup( manifolds, numManifolds,m_solverInfo,m_debugDrawer); } }; @@ -194,7 +194,7 @@ void btDiscreteDynamicsWorld::solveContactConstraints(btContactSolverInfo& solve /// solve all the contact points and contact friction - m_islandManager->BuildAndProcessIslands(GetCollisionWorld()->GetDispatcher(),GetCollisionWorld()->GetCollisionObjectArray(),&solverCallback); + m_islandManager->buildAndProcessIslands(getCollisionWorld()->getDispatcher(),getCollisionWorld()->getCollisionObjectArray(),&solverCallback); } @@ -203,7 +203,7 @@ void btDiscreteDynamicsWorld::solveContactConstraints(btContactSolverInfo& solve void btDiscreteDynamicsWorld::solveNoncontactConstraints(btContactSolverInfo& solverInfo) { #ifdef USE_QUICKPROF - Profiler::beginBlock("SolveConstraint"); + Profiler::beginBlock("solveConstraint"); #endif //USE_QUICKPROF @@ -215,7 +215,7 @@ void btDiscreteDynamicsWorld::solveNoncontactConstraints(btContactSolverInfo& so for (i=0;i< numConstraints ; i++ ) { btTypedConstraint* constraint = m_constraints[i]; - constraint->BuildJacobian(); + constraint->buildJacobian(); } //solve the regular non-contact constraints (point 2 point, hinge, generic d6) @@ -227,12 +227,12 @@ void btDiscreteDynamicsWorld::solveNoncontactConstraints(btContactSolverInfo& so for (i=0;i< numConstraints ; i++ ) { btTypedConstraint* constraint = m_constraints[i]; - constraint->SolveConstraint( solverInfo.m_timeStep ); + constraint->solveConstraint( solverInfo.m_timeStep ); } } #ifdef USE_QUICKPROF - Profiler::endBlock("SolveConstraint"); + Profiler::endBlock("solveConstraint"); #endif //USE_QUICKPROF } @@ -244,7 +244,7 @@ void btDiscreteDynamicsWorld::calculateSimulationIslands() Profiler::beginBlock("IslandUnionFind"); #endif //USE_QUICKPROF - GetSimulationIslandManager()->UpdateActivationState(GetCollisionWorld(),GetCollisionWorld()->GetDispatcher()); + getSimulationIslandManager()->updateActivationState(getCollisionWorld(),getCollisionWorld()->getDispatcher()); { int i; @@ -253,8 +253,8 @@ void btDiscreteDynamicsWorld::calculateSimulationIslands() { btTypedConstraint* constraint = m_constraints[i]; - const btRigidBody* colObj0 = &constraint->GetRigidBodyA(); - const btRigidBody* colObj1 = &constraint->GetRigidBodyB(); + const btRigidBody* colObj0 = &constraint->getRigidBodyA(); + const btRigidBody* colObj1 = &constraint->getRigidBodyB(); if (((colObj0) && ((colObj0)->mergesSimulationIslands())) && ((colObj1) && ((colObj1)->mergesSimulationIslands()))) @@ -262,7 +262,7 @@ void btDiscreteDynamicsWorld::calculateSimulationIslands() if (colObj0->IsActive() || colObj1->IsActive()) { - GetSimulationIslandManager()->GetUnionFind().unite((colObj0)->m_islandTag1, + getSimulationIslandManager()->getUnionFind().unite((colObj0)->m_islandTag1, (colObj1)->m_islandTag1); } } @@ -270,7 +270,7 @@ void btDiscreteDynamicsWorld::calculateSimulationIslands() } //Store the island id in each body - GetSimulationIslandManager()->StoreIslandActivationState(GetCollisionWorld()); + getSimulationIslandManager()->storeIslandActivationState(getCollisionWorld()); #ifdef USE_QUICKPROF Profiler::endBlock("IslandUnionFind"); @@ -290,9 +290,9 @@ void btDiscreteDynamicsWorld::updateAabbs() if (body->IsActive() && (!body->IsStatic())) { btPoint3 minAabb,maxAabb; - colObj->m_collisionShape->GetAabb(colObj->m_worldTransform, minAabb,maxAabb); + colObj->m_collisionShape->getAabb(colObj->m_worldTransform, minAabb,maxAabb); btSimpleBroadphase* bp = (btSimpleBroadphase*)m_pairCache; - bp->SetAabb(body->m_broadphaseHandle,minAabb,maxAabb); + bp->setAabb(body->m_broadphaseHandle,minAabb,maxAabb); } } } diff --git a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h index 71179d57a..d75a7425d 100644 --- a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h +++ b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h @@ -77,17 +77,17 @@ public: void removeVehicle(btRaycastVehicle* vehicle); - btSimulationIslandManager* GetSimulationIslandManager() + btSimulationIslandManager* getSimulationIslandManager() { return m_islandManager; } - const btSimulationIslandManager* GetSimulationIslandManager() const + const btSimulationIslandManager* getSimulationIslandManager() const { return m_islandManager; } - btCollisionWorld* GetCollisionWorld() + btCollisionWorld* getCollisionWorld() { return this; } diff --git a/src/BulletDynamics/Dynamics/btRigidBody.cpp b/src/BulletDynamics/Dynamics/btRigidBody.cpp index d4d57534e..75f1ee8be 100644 --- a/src/BulletDynamics/Dynamics/btRigidBody.cpp +++ b/src/BulletDynamics/Dynamics/btRigidBody.cpp @@ -60,7 +60,7 @@ void btRigidBody::setLinearVelocity(const btVector3& lin_vel) void btRigidBody::predictIntegratedTransform(btScalar timeStep,btTransform& predictedTransform) const { - btTransformUtil::IntegrateTransform(m_worldTransform,m_linearVelocity,m_angularVelocity,timeStep,predictedTransform); + btTransformUtil::integrateTransform(m_worldTransform,m_linearVelocity,m_angularVelocity,timeStep,predictedTransform); } void btRigidBody::saveKinematicState(btScalar timeStep) @@ -69,7 +69,7 @@ void btRigidBody::saveKinematicState(btScalar timeStep) if (m_kinematicTimeStep) { btVector3 linVel,angVel; - btTransformUtil::CalculateVelocity(m_interpolationWorldTransform,m_worldTransform,m_kinematicTimeStep,m_linearVelocity,m_angularVelocity); + btTransformUtil::calculateVelocity(m_interpolationWorldTransform,m_worldTransform,m_kinematicTimeStep,m_linearVelocity,m_angularVelocity); //printf("angular = %f %f %f\n",m_angularVelocity.getX(),m_angularVelocity.getY(),m_angularVelocity.getZ()); } @@ -81,7 +81,7 @@ void btRigidBody::saveKinematicState(btScalar timeStep) void btRigidBody::getAabb(btVector3& aabbMin,btVector3& aabbMax) const { - GetCollisionShape()->GetAabb(m_worldTransform,aabbMin,aabbMax); + getCollisionShape()->getAabb(m_worldTransform,aabbMin,aabbMax); } diff --git a/src/BulletDynamics/Dynamics/btRigidBody.h b/src/BulletDynamics/Dynamics/btRigidBody.h index 2abe6d947..fb01f4d7c 100644 --- a/src/BulletDynamics/Dynamics/btRigidBody.h +++ b/src/BulletDynamics/Dynamics/btRigidBody.h @@ -78,11 +78,11 @@ public: void setDamping(btScalar lin_damping, btScalar ang_damping); - inline const btCollisionShape* GetCollisionShape() const { + inline const btCollisionShape* getCollisionShape() const { return m_collisionShape; } - inline btCollisionShape* GetCollisionShape() { + inline btCollisionShape* getCollisionShape() { return m_collisionShape; } @@ -197,7 +197,7 @@ public: - inline float ComputeImpulseDenominator(const btPoint3& pos, const btVector3& normal) const + inline float computeImpulseDenominator(const btPoint3& pos, const btVector3& normal) const { btVector3 r0 = pos - getCenterOfMassPosition(); @@ -209,7 +209,7 @@ public: } - inline float ComputeAngularImpulseDenominator(const btVector3& axis) const + inline float computeAngularImpulseDenominator(const btVector3& axis) const { btVector3 vec = axis * getInvInertiaTensorWorld(); return axis.dot(vec); @@ -254,15 +254,15 @@ public: - const btBroadphaseProxy* GetBroadphaseProxy() const + const btBroadphaseProxy* getBroadphaseProxy() const { return m_broadphaseProxy; } - btBroadphaseProxy* GetBroadphaseProxy() + btBroadphaseProxy* getBroadphaseProxy() { return m_broadphaseProxy; } - void SetBroadphaseProxy(btBroadphaseProxy* broadphaseProxy) + void setBroadphaseProxy(btBroadphaseProxy* broadphaseProxy) { m_broadphaseProxy = broadphaseProxy; } diff --git a/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp b/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp index 04c811c64..4e3270417 100644 --- a/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp +++ b/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp @@ -54,15 +54,15 @@ void btSimpleDynamicsWorld::stepSimulation(float timeStep) predictUnconstraintMotion(timeStep); ///perform collision detection - PerformDiscreteCollisionDetection(); + performDiscreteCollisionDetection(); ///solve contact constraints btPersistentManifold** manifoldPtr = ((btCollisionDispatcher*)m_dispatcher1)->getInternalManifoldPointer(); - int numManifolds = m_dispatcher1->GetNumManifolds(); + int numManifolds = m_dispatcher1->getNumManifolds(); btContactSolverInfo infoGlobal; infoGlobal.m_timeStep = timeStep; btIDebugDraw* debugDrawer=0; - m_constraintSolver->SolveGroup(manifoldPtr, numManifolds,infoGlobal,debugDrawer); + m_constraintSolver->solveGroup(manifoldPtr, numManifolds,infoGlobal,debugDrawer); ///integrate transforms integrateTransforms(timeStep); @@ -85,9 +85,9 @@ void btSimpleDynamicsWorld::updateAabbs() if (body->IsActive() && (!body->IsStatic())) { btPoint3 minAabb,maxAabb; - colObj->m_collisionShape->GetAabb(colObj->m_worldTransform, minAabb,maxAabb); + colObj->m_collisionShape->getAabb(colObj->m_worldTransform, minAabb,maxAabb); btSimpleBroadphase* bp = (btSimpleBroadphase*)m_pairCache; - bp->SetAabb(body->m_broadphaseHandle,minAabb,maxAabb); + bp->setAabb(body->m_broadphaseHandle,minAabb,maxAabb); } } } diff --git a/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp b/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp index 1ad55c663..ad08cb852 100644 --- a/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp +++ b/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp @@ -33,11 +33,11 @@ m_pitchControl(0.f) m_indexRightAxis = 0; m_indexUpAxis = 2; m_indexForwardAxis = 1; - DefaultInit(tuning); + defaultInit(tuning); } -void btRaycastVehicle::DefaultInit(const btVehicleTuning& tuning) +void btRaycastVehicle::defaultInit(const btVehicleTuning& tuning) { m_currentVehicleSpeedKmHour = 0.f; m_steeringValue = 0.f; @@ -54,7 +54,7 @@ btRaycastVehicle::~btRaycastVehicle() // // basically most of the code is general for 2 or 4 wheel vehicles, but some of it needs to be reviewed // -btWheelInfo& btRaycastVehicle::AddWheel( const btVector3& connectionPointCS, const btVector3& wheelDirectionCS0,const btVector3& wheelAxleCS, btScalar suspensionRestLength, btScalar wheelRadius,const btVehicleTuning& tuning, bool isFrontWheel) +btWheelInfo& btRaycastVehicle::addWheel( const btVector3& connectionPointCS, const btVector3& wheelDirectionCS0,const btVector3& wheelAxleCS, btScalar suspensionRestLength, btScalar wheelRadius,const btVehicleTuning& tuning, bool isFrontWheel) { btWheelInfoConstructionInfo ci; @@ -73,29 +73,29 @@ btWheelInfo& btRaycastVehicle::AddWheel( const btVector3& connectionPointCS, con m_wheelInfo.push_back( btWheelInfo(ci)); - btWheelInfo& wheel = m_wheelInfo[GetNumWheels()-1]; + btWheelInfo& wheel = m_wheelInfo[getNumWheels()-1]; - UpdateWheelTransformsWS( wheel ); - UpdateWheelTransform(GetNumWheels()-1); + updateWheelTransformsWS( wheel ); + updateWheelTransform(getNumWheels()-1); return wheel; } -const btTransform& btRaycastVehicle::GetWheelTransformWS( int wheelIndex ) const +const btTransform& btRaycastVehicle::getWheelTransformWS( int wheelIndex ) const { - assert(wheelIndex < GetNumWheels()); + assert(wheelIndex < getNumWheels()); const btWheelInfo& wheel = m_wheelInfo[wheelIndex]; return wheel.m_worldTransform; } -void btRaycastVehicle::UpdateWheelTransform( int wheelIndex ) +void btRaycastVehicle::updateWheelTransform( int wheelIndex ) { btWheelInfo& wheel = m_wheelInfo[ wheelIndex ]; - UpdateWheelTransformsWS(wheel); + updateWheelTransformsWS(wheel); btVector3 up = -wheel.m_raycastInfo.m_wheelDirectionWS; const btVector3& right = wheel.m_raycastInfo.m_wheelAxleWS; btVector3 fwd = up.cross(right); @@ -121,7 +121,7 @@ void btRaycastVehicle::UpdateWheelTransform( int wheelIndex ) ); } -void btRaycastVehicle::ResetSuspension() +void btRaycastVehicle::resetSuspension() { std::vector::iterator wheelIt; @@ -129,7 +129,7 @@ void btRaycastVehicle::ResetSuspension() !(wheelIt == m_wheelInfo.end());wheelIt++) { btWheelInfo& wheel = *wheelIt; - wheel.m_raycastInfo.m_suspensionLength = wheel.GetSuspensionRestLength(); + wheel.m_raycastInfo.m_suspensionLength = wheel.getSuspensionRestLength(); wheel.m_suspensionRelativeVelocity = 0.0f; wheel.m_raycastInfo.m_contactNormalWS = - wheel.m_raycastInfo.m_wheelDirectionWS; @@ -138,25 +138,25 @@ void btRaycastVehicle::ResetSuspension() } } -void btRaycastVehicle::UpdateWheelTransformsWS(btWheelInfo& wheel ) +void btRaycastVehicle::updateWheelTransformsWS(btWheelInfo& wheel ) { wheel.m_raycastInfo.m_isInContact = false; - const btTransform& chassisTrans = GetRigidBody()->getCenterOfMassTransform(); + const btTransform& chassisTrans = getRigidBody()->getCenterOfMassTransform(); wheel.m_raycastInfo.m_hardPointWS = chassisTrans( wheel.m_chassisConnectionPointCS ); wheel.m_raycastInfo.m_wheelDirectionWS = chassisTrans.getBasis() * wheel.m_wheelDirectionCS ; wheel.m_raycastInfo.m_wheelAxleWS = chassisTrans.getBasis() * wheel.m_wheelAxleCS; } -btScalar btRaycastVehicle::Raycast(btWheelInfo& wheel) +btScalar btRaycastVehicle::rayCast(btWheelInfo& wheel) { - UpdateWheelTransformsWS( wheel ); + updateWheelTransformsWS( wheel ); btScalar depth = -1; - btScalar raylen = wheel.GetSuspensionRestLength()+wheel.m_wheelsRadius; + btScalar raylen = wheel.getSuspensionRestLength()+wheel.m_wheelsRadius; btVector3 rayvector = wheel.m_raycastInfo.m_wheelDirectionWS * (raylen); const btVector3& source = wheel.m_raycastInfo.m_hardPointWS; @@ -167,7 +167,7 @@ btScalar btRaycastVehicle::Raycast(btWheelInfo& wheel) btVehicleRaycaster::btVehicleRaycasterResult rayResults; - void* object = m_vehicleRaycaster->CastRay(source,target,rayResults); + void* object = m_vehicleRaycaster->castRay(source,target,rayResults); wheel.m_raycastInfo.m_groundObject = 0; @@ -186,8 +186,8 @@ btScalar btRaycastVehicle::Raycast(btWheelInfo& wheel) wheel.m_raycastInfo.m_suspensionLength = hitDistance - wheel.m_wheelsRadius; //clamp on max suspension travel - float minSuspensionLength = wheel.GetSuspensionRestLength() - wheel.m_maxSuspensionTravelCm*0.01f; - float maxSuspensionLength = wheel.GetSuspensionRestLength()+ wheel.m_maxSuspensionTravelCm*0.01f; + float minSuspensionLength = wheel.getSuspensionRestLength() - wheel.m_maxSuspensionTravelCm*0.01f; + float maxSuspensionLength = wheel.getSuspensionRestLength()+ wheel.m_maxSuspensionTravelCm*0.01f; if (wheel.m_raycastInfo.m_suspensionLength < minSuspensionLength) { wheel.m_raycastInfo.m_suspensionLength = minSuspensionLength; @@ -202,9 +202,9 @@ btScalar btRaycastVehicle::Raycast(btWheelInfo& wheel) btScalar denominator= wheel.m_raycastInfo.m_contactNormalWS.dot( wheel.m_raycastInfo.m_wheelDirectionWS ); btVector3 chassis_velocity_at_contactPoint; - btVector3 relpos = wheel.m_raycastInfo.m_contactPointWS-GetRigidBody()->getCenterOfMassPosition(); + btVector3 relpos = wheel.m_raycastInfo.m_contactPointWS-getRigidBody()->getCenterOfMassPosition(); - chassis_velocity_at_contactPoint = GetRigidBody()->getVelocityInLocalPoint(relpos); + chassis_velocity_at_contactPoint = getRigidBody()->getVelocityInLocalPoint(relpos); btScalar projVel = wheel.m_raycastInfo.m_contactNormalWS.dot( chassis_velocity_at_contactPoint ); @@ -223,7 +223,7 @@ btScalar btRaycastVehicle::Raycast(btWheelInfo& wheel) } else { //put wheel info as in rest position - wheel.m_raycastInfo.m_suspensionLength = wheel.GetSuspensionRestLength(); + wheel.m_raycastInfo.m_suspensionLength = wheel.getSuspensionRestLength(); wheel.m_suspensionRelativeVelocity = 0.0f; wheel.m_raycastInfo.m_contactNormalWS = - wheel.m_raycastInfo.m_wheelDirectionWS; wheel.m_clippedInvContactDotSuspension = 1.0f; @@ -233,18 +233,18 @@ btScalar btRaycastVehicle::Raycast(btWheelInfo& wheel) } -void btRaycastVehicle::UpdateVehicle( btScalar step ) +void btRaycastVehicle::updateVehicle( btScalar step ) { - m_currentVehicleSpeedKmHour = 3.6f * GetRigidBody()->getLinearVelocity().length(); + m_currentVehicleSpeedKmHour = 3.6f * getRigidBody()->getLinearVelocity().length(); - const btTransform& chassisTrans = GetRigidBody()->getCenterOfMassTransform(); + const btTransform& chassisTrans = getRigidBody()->getCenterOfMassTransform(); btVector3 forwardW ( chassisTrans.getBasis()[0][m_indexForwardAxis], chassisTrans.getBasis()[1][m_indexForwardAxis], chassisTrans.getBasis()[2][m_indexForwardAxis]); - if (forwardW.dot(GetRigidBody()->getLinearVelocity()) < 0.f) + if (forwardW.dot(getRigidBody()->getLinearVelocity()) < 0.f) { m_currentVehicleSpeedKmHour *= -1.f; } @@ -258,10 +258,10 @@ void btRaycastVehicle::UpdateVehicle( btScalar step ) !(wheelIt == m_wheelInfo.end());wheelIt++,i++) { btScalar depth; - depth = Raycast( *wheelIt ); + depth = rayCast( *wheelIt ); } - UpdateSuspension(step); + updateSuspension(step); for (wheelIt = m_wheelInfo.begin(); @@ -278,30 +278,30 @@ void btRaycastVehicle::UpdateVehicle( btScalar step ) suspensionForce = gMaxSuspensionForce; } btVector3 impulse = wheel.m_raycastInfo.m_contactNormalWS * suspensionForce * step; - btVector3 relpos = wheel.m_raycastInfo.m_contactPointWS - GetRigidBody()->getCenterOfMassPosition(); + btVector3 relpos = wheel.m_raycastInfo.m_contactPointWS - getRigidBody()->getCenterOfMassPosition(); - GetRigidBody()->applyImpulse(impulse, relpos); + getRigidBody()->applyImpulse(impulse, relpos); } - UpdateFriction( step); + updateFriction( step); for (wheelIt = m_wheelInfo.begin(); !(wheelIt == m_wheelInfo.end());wheelIt++) { btWheelInfo& wheel = *wheelIt; - btVector3 relpos = wheel.m_raycastInfo.m_hardPointWS - GetRigidBody()->getCenterOfMassPosition(); - btVector3 vel = GetRigidBody()->getVelocityInLocalPoint( relpos ); + btVector3 relpos = wheel.m_raycastInfo.m_hardPointWS - getRigidBody()->getCenterOfMassPosition(); + btVector3 vel = getRigidBody()->getVelocityInLocalPoint( relpos ); if (wheel.m_raycastInfo.m_isInContact) { btVector3 fwd ( - GetRigidBody()->getCenterOfMassTransform().getBasis()[0][m_indexForwardAxis], - GetRigidBody()->getCenterOfMassTransform().getBasis()[1][m_indexForwardAxis], - GetRigidBody()->getCenterOfMassTransform().getBasis()[2][m_indexForwardAxis]); + getRigidBody()->getCenterOfMassTransform().getBasis()[0][m_indexForwardAxis], + getRigidBody()->getCenterOfMassTransform().getBasis()[1][m_indexForwardAxis], + getRigidBody()->getCenterOfMassTransform().getBasis()[2][m_indexForwardAxis]); btScalar proj = fwd.dot(wheel.m_raycastInfo.m_contactNormalWS); fwd -= wheel.m_raycastInfo.m_contactNormalWS * proj; @@ -325,57 +325,57 @@ void btRaycastVehicle::UpdateVehicle( btScalar step ) } -void btRaycastVehicle::SetSteeringValue(btScalar steering,int wheel) +void btRaycastVehicle::setSteeringValue(btScalar steering,int wheel) { - assert(wheel>=0 && wheel < GetNumWheels()); + assert(wheel>=0 && wheel < getNumWheels()); - btWheelInfo& wheelInfo = GetWheelInfo(wheel); + btWheelInfo& wheelInfo = getWheelInfo(wheel); wheelInfo.m_steering = steering; } -btScalar btRaycastVehicle::GetSteeringValue(int wheel) const +btScalar btRaycastVehicle::getSteeringValue(int wheel) const { - return GetWheelInfo(wheel).m_steering; + return getWheelInfo(wheel).m_steering; } -void btRaycastVehicle::ApplyEngineForce(btScalar force, int wheel) +void btRaycastVehicle::applyEngineForce(btScalar force, int wheel) { - assert(wheel>=0 && wheel < GetNumWheels()); - btWheelInfo& wheelInfo = GetWheelInfo(wheel); + assert(wheel>=0 && wheel < getNumWheels()); + btWheelInfo& wheelInfo = getWheelInfo(wheel); wheelInfo.m_engineForce = force; } -const btWheelInfo& btRaycastVehicle::GetWheelInfo(int index) const +const btWheelInfo& btRaycastVehicle::getWheelInfo(int index) const { - ASSERT((index >= 0) && (index < GetNumWheels())); + ASSERT((index >= 0) && (index < getNumWheels())); return m_wheelInfo[index]; } -btWheelInfo& btRaycastVehicle::GetWheelInfo(int index) +btWheelInfo& btRaycastVehicle::getWheelInfo(int index) { - ASSERT((index >= 0) && (index < GetNumWheels())); + ASSERT((index >= 0) && (index < getNumWheels())); return m_wheelInfo[index]; } -void btRaycastVehicle::SetBrake(float brake,int wheelIndex) +void btRaycastVehicle::setBrake(float brake,int wheelIndex) { - ASSERT((wheelIndex >= 0) && (wheelIndex < GetNumWheels())); - GetWheelInfo(wheelIndex).m_brake; + ASSERT((wheelIndex >= 0) && (wheelIndex < getNumWheels())); + getWheelInfo(wheelIndex).m_brake; } -void btRaycastVehicle::UpdateSuspension(btScalar deltaTime) +void btRaycastVehicle::updateSuspension(btScalar deltaTime) { btScalar chassisMass = 1.f / m_chassisBody->getInvMass(); - for (int w_it=0; w_it m_wheelInfo; - const btWheelInfo& GetWheelInfo(int index) const; + const btWheelInfo& getWheelInfo(int index) const; - btWheelInfo& GetWheelInfo(int index); + btWheelInfo& getWheelInfo(int index); - void UpdateWheelTransformsWS(btWheelInfo& wheel ); + void updateWheelTransformsWS(btWheelInfo& wheel ); - void SetBrake(float brake,int wheelIndex); + void setBrake(float brake,int wheelIndex); - void SetPitchControl(float pitch) + void setPitchControl(float pitch) { m_pitchControl = pitch; } - void UpdateSuspension(btScalar deltaTime); + void updateSuspension(btScalar deltaTime); - void UpdateFriction(btScalar timeStep); + void updateFriction(btScalar timeStep); - inline btRigidBody* GetRigidBody() + inline btRigidBody* getRigidBody() { return m_chassisBody; } - const btRigidBody* GetRigidBody() const + const btRigidBody* getRigidBody() const { return m_chassisBody; } - inline int GetRightAxis() const + inline int getRightAxis() const { return m_indexRightAxis; } - inline int GetUpAxis() const + inline int getUpAxis() const { return m_indexUpAxis; } - inline int GetForwardAxis() const + inline int getForwardAxis() const { return m_indexForwardAxis; } - virtual void SetCoordinateSystem(int rightIndex,int upIndex,int forwardIndex) + virtual void setCoordinateSystem(int rightIndex,int upIndex,int forwardIndex) { m_indexRightAxis = rightIndex; m_indexUpAxis = upIndex; m_indexForwardAxis = forwardIndex; } - virtual void BuildJacobian() + virtual void buildJacobian() { //not yet } - virtual void SolveConstraint(btScalar timeStep) + virtual void solveConstraint(btScalar timeStep) { //not yet } diff --git a/src/BulletDynamics/Vehicle/btVehicleRaycaster.h b/src/BulletDynamics/Vehicle/btVehicleRaycaster.h index fe1fd5c88..5f119f2b1 100644 --- a/src/BulletDynamics/Vehicle/btVehicleRaycaster.h +++ b/src/BulletDynamics/Vehicle/btVehicleRaycaster.h @@ -27,7 +27,7 @@ virtual ~btVehicleRaycaster() btScalar m_distFraction; }; - virtual void* CastRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result) = 0; + virtual void* castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result) = 0; }; diff --git a/src/BulletDynamics/Vehicle/btWheelInfo.cpp b/src/BulletDynamics/Vehicle/btWheelInfo.cpp index 7dd390542..dd2a523b9 100644 --- a/src/BulletDynamics/Vehicle/btWheelInfo.cpp +++ b/src/BulletDynamics/Vehicle/btWheelInfo.cpp @@ -12,14 +12,14 @@ #include "BulletDynamics/Dynamics/btRigidBody.h" // for pointvelocity -btScalar btWheelInfo::GetSuspensionRestLength() const +btScalar btWheelInfo::getSuspensionRestLength() const { return m_suspensionRestLength1; } -void btWheelInfo::UpdateWheel(const btRigidBody& chassis,RaycastInfo& raycastInfo) +void btWheelInfo::updateWheel(const btRigidBody& chassis,RaycastInfo& raycastInfo) { @@ -47,7 +47,7 @@ void btWheelInfo::UpdateWheel(const btRigidBody& chassis,RaycastInfo& raycastInf else // Not in contact : position wheel in a nice (rest length) position { - m_raycastInfo.m_suspensionLength = this->GetSuspensionRestLength(); + m_raycastInfo.m_suspensionLength = this->getSuspensionRestLength(); m_suspensionRelativeVelocity = 0.0f; m_raycastInfo.m_contactNormalWS = -m_raycastInfo.m_wheelDirectionWS; m_clippedInvContactDotSuspension = 1.0f; diff --git a/src/BulletDynamics/Vehicle/btWheelInfo.h b/src/BulletDynamics/Vehicle/btWheelInfo.h index 16b54abd4..2bd8c1867 100644 --- a/src/BulletDynamics/Vehicle/btWheelInfo.h +++ b/src/BulletDynamics/Vehicle/btWheelInfo.h @@ -58,7 +58,7 @@ struct btWheelInfo btVector3 m_wheelAxleCS; // const or modified by steering btScalar m_suspensionRestLength1;//const btScalar m_maxSuspensionTravelCm; - btScalar GetSuspensionRestLength() const; + btScalar getSuspensionRestLength() const; btScalar m_wheelsRadius;//const btScalar m_suspensionStiffness;//const btScalar m_wheelsDampingCompression;//const @@ -102,7 +102,7 @@ struct btWheelInfo } - void UpdateWheel(const btRigidBody& chassis,RaycastInfo& raycastInfo); + void updateWheel(const btRigidBody& chassis,RaycastInfo& raycastInfo); btScalar m_clippedInvContactDotSuspension; btScalar m_suspensionRelativeVelocity; diff --git a/src/LinearMath/btIDebugDraw.h b/src/LinearMath/btIDebugDraw.h index caa43fac4..7d67363a9 100644 --- a/src/LinearMath/btIDebugDraw.h +++ b/src/LinearMath/btIDebugDraw.h @@ -54,13 +54,13 @@ class btIDebugDraw virtual ~btIDebugDraw() {}; - virtual void DrawLine(const btVector3& from,const btVector3& to,const btVector3& color)=0; + virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& color)=0; - virtual void DrawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,float distance,int lifeTime,const btVector3& color)=0; + virtual void drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,float distance,int lifeTime,const btVector3& color)=0; - virtual void SetDebugMode(int debugMode) =0; + virtual void setDebugMode(int debugMode) =0; - virtual int GetDebugMode() const = 0; + virtual int getDebugMode() const = 0; }; diff --git a/src/LinearMath/btTransformUtil.h b/src/LinearMath/btTransformUtil.h index 2e92ef90d..da8e4aa72 100644 --- a/src/LinearMath/btTransformUtil.h +++ b/src/LinearMath/btTransformUtil.h @@ -69,7 +69,7 @@ class btTransformUtil public: - static void IntegrateTransform(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep,btTransform& predictedTransform) + static void integrateTransform(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep,btTransform& predictedTransform) { predictedTransform.setOrigin(curTrans.getOrigin() + linvel * timeStep); // #define QUATERNION_DERIVATIVE @@ -105,7 +105,7 @@ public: predictedTransform.setRotation(predictedOrn); } - static void CalculateVelocity(const btTransform& transform0,const btTransform& transform1,btScalar timeStep,btVector3& linVel,btVector3& angVel) + static void calculateVelocity(const btTransform& transform0,const btTransform& transform1,btScalar timeStep,btVector3& linVel,btVector3& angVel) { linVel = (transform1.getOrigin() - transform0.getOrigin()) / timeStep; #ifdef USE_QUATERNION_DIFF