Fixed over 500 compile warnings. Mostly:

* Unused variables.
* Missing newlines at ends of #included files.
* signed int loop variables where the termination condition is an unsigned 'get number of' function.
* 'NULL' used inappropriately for an integer or character constant (NULL is a pointer)
* abstract base classes with no virtual destructor.
* Floating point constants used to initialise integer variables.
This commit is contained in:
sjbaker
2006-09-23 14:51:54 +00:00
parent ccced9fd82
commit f1627677df
78 changed files with 1629 additions and 1691 deletions

View File

@@ -8,6 +8,10 @@
#include "fitsphere.h"
#include "bestfitobb.h"
unsigned int MAXDEPTH = 8 ;
float CONCAVE_PERCENT = 1.0f ;
float MERGE_PERCENT = 2.0f ;
CHull::CHull(const ConvexResult &result)
{
mResult = new ConvexResult(result);
@@ -147,8 +151,6 @@ CHull * ConvexBuilder::canMerge(CHull *a,CHull *b)
if (!tcount)
return 0;
unsigned int *idx = &indices[0];
HullResult hresult;
HullLibrary hl;
HullDesc desc;

View File

@@ -79,7 +79,7 @@ class ConvexBuilder : public ConvexDecompInterface
public:
ConvexBuilder(ConvexDecompInterface *callback);
~ConvexBuilder(void);
virtual ~ConvexBuilder(void);
bool isDuplicate(unsigned int i1,unsigned int i2,unsigned int i3,
unsigned int ci1,unsigned int ci2,unsigned int ci3);
@@ -108,3 +108,4 @@ public:
};
#endif //CONVEX_BUILDER_H

View File

