removed STL usage of Extras/ConvexBuilder and replaced by btAlignedObjectArray
fixed several warnings, thanks to sparkprime added comments patch for linear math, thanks to Tully Foote
This commit is contained in:
@@ -19,13 +19,15 @@ subject to the following restrictions:
|
||||
*/
|
||||
|
||||
|
||||
#include <string>
|
||||
#include "ColladaConverter.h"
|
||||
#include "btBulletDynamicsCommon.h"
|
||||
|
||||
#include "dae.h"
|
||||
#include "dom/domCOLLADA.h"
|
||||
#include "dae/domAny.h"
|
||||
#include "dom/domConstants.h"
|
||||
#include <string>
|
||||
|
||||
#include "BulletCollision/CollisionShapes/btShapeHull.h"
|
||||
|
||||
#include "BulletCollision/CollisionShapes/btBoxShape.h"
|
||||
|
||||
@@ -1253,6 +1253,6 @@ namespace COLLADA_TYPE
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace COLLADA_TYPE
|
||||
#else
|
||||
typedef const int TypeEnum;
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
class daeMetaElement;
|
||||
class daeIntegrationObject;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <assert.h>
|
||||
#include "cd_hull.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "fitsphere.h"
|
||||
#include "bestfitobb.h"
|
||||
|
||||
@@ -59,10 +58,10 @@ ConvexBuilder::ConvexBuilder(ConvexDecompInterface *callback)
|
||||
|
||||
ConvexBuilder::~ConvexBuilder(void)
|
||||
{
|
||||
CHullVector::iterator i;
|
||||
for (i=mChulls.begin(); i!=mChulls.end(); ++i)
|
||||
int i;
|
||||
for (i=0;i<mChulls.size();i++)
|
||||
{
|
||||
CHull *cr = (*i);
|
||||
CHull *cr = mChulls[i];
|
||||
delete cr;
|
||||
}
|
||||
}
|
||||
@@ -197,16 +196,16 @@ bool ConvexBuilder::combineHulls(void)
|
||||
CHullVector output; // the output hulls...
|
||||
|
||||
|
||||
CHullVector::iterator i;
|
||||
int i;
|
||||
|
||||
for (i=mChulls.begin(); i!=mChulls.end() && !combine; ++i)
|
||||
for (i=0;i<mChulls.size() && !combine; ++i)
|
||||
{
|
||||
CHull *cr = (*i);
|
||||
CHull *cr = mChulls[i];
|
||||
|
||||
CHullVector::iterator j;
|
||||
for (j=mChulls.begin(); j!=mChulls.end(); ++j)
|
||||
int j;
|
||||
for (j=0;j<mChulls.size();j++)
|
||||
{
|
||||
CHull *match = (*j);
|
||||
CHull *match = mChulls[j];
|
||||
|
||||
if ( cr != match ) // don't try to merge a hull with itself, that be stoopid
|
||||
{
|
||||
@@ -220,9 +219,9 @@ bool ConvexBuilder::combineHulls(void)
|
||||
|
||||
|
||||
++i;
|
||||
while ( i != mChulls.end() )
|
||||
while ( i != mChulls.size() )
|
||||
{
|
||||
CHull *cr = (*i);
|
||||
CHull *cr = mChulls[i];
|
||||
if ( cr != match )
|
||||
{
|
||||
output.push_back(cr);
|
||||
@@ -275,10 +274,10 @@ unsigned int ConvexBuilder::process(const DecompDesc &desc)
|
||||
|
||||
while ( combineHulls() ); // keep combinging hulls until I can't combine any more...
|
||||
|
||||
CHullVector::iterator i;
|
||||
for (i=mChulls.begin(); i!=mChulls.end(); ++i)
|
||||
int i;
|
||||
for (i=0;i<mChulls.size();i++)
|
||||
{
|
||||
CHull *cr = (*i);
|
||||
CHull *cr = mChulls[i];
|
||||
|
||||
// before we hand it back to the application, we need to regenerate the hull based on the
|
||||
// limits given by the user.
|
||||
@@ -367,7 +366,8 @@ void ConvexBuilder::ConvexDecompResult(ConvexResult &result)
|
||||
|
||||
void ConvexBuilder::sortChulls(CHullVector &hulls)
|
||||
{
|
||||
std::sort( hulls.begin(), hulls.end(), CHullSort() );
|
||||
hulls.quickSort(CHullSort());
|
||||
//hulls.heapSort(CHullSort());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "ConvexDecomposition.h"
|
||||
#include "vlookup.h"
|
||||
#include "LinearMath/btAlignedObjectArray.h"
|
||||
|
||||
using namespace ConvexDecomposition;
|
||||
|
||||
@@ -70,7 +71,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
typedef std::vector< CHull * > CHullVector;
|
||||
typedef btAlignedObjectArray< CHull * > CHullVector;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Copyright (c) 2004 Open Dynamics Framework Group
|
||||
|
||||
@@ -42,6 +42,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "LinearMath/btAlignedObjectArray.h"
|
||||
|
||||
|
||||
|
||||
@@ -49,8 +50,8 @@ extern unsigned int MAXDEPTH ;
|
||||
extern float CONCAVE_PERCENT ;
|
||||
extern float MERGE_PERCENT ;
|
||||
|
||||
#include <vector>
|
||||
typedef std::vector< unsigned int > UintVector;
|
||||
|
||||
typedef btAlignedObjectArray< unsigned int > UintVector;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ public:
|
||||
bool m_bIsRotation;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
using namespace BestFit;
|
||||
|
||||
@@ -147,7 +147,7 @@ private:
|
||||
float *scale);
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ static inline void Set(float *n,float x,float y,float z)
|
||||
n[0] = x;
|
||||
n[1] = y;
|
||||
n[2] = z;
|
||||
};
|
||||
}
|
||||
|
||||
static inline void Copy(float *dest,const float *source)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ enum PlaneTriResult
|
||||
{
|
||||
PTR_FRONT,
|
||||
PTR_BACK,
|
||||
PTR_SPLIT,
|
||||
PTR_SPLIT
|
||||
};
|
||||
|
||||
PlaneTriResult planeTriIntersection(const float *plane, // the plane equation in Ax+By+Cz+D format
|
||||
|
||||
@@ -54,6 +54,6 @@ bool computeSplitPlane(unsigned int vcount,
|
||||
float *plane);
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -265,12 +265,12 @@ bool VertexLess::operator()(int v1,int v2) const
|
||||
|
||||
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
using namespace Vlookup;
|
||||
|
||||
|
||||
@@ -256,6 +256,10 @@ typedef trio_longlong_t trio_int64_t;
|
||||
|
||||
#if !(defined(TRIO_COMPILER_SUPPORTS_C99) \
|
||||
|| defined(TRIO_COMPILER_SUPPORTS_UNIX01))
|
||||
#undef floorl
|
||||
#undef fmodl
|
||||
#undef powl
|
||||
|
||||
# define floorl(x) floor((double)(x))
|
||||
# define fmodl(x,y) fmod((double)(x),(double)(y))
|
||||
# define powl(x,y) pow((double)(x),(double)(y))
|
||||
|
||||
@@ -103,7 +103,7 @@ void GLUI_FileBrowser::fbreaddir(const char *d) {
|
||||
list->delete_all();
|
||||
if (hFind != INVALID_HANDLE_VALUE) {
|
||||
do {
|
||||
int len = strlen(FN.cFileName);
|
||||
int len = int(strlen(FN.cFileName));
|
||||
if (FN.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
|
||||
item = '\\';
|
||||
item += FN.cFileName;
|
||||
|
||||
@@ -52,23 +52,6 @@ FIXME: there's a heck of a lot of duplication between this and glui_scrollbar.cp
|
||||
#define GLUI_SPINNER_CALLBACK_INTERVAL 1
|
||||
|
||||
|
||||
/****************************** spinner_edittext_callback() ******************/
|
||||
/* This function is not used anymore. It has been replaced by directly */
|
||||
/* Including an optional pointer to a spinner from an edittext box */
|
||||
|
||||
void spinner_edittext_callback( int id )
|
||||
{
|
||||
GLUI_Spinner *spinner;
|
||||
|
||||
putchar( '.' ); flushout;
|
||||
|
||||
spinner = (GLUI_Spinner*) id;
|
||||
|
||||
if ( NOT spinner )
|
||||
return;
|
||||
|
||||
spinner->do_callbacks();
|
||||
}
|
||||
|
||||
|
||||
/****************************** GLUI_Spinner::GLUI_Spinner() ****************/
|
||||
|
||||
@@ -344,7 +344,7 @@ void GLUI_TextBox::activate( int how )
|
||||
orig_text = text;
|
||||
|
||||
sel_start = 0;
|
||||
sel_end = text.length();
|
||||
sel_end = int(text.length());
|
||||
insertion_pt = 0;
|
||||
if ( debug )
|
||||
dump( stdout, "<- ACTIVATE" );
|
||||
@@ -438,7 +438,7 @@ void GLUI_TextBox::draw( int x, int y )
|
||||
/* Begin Drawing Lines of Text */
|
||||
substring_start = 0;
|
||||
substring_end = 0;
|
||||
text_length = text.length()-1;
|
||||
text_length = int(text.length())-1;
|
||||
|
||||
/* Figure out how wide the box is */
|
||||
box_width = get_box_width();
|
||||
@@ -496,7 +496,7 @@ void GLUI_TextBox::draw( int x, int y )
|
||||
int GLUI_TextBox::update_substring_bounds( void )
|
||||
{
|
||||
int box_width;
|
||||
int text_len = text.length();
|
||||
int text_len = int(text.length());
|
||||
int old_start, old_end;
|
||||
|
||||
old_start = substring_start;
|
||||
@@ -676,7 +676,7 @@ int GLUI_TextBox::find_insertion_pt( int x, int y )
|
||||
insert_x = x;
|
||||
insert_y = y;
|
||||
|
||||
int text_length = text.length()-1;
|
||||
int text_length = int(text.length())-1;
|
||||
int box_width = get_box_width();
|
||||
|
||||
int sol = 0;
|
||||
@@ -789,7 +789,7 @@ void GLUI_TextBox::draw_insertion_pt( void )
|
||||
|
||||
sol = 0;
|
||||
eol = 0;
|
||||
text_length = text.length()-1;
|
||||
text_length = int(text.length())-1;
|
||||
|
||||
//while (eol < text_length && text[eol] != '\n'
|
||||
// && substring_width(sol, eol + 1) < box_width )
|
||||
@@ -947,7 +947,7 @@ int GLUI_TextBox::special_handler( int key,int modifiers )
|
||||
// update keygoal_x!
|
||||
}
|
||||
else if ( key == GLUT_KEY_END ) {
|
||||
insertion_pt = text.length();
|
||||
insertion_pt = int(text.length());
|
||||
// update keygoal_x!
|
||||
}
|
||||
|
||||
@@ -984,7 +984,7 @@ int GLUI_TextBox::find_word_break( int start, int direction )
|
||||
{
|
||||
int i, j;
|
||||
char breaks[] = " \n\t:-.,";
|
||||
int num_break_chars = (int)strlen(breaks), text_len = text.length();
|
||||
int num_break_chars = (int)strlen(breaks), text_len = int(text.length());
|
||||
int new_pt;
|
||||
|
||||
/** If we're moving left, we have to start two back, in case we're either
|
||||
@@ -1046,7 +1046,7 @@ void GLUI_TextBox::set_text( const char *new_text )
|
||||
text = new_text;
|
||||
|
||||
substring_start = 0;
|
||||
substring_end = text.length() - 1;
|
||||
substring_end = int(text.length()) - 1;
|
||||
insertion_pt = -1;
|
||||
sel_start = 0;
|
||||
sel_end = 0;
|
||||
|
||||
Reference in New Issue
Block a user