@@ -337,9 +337,6 @@ void calcConvexDecomposition(unsigned int vcount,
}
}
unsigned int fsize = ifront.size()/3;
unsigned int bsize = iback.size()/3;
// ok... here we recursively call
if ( ifront.size() )
{

View File

@@ -1,219 +1,219 @@
#ifndef CONVEX_DECOMPOSITION_H
#define CONVEX_DECOMPOSITION_H
/*----------------------------------------------------------------------
Copyright (c) 2004 Open Dynamics Framework Group
www.physicstools.org
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Neither the name of the Open Dynamics Framework Group nor the names of its contributors may
be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE INTEL OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------*/
// http://codesuppository.blogspot.com
//
// mailto: jratcliff@infiniplex.net
//
// http://www.amillionpixels.us
//
#ifdef WIN32
#include <memory.h> //memcpy
#endif
#include <string.h>
#ifndef CONVEX_DECOMPOSITION_H
#define CONVEX_DECOMPOSITION_H
/*----------------------------------------------------------------------
Copyright (c) 2004 Open Dynamics Framework Group
www.physicstools.org
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Neither the name of the Open Dynamics Framework Group nor the names of its contributors may
be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE INTEL OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------*/
// http://codesuppository.blogspot.com
//
// mailto: jratcliff@infiniplex.net
//
// http://www.amillionpixels.us
//
#ifdef WIN32
#include <memory.h> //memcpy
#endif
#include <string.h>
#include <stdio.h>
static unsigned int MAXDEPTH=8;
static float CONCAVE_PERCENT=1.0f;
static float MERGE_PERCENT=2.0f;
#include <vector>
typedef std::vector< unsigned int > UintVector;
namespace ConvexDecomposition
{
class ConvexResult
{
public:
ConvexResult(void)
{
mHullVcount = 0;
mHullVertices = 0;
mHullTcount = 0;
mHullIndices = 0;
}
ConvexResult(unsigned int hvcount,const float *hvertices,unsigned int htcount,const unsigned int *hindices)
{
mHullVcount = hvcount;
if ( mHullVcount )
{
mHullVertices = new float[mHullVcount*sizeof(float)*3];
memcpy(mHullVertices, hvertices, sizeof(float)*3*mHullVcount );
}
else
{
mHullVertices = 0;
}
mHullTcount = htcount;
if ( mHullTcount )
{
mHullIndices = new unsigned int[sizeof(unsigned int)*mHullTcount*3];
memcpy(mHullIndices,hindices, sizeof(unsigned int)*mHullTcount*3 );
}
else
{
mHullIndices = 0;
}
}
ConvexResult(const ConvexResult &r)
{
mHullVcount = r.mHullVcount;
if ( mHullVcount )
{
mHullVertices = new float[mHullVcount*sizeof(float)*3];
memcpy(mHullVertices, r.mHullVertices, sizeof(float)*3*mHullVcount );
}
else
{
mHullVertices = 0;
}
mHullTcount = r.mHullTcount;
if ( mHullTcount )
{
mHullIndices = new unsigned int[sizeof(unsigned int)*mHullTcount*3];
memcpy(mHullIndices, r.mHullIndices, sizeof(unsigned int)*mHullTcount*3 );
}
else
{
mHullIndices = 0;
}
}
~ConvexResult(void)
{
delete mHullVertices;
delete mHullIndices;
}
// the convex hull.
unsigned int mHullVcount;
float * mHullVertices;
unsigned int mHullTcount;
unsigned int *mHullIndices;
float mHullVolume; // the volume of the convex hull.
float mOBBSides[3]; // the width, height and breadth of the best fit OBB
float mOBBCenter[3]; // the center of the OBB
float mOBBOrientation[4]; // the quaternion rotation of the OBB.
float mOBBTransform[16]; // the 4x4 transform of the OBB.
float mOBBVolume; // the volume of the OBB
float mSphereRadius; // radius and center of best fit sphere
float mSphereCenter[3];
float mSphereVolume; // volume of the best fit sphere
};
class ConvexDecompInterface
{
public:
virtual void ConvexDebugTri(const float *p1,const float *p2,const float *p3,unsigned int color) { };
virtual void ConvexDebugPoint(const float *p,float dist,unsigned int color) { };
virtual void ConvexDebugBound(const float *bmin,const float *bmax,unsigned int color) { };
virtual void ConvexDebugOBB(const float *sides, const float *matrix,unsigned int color) { };
virtual void ConvexDecompResult(ConvexResult &result) = 0;
};
// just to avoid passing a zillion parameters to the method the
// options are packed into this descriptor.
class DecompDesc
{
public:
DecompDesc(void)
{
mVcount = 0;
mVertices = 0;
mTcount = 0;
mIndices = 0;
mDepth = 5;
mCpercent = 5;
mPpercent = 5;
mMaxVertices = 32;
mSkinWidth = 0;
mCallback = 0;
}
// describes the input triangle.
unsigned int mVcount; // the number of vertices in the source mesh.
const float *mVertices; // start of the vertex position array. Assumes a stride of 3 floats.
unsigned int mTcount; // the number of triangles in the source mesh.
unsigned int *mIndices; // the indexed triangle list array (zero index based)
// options
unsigned int mDepth; // depth to split, a maximum of 10, generally not over 7.
float mCpercent; // the concavity threshold percentage. 0=20 is reasonable.
float mPpercent; // the percentage volume conservation threshold to collapse hulls. 0-30 is reasonable.
// hull output limits.
unsigned int mMaxVertices; // maximum number of vertices in the output hull. Recommended 32 or less.
float mSkinWidth; // a skin width to apply to the output hulls.
ConvexDecompInterface *mCallback; // the interface to receive back the results.
};
// perform approximate convex decomposition on a mesh.
unsigned int performConvexDecomposition(const DecompDesc &desc); // returns the number of hulls produced.
void calcConvexDecomposition(unsigned int vcount,
const float *vertices,
unsigned int tcount,
const unsigned int *indices,
ConvexDecompInterface *callback,
float masterVolume,
unsigned int depth);
};
#endif
extern unsigned int MAXDEPTH ;
extern float CONCAVE_PERCENT ;
extern float MERGE_PERCENT ;
#include <vector>
typedef std::vector< unsigned int > UintVector;
namespace ConvexDecomposition
{
class ConvexResult
{
public:
ConvexResult(void)
{
mHullVcount = 0;
mHullVertices = 0;
mHullTcount = 0;
mHullIndices = 0;
}
ConvexResult(unsigned int hvcount,const float *hvertices,unsigned int htcount,const unsigned int *hindices)
{
mHullVcount = hvcount;
if ( mHullVcount )
{
mHullVertices = new float[mHullVcount*sizeof(float)*3];
memcpy(mHullVertices, hvertices, sizeof(float)*3*mHullVcount );
}
else
{
mHullVertices = 0;
}
mHullTcount = htcount;
if ( mHullTcount )
{
mHullIndices = new unsigned int[sizeof(unsigned int)*mHullTcount*3];
memcpy(mHullIndices,hindices, sizeof(unsigned int)*mHullTcount*3 );
}
else
{
mHullIndices = 0;
}
}
ConvexResult(const ConvexResult &r)
{
mHullVcount = r.mHullVcount;
if ( mHullVcount )
{
mHullVertices = new float[mHullVcount*sizeof(float)*3];
memcpy(mHullVertices, r.mHullVertices, sizeof(float)*3*mHullVcount );
}
else
{
mHullVertices = 0;
}
mHullTcount = r.mHullTcount;
if ( mHullTcount )
{
mHullIndices = new unsigned int[sizeof(unsigned int)*mHullTcount*3];
memcpy(mHullIndices, r.mHullIndices, sizeof(unsigned int)*mHullTcount*3 );
}
else
{
mHullIndices = 0;
}
}
~ConvexResult(void)
{
delete mHullVertices;
delete mHullIndices;
}
// the convex hull.
unsigned int mHullVcount;
float * mHullVertices;
unsigned int mHullTcount;
unsigned int *mHullIndices;
float mHullVolume; // the volume of the convex hull.
float mOBBSides[3]; // the width, height and breadth of the best fit OBB
float mOBBCenter[3]; // the center of the OBB
float mOBBOrientation[4]; // the quaternion rotation of the OBB.
float mOBBTransform[16]; // the 4x4 transform of the OBB.
float mOBBVolume; // the volume of the OBB
float mSphereRadius; // radius and center of best fit sphere
float mSphereCenter[3];
float mSphereVolume; // volume of the best fit sphere
};
class ConvexDecompInterface
{
public:
virtual void ConvexDebugTri(const float *p1,const float *p2,const float *p3,unsigned int color) { };
virtual void ConvexDebugPoint(const float *p,float dist,unsigned int color) { };
virtual void ConvexDebugBound(const float *bmin,const float *bmax,unsigned int color) { };
virtual void ConvexDebugOBB(const float *sides, const float *matrix,unsigned int color) { };
virtual void ConvexDecompResult(ConvexResult &result) = 0;
};
// just to avoid passing a zillion parameters to the method the
// options are packed into this descriptor.
class DecompDesc
{
public:
DecompDesc(void)
{
mVcount = 0;
mVertices = 0;
mTcount = 0;
mIndices = 0;
mDepth = 5;
mCpercent = 5;
mPpercent = 5;
mMaxVertices = 32;
mSkinWidth = 0;
mCallback = 0;
}
// describes the input triangle.
unsigned int mVcount; // the number of vertices in the source mesh.
const float *mVertices; // start of the vertex position array. Assumes a stride of 3 floats.
unsigned int mTcount; // the number of triangles in the source mesh.
unsigned int *mIndices; // the indexed triangle list array (zero index based)
// options
unsigned int mDepth; // depth to split, a maximum of 10, generally not over 7.
float mCpercent; // the concavity threshold percentage. 0=20 is reasonable.
float mPpercent; // the percentage volume conservation threshold to collapse hulls. 0-30 is reasonable.
// hull output limits.
unsigned int mMaxVertices; // maximum number of vertices in the output hull. Recommended 32 or less.
float mSkinWidth; // a skin width to apply to the output hulls.
ConvexDecompInterface *mCallback; // the interface to receive back the results.
};
// perform approximate convex decomposition on a mesh.
unsigned int performConvexDecomposition(const DecompDesc &desc); // returns the number of hulls produced.
void calcConvexDecomposition(unsigned int vcount,
const float *vertices,
unsigned int tcount,
const unsigned int *indices,
ConvexDecompInterface *callback,
float masterVolume,
unsigned int depth);
};
#endif

View File

@@ -1725,7 +1725,6 @@ int AssertIntact(ConvexH &convex) {
inext = estart;
}
assert(convex.edges[inext].p == convex.edges[i].p);
HalfEdge &edge = convex.edges[i];
int nb = convex.edges[i].ea;
assert(nb!=255);
if(nb==255 || nb==-1) return 0;
@@ -1852,10 +1851,6 @@ ConvexH *ConvexHCrop(ConvexH &convex,const Plane &slice)
int i;
int vertcountunder=0;
int vertcountover =0;
int edgecountunder=0;
int edgecountover =0;
int planecountunder=0;
int planecountover =0;
static Array<int> vertscoplanar; // existing vertex members of convex that are coplanar
vertscoplanar.count=0;
static Array<int> edgesplit; // existing edges that members of convex that cross the splitplane
@@ -1886,7 +1881,7 @@ ConvexH *ConvexHCrop(ConvexH &convex,const Plane &slice)
else {
assert(vertflag[i].planetest == OVER);
vertflag[i].overmap = vertcountover++;
vertflag[i].undermap = -1; // for debugging purposes
vertflag[i].undermap = 255; // for debugging purposes
}
}
int vertcountunderold = vertcountunder; // for debugging only
@@ -1897,11 +1892,9 @@ ConvexH *ConvexHCrop(ConvexH &convex,const Plane &slice)
for(int currentplane=0; currentplane<convex.facets.count; currentplane++) {
int estart =e0;
int enextface;
int enextface = 0;
int planeside = 0;
int e1 = e0+1;
int eus=-1;
int ecop=-1;
int vout=-1;
int vin =-1;
int coplanaredge = -1;
@@ -2157,8 +2150,8 @@ ConvexH *ConvexHCrop(ConvexH &convex,const Plane &slice)
static int candidateplane(Plane *planes,int planes_count,ConvexH *convex,float epsilon)
{
int p ;
REAL md;
int p = 0 ;
REAL md= 0 ;
int i;
for(i=0;i<planes_count;i++)
{
@@ -2520,7 +2513,6 @@ int calchullgen(float3 *verts,int verts_count, int vlimit)
isextreme[v]=1;
//if(v==p0 || v==p1 || v==p2 || v==p3) continue; // done these already
j=tris.count;
int newstart=j;
while(j--) {
if(!tris[j]) continue;
int3 t=*tris[j];
@@ -2619,7 +2611,7 @@ int overhull(Plane *planes,int planes_count,float3 *verts, int verts_count,int m
float3 *&verts_out, int &verts_count_out, int *&faces_out, int &faces_count_out ,float inflate)
{
int i,j;
if(verts_count <4) return NULL;
if(verts_count <4) return 0;
maxplanes = Min(maxplanes,planes_count);
float3 bmin(verts[0]),bmax(verts[0]);
for(i=0;i<verts_count;i++)
@@ -2627,7 +2619,7 @@ int overhull(Plane *planes,int planes_count,float3 *verts, int verts_count,int m
bmin = VectorMin(bmin,verts[i]);
bmax = VectorMax(bmax,verts[i]);
}
float diameter = magnitude(bmax-bmin);
// float diameter = magnitude(bmax-bmin);
// inflate *=diameter; // RELATIVE INFLATION
bmin -= float3(inflate,inflate,inflate);
bmax += float3(inflate,inflate,inflate);
@@ -2957,9 +2949,7 @@ bool HullLibrary::CleanupVertices(unsigned int svcount,
if ( svcount == 0 ) return false;
#define EPSILON 0.000001f // close enough to consider two floating point numbers to be 'the same'.
bool ret = false;
#define EPSILON 0.000001f /* close enough to consider two floating point numbers to be 'the same'. */
vcount = 0;

View File

@@ -88,7 +88,9 @@ typedef std::vector< float > FloatVector;
class InPlaceParserInterface
{
public:
virtual int ParseLine(int lineno,int argc,const char **argv) =0; // return TRUE to continue parsing, return FALSE to abort parsing process
virtual ~InPlaceParserInterface () {} ;
virtual int ParseLine(int lineno,int argc,const char **argv) =0; // return TRUE to continue parsing, return FALSE to abort parsing process
};
enum SeparatorType
@@ -157,23 +159,23 @@ public:
void SetHardSeparator(char c) // add a hard separator
{
mHard[c] = ST_HARD;
mHard[(int)c] = ST_HARD;
}
void SetHard(char c) // add a hard separator
{
mHard[c] = ST_HARD;
mHard[(int)c] = ST_HARD;
}
void SetCommentSymbol(char c) // comment character, treated as 'end of string'
{
mHard[c] = ST_EOS;
mHard[(int)c] = ST_EOS;
}
void ClearHardSeparator(char c)
{
mHard[c] = ST_DATA;
mHard[(int)c] = ST_DATA;
}
@@ -181,7 +183,7 @@ public:
bool EOS(char c)
{
if ( mHard[c] == ST_EOS )
if ( mHard[(int)c] == ST_EOS )
{
return true;
}
@@ -261,7 +263,7 @@ InPlaceParser::~InPlaceParser(void)
bool InPlaceParser::IsHard(char c)
{
return mHard[c] == ST_HARD;
return mHard[(int)c] == ST_HARD;
}
char * InPlaceParser::AddHard(int &argc,const char **argv,char *foo)
@@ -280,7 +282,7 @@ char * InPlaceParser::AddHard(int &argc,const char **argv,char *foo)
bool InPlaceParser::IsWhiteSpace(char c)
{
return mHard[c] == ST_SOFT;
return mHard[(int)c] == ST_SOFT;
}
char * InPlaceParser::SkipSpaces(char *foo)
@@ -550,10 +552,9 @@ class GeometryInterface
{
public:
virtual void NodeTriangle(const GeometryVertex *v1,const GeometryVertex *v2,const GeometryVertex *v3)
{
}
virtual void NodeTriangle(const GeometryVertex *v1,const GeometryVertex *v2,const GeometryVertex *v3) {}
virtual ~GeometryInterface () {}
};

View File

@@ -113,7 +113,6 @@ static void intersect(const float *p1,const float *p2,float *split,const float *
{
float dp1 = DistToPt(p1,plane);
float dp2 = DistToPt(p2,plane);
float dir[3];
@@ -129,7 +128,6 @@ static void intersect(const float *p1,const float *p2,float *split,const float *
split[0] = (dir[0]*t)+p1[0];
split[1] = (dir[1]*t)+p1[1];
split[2] = (dir[2]*t)+p1[2];
}
@@ -602,8 +600,6 @@ float computeConcavity(unsigned int vcount,
float bmin[3];
float bmax[3];
float diagonal = getBoundingRegion( result.mNumOutputVertices, result.mOutputVertices, sizeof(float)*3, bmin, bmax );
float dx = bmax[0] - bmin[0];
float dy = bmax[1] - bmin[1];
float dz = bmax[2] - bmin[2];
@@ -614,8 +610,6 @@ float computeConcavity(unsigned int vcount,
center.y = bmin[1] + dy*0.5f;
center.z = bmin[2] + dz*0.5f;
float boundVolume = dx*dy*dz;
volume = computeMeshVolume2( result.mOutputVertices, result.mNumFaces, result.mIndices );
#if 1

View File

@@ -43,7 +43,6 @@ float computeMeshVolume(const float *vertices,unsigned int tcount,const unsigned
{
float volume = 0;
const float *p0 = vertices;
for (unsigned int i=0; i<tcount; i++,indices+=3)
{

View File

@@ -78,7 +78,6 @@ static void intersect(const float *p1,const float *p2,float *split,const float *
{
float dp1 = DistToPt(p1,plane);
float dp2 = DistToPt(p2,plane);
float dir[3];

View File

@@ -185,9 +185,6 @@ bool computeSplitPlane(unsigned int vcount,
ConvexDecompInterface *callback,
float *plane)
{
bool cret = false;
float bmin[3] = { 1e9, 1e9, 1e9 };
float bmax[3] = { -1e9, -1e9, -1e9 };

View File

@@ -722,6 +722,7 @@ xmlSchematronFreeParserCtxt(xmlSchematronParserCtxtPtr ctxt)
*
* Add an included document
*/
#if 0
static void
xmlSchematronPushInclude(xmlSchematronParserCtxtPtr ctxt,
xmlDocPtr doc, xmlNodePtr cur)
@@ -754,6 +755,7 @@ xmlSchematronPushInclude(xmlSchematronParserCtxtPtr ctxt,
ctxt->includes[2 * ctxt->nbIncludes + 1] = (xmlNodePtr) doc;
ctxt->nbIncludes++;
}
#endif
/**
* xmlSchematronPopInclude:
@@ -996,6 +998,7 @@ xmlSchematronParsePattern(xmlSchematronParserCtxtPtr ctxt, xmlNodePtr pat)
*
* Returns the updated node pointer
*/
#if 0
static xmlNodePtr
xmlSchematronLoadInclude(xmlSchematronParserCtxtPtr ctxt, xmlNodePtr cur)
{
@@ -1051,6 +1054,7 @@ done:
xmlFree(URI);
return(ret);
}
#endif
/**
* xmlSchematronParse:

View File

@@ -327,13 +327,13 @@ static void DrawAabb(IDebugDraw* debugDrawer,const SimdVector3& from,const SimdV
CcdPhysicsEnvironment::CcdPhysicsEnvironment(Dispatcher* dispatcher,OverlappingPairCache* pairCache)
:m_scalingPropagated(false),
m_numIterations(10),
: m_numIterations(10),
m_numTimeSubSteps(1),
m_ccdMode(0),
m_solverType(-1),
m_profileTimings(0),
m_enableSatCollisionDetection(false)
m_enableSatCollisionDetection(false),
m_scalingPropagated(false)
{
for (int i=0;i<PHY_NUM_RESPONSE;i++)
@@ -383,9 +383,6 @@ void CcdPhysicsEnvironment::addCcdPhysicsController(CcdPhysicsController* ctrl)
assert(body->m_broadphaseHandle);
BroadphaseInterface* scene = GetBroadphase();
CollisionShape* shapeinterface = ctrl->GetCollisionShape();
assert(shapeinterface);
@@ -695,10 +692,6 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep)
Profiler::endBlock("DispatchAllCollisionPairs");
#endif //USE_QUICKPROF
int numRigidBodies = m_controllers.size();
m_islandManager->UpdateActivationState(GetCollisionWorld(),GetCollisionWorld()->GetDispatcher());
{
@@ -1445,10 +1438,6 @@ void CcdPhysicsEnvironment::removeConstraint(int constraintId)
PHY_IPhysicsController* CcdPhysicsEnvironment::rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ)
{
float minFraction = 1.f;
SimdVector3 rayFrom(fromX,fromY,fromZ);
SimdVector3 rayTo(toX,toY,toZ);
@@ -1629,9 +1618,6 @@ void CcdPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ctr
void CcdPhysicsEnvironment::CallbackTriggers()
{
CcdPhysicsController* ctrl0=0,*ctrl1=0;
if (m_triggerCallbacks[PHY_OBJECT_RESPONSE] || (m_debugDrawer && (m_debugDrawer->GetDebugMode() & IDebugDraw::DBG_DrawContactPoints)))
{
//walk over all overlapping pairs, and if one of the involved bodies is registered for trigger callback, perform callback

View File

@@ -264,3 +264,4 @@ protected:
};
#endif //CCDPHYSICSENVIRONMENT

View File

@@ -286,13 +286,13 @@ void ParallelIslandDispatcher::DispatchAllCollisionPairs(OverlappingPairCache* p
{
//m_blockedForChanges = true;
int i;
int dispatcherId = GetUniqueId();
assert(0);
/*
int dispatcherId = GetUniqueId();
int i;
for (i=0;i<numPairs;i++)
{

View File

@@ -134,15 +134,15 @@ bool ParallelPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep)
*/
//store constraint indices for each island
for (i=0;i<m_constraints.size();i++)
for (unsigned int ui=0;ui<m_constraints.size();ui++)
{
TypedConstraint& constraint = *m_constraints[i];
TypedConstraint& constraint = *m_constraints[ui];
if (constraint.GetRigidBodyA().m_islandTag1 > constraint.GetRigidBodyB().m_islandTag1)
{
simulationIslands[constraint.GetRigidBodyA().m_islandTag1].m_constraintIndices.push_back(i);
simulationIslands[constraint.GetRigidBodyA().m_islandTag1].m_constraintIndices.push_back(ui);
} else
{
simulationIslands[constraint.GetRigidBodyB().m_islandTag1].m_constraintIndices.push_back(i);
simulationIslands[constraint.GetRigidBodyB().m_islandTag1].m_constraintIndices.push_back(ui);
}
}
@@ -203,4 +203,4 @@ bool ParallelPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep)
return true;
}
}

View File

@@ -92,7 +92,7 @@ bool SimulationIsland::Simulate(IDebugDraw* debugDrawer,int numSolverIterations,
overlappingPairs.resize(this->m_overlappingPairIndices.size());
//gather overlapping pair info
int i;
unsigned int i;
for (i=0;i<m_overlappingPairIndices.size();i++)
{
overlappingPairs[i] = overlappingPairBaseAddress[m_overlappingPairIndices[i]];
@@ -119,13 +119,6 @@ bool SimulationIsland::Simulate(IDebugDraw* debugDrawer,int numSolverIterations,
#endif //USE_QUICKPROF
int numRigidBodies = m_controllers.size();
//contacts
#ifdef USE_QUICKPROF
Profiler::beginBlock("SolveConstraint");
@@ -407,8 +400,8 @@ void SimulationIsland::UpdateAabbs(IDebugDraw* debugDrawer,BroadphaseInterface*
SimdVector3 color (1,1,0);
class IDebugDraw* m_debugDrawer = 0;
/*
class IDebugDraw* m_debugDrawer = 0;
if (m_debugDrawer)
{
//draw aabb
@@ -466,4 +459,4 @@ void SimulationIsland::UpdateAabbs(IDebugDraw* debugDrawer,BroadphaseInterface*
}
}
}
}

View File

@@ -50,4 +50,6 @@ class SimulationIsland
void UpdateAabbs(IDebugDraw* debugDrawer,BroadphaseInterface* broadphase,float timeStep);
};
#endif //SIMULATION_ISLAND_H
#endif //SIMULATION_ISLAND_H