fix padding in btSolverConstraint, see Issue 650
fix some warnings
This commit is contained in:
@@ -47,7 +47,7 @@ namespace
|
||||
int framePeriod;//todo: test if this value should be 0
|
||||
int mainWindow;
|
||||
GLUI *glui;
|
||||
float hz;
|
||||
//float hz;
|
||||
float viewZoom=20.f;
|
||||
float viewX;
|
||||
float viewY;
|
||||
|
||||
@@ -114,7 +114,7 @@ void Box2dDemo::initPhysics()
|
||||
toggle = m_dialogDynamicsWorld->createToggle(settings,"Toggle 2");
|
||||
toggle ->m_active = true;
|
||||
toggle = m_dialogDynamicsWorld->createToggle(settings,"Toggle 3");
|
||||
GL_SliderControl* slider = m_dialogDynamicsWorld->createSlider(settings,"Slider");
|
||||
//GL_SliderControl* slider = m_dialogDynamicsWorld->createSlider(settings,"Slider");
|
||||
|
||||
GL_DialogWindow* dialog = m_dialogDynamicsWorld->createDialog(0,200,420,300,"Help");
|
||||
GL_TextControl* txt = new GL_TextControl;
|
||||
|
||||
@@ -49,7 +49,7 @@ void CcdPhysicsDemo::clientMoveAndDisplay()
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
//simple dynamics world doesn't handle fixed-time-stepping
|
||||
float ms = getDeltaTimeMicroseconds();
|
||||
//float ms = getDeltaTimeMicroseconds();
|
||||
|
||||
///step the simulation
|
||||
if (m_dynamicsWorld)
|
||||
|
||||
@@ -44,11 +44,11 @@ static int gJump = 0;
|
||||
|
||||
CharacterDemo::CharacterDemo()
|
||||
:
|
||||
m_indexVertexArrays(0),
|
||||
m_vertices(0),
|
||||
m_cameraHeight(4.f),
|
||||
m_minCameraDistance(3.f),
|
||||
m_maxCameraDistance(10.f),
|
||||
m_indexVertexArrays(0),
|
||||
m_vertices(0)
|
||||
m_maxCameraDistance(10.f)
|
||||
{
|
||||
m_character = 0;
|
||||
m_cameraPosition = btVector3(30,30,30);
|
||||
|
||||
@@ -246,8 +246,8 @@ void CollisionInterfaceDemo::displayCallback(void) {
|
||||
//GL_ShapeDrawer::drawCoordSystem();
|
||||
|
||||
|
||||
btQuaternion qA = objects[0].getWorldTransform().getRotation();
|
||||
btQuaternion qB = objects[1].getWorldTransform().getRotation();
|
||||
// btQuaternion qA = objects[0].getWorldTransform().getRotation();
|
||||
// btQuaternion qB = objects[1].getWorldTransform().getRotation();
|
||||
|
||||
|
||||
if (!m_idle)
|
||||
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
this->min_y = min_y;
|
||||
this->max_y = max_y;
|
||||
sign = 1.0;
|
||||
btScalar dalpha = 2*SIMD_2_PI/NUMRAYS_IN_BAR;
|
||||
// btScalar dalpha = 2*SIMD_2_PI/NUMRAYS_IN_BAR;
|
||||
for (int i = 0; i < NUMRAYS_IN_BAR; i++)
|
||||
{
|
||||
btScalar z = (max_z-min_z)/NUMRAYS_IN_BAR * i + min_z;
|
||||
|
||||
@@ -127,7 +127,7 @@ void ConstraintDemo::initPhysics()
|
||||
btRigidBody* body0 = localCreateRigidBody( mass,trans,shape);
|
||||
trans.setOrigin(btVector3(2*CUBE_HALF_EXTENTS,20,0));
|
||||
mass = 1.f;
|
||||
btRigidBody* body1 = 0;//localCreateRigidBody( mass,trans,shape);
|
||||
// btRigidBody* body1 = 0;//localCreateRigidBody( mass,trans,shape);
|
||||
btVector3 pivotInA(CUBE_HALF_EXTENTS,CUBE_HALF_EXTENTS,0);
|
||||
btTypedConstraint* p2p = new btPoint2PointConstraint(*body0,pivotInA);
|
||||
m_dynamicsWorld->addConstraint(p2p);
|
||||
@@ -145,7 +145,7 @@ void ConstraintDemo::initPhysics()
|
||||
trans.setOrigin(btVector3(2*CUBE_HALF_EXTENTS,20,0));
|
||||
|
||||
mass = 1.f;
|
||||
btRigidBody* body1 = 0;//localCreateRigidBody( mass,trans,shape);
|
||||
// btRigidBody* body1 = 0;//localCreateRigidBody( mass,trans,shape);
|
||||
// btRigidBody* body1 = localCreateRigidBody( 0.0,trans,0);
|
||||
//body1->setActivationState(DISABLE_DEACTIVATION);
|
||||
//body1->setDamping(0.3,0.3);
|
||||
@@ -153,9 +153,9 @@ void ConstraintDemo::initPhysics()
|
||||
btVector3 pivotInA(CUBE_HALF_EXTENTS,-CUBE_HALF_EXTENTS,-CUBE_HALF_EXTENTS);
|
||||
btVector3 axisInA(0,0,1);
|
||||
|
||||
btVector3 pivotInB = body1 ? body1->getCenterOfMassTransform().inverse()(body0->getCenterOfMassTransform()(pivotInA)) : pivotInA;
|
||||
btVector3 axisInB = body1?
|
||||
(body1->getCenterOfMassTransform().getBasis().inverse()*(body1->getCenterOfMassTransform().getBasis() * axisInA)) :
|
||||
// btVector3 pivotInB = body1 ? body1->getCenterOfMassTransform().inverse()(body0->getCenterOfMassTransform()(pivotInA)) : pivotInA;
|
||||
// btVector3 axisInB = body1?
|
||||
// (body1->getCenterOfMassTransform().getBasis().inverse()*(body1->getCenterOfMassTransform().getBasis() * axisInA)) :
|
||||
body0->getCenterOfMassTransform().getBasis() * axisInA;
|
||||
|
||||
#define P2P
|
||||
|
||||
@@ -29,7 +29,7 @@ void btFractureDynamicsWorld::glueCallback()
|
||||
for (i=0;i<getCollisionObjectArray().size(); i++)
|
||||
{
|
||||
btCollisionObject* collisionObject= getCollisionObjectArray()[i];
|
||||
btRigidBody* body = btRigidBody::upcast(collisionObject);
|
||||
// btRigidBody* body = btRigidBody::upcast(collisionObject);
|
||||
//Adding filtering here
|
||||
#ifdef STATIC_SIMULATION_ISLAND_OPTIMIZATION
|
||||
if (!collisionObject->isStaticOrKinematicObject())
|
||||
@@ -68,8 +68,8 @@ void btFractureDynamicsWorld::glueCallback()
|
||||
btCollisionObject* colObj1 = (btCollisionObject*)manifold->getBody1();
|
||||
int tag0 = (colObj0)->getIslandTag();
|
||||
int tag1 = (colObj1)->getIslandTag();
|
||||
btRigidBody* body0 = btRigidBody::upcast(colObj0);
|
||||
btRigidBody* body1 = btRigidBody::upcast(colObj1);
|
||||
//btRigidBody* body0 = btRigidBody::upcast(colObj0);
|
||||
//btRigidBody* body1 = btRigidBody::upcast(colObj1);
|
||||
|
||||
|
||||
if (!colObj0->isStaticOrKinematicObject() && !colObj1->isStaticOrKinematicObject())
|
||||
@@ -410,7 +410,7 @@ void btFractureDynamicsWorld::breakDisconnectedParts( btFractureBody* fracObj)
|
||||
{
|
||||
}
|
||||
|
||||
int fractureObjectIndex = -1;
|
||||
// int fractureObjectIndex = -1;
|
||||
|
||||
int numShapes=0;
|
||||
|
||||
@@ -422,7 +422,7 @@ void btFractureDynamicsWorld::breakDisconnectedParts( btFractureBody* fracObj)
|
||||
for (idx=startIslandIndex;idx<endIslandIndex;idx++)
|
||||
{
|
||||
int i = unionFind.getElement(idx).m_sz;
|
||||
btCollisionShape* shape = compound->getChildShape(i);
|
||||
// btCollisionShape* shape = compound->getChildShape(i);
|
||||
newCompound->addChildShape(compound->getChildTransform(i),compound->getChildShape(i));
|
||||
masses.push_back(fracObj->m_masses[i]);
|
||||
numShapes++;
|
||||
|
||||
@@ -160,8 +160,8 @@ void MultiMaterialDemo::initPhysics()
|
||||
|
||||
int vertStride = sizeof(btVector3);
|
||||
int indexStride = 3*sizeof(int);
|
||||
int materialStride = sizeof(CustomMaterial);
|
||||
int triangleMaterialStride = sizeof(int);
|
||||
// int materialStride = sizeof(CustomMaterial);
|
||||
// int triangleMaterialStride = sizeof(int);
|
||||
|
||||
gVertices = new btVector3[totalVerts];
|
||||
gIndices = new int[totalTriangles*3];
|
||||
|
||||
@@ -176,7 +176,7 @@ void MultiThreadedDemo::clientMoveAndDisplay()
|
||||
|
||||
|
||||
|
||||
float dt = getDeltaTimeMicroseconds() * 0.000001f;
|
||||
// float dt = getDeltaTimeMicroseconds() * 0.000001f;
|
||||
|
||||
// printf("dt = %f: ",dt);
|
||||
|
||||
|
||||
@@ -12,6 +12,10 @@ GLDebugDrawer::GLDebugDrawer()
|
||||
|
||||
}
|
||||
|
||||
GLDebugDrawer::~GLDebugDrawer()
|
||||
{
|
||||
}
|
||||
|
||||
void GLDebugDrawer::drawLine(const btVector3& from,const btVector3& to,const btVector3& fromColor, const btVector3& toColor)
|
||||
{
|
||||
glBegin(GL_LINES);
|
||||
|
||||
@@ -12,7 +12,7 @@ class GLDebugDrawer : public btIDebugDraw
|
||||
public:
|
||||
|
||||
GLDebugDrawer();
|
||||
|
||||
virtual ~GLDebugDrawer();
|
||||
|
||||
virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& fromColor, const btVector3& toColor);
|
||||
|
||||
|
||||
@@ -34,6 +34,10 @@ GL_Simplex1to4::GL_Simplex1to4()
|
||||
{
|
||||
}
|
||||
|
||||
GL_Simplex1to4::~GL_Simplex1to4()
|
||||
{
|
||||
}
|
||||
|
||||
///
|
||||
/// Debugging method calcClosest calculates the closest point to the origin, using m_simplexSolver
|
||||
///
|
||||
|
||||
@@ -28,6 +28,7 @@ class GL_Simplex1to4 : public btBU_Simplex1to4
|
||||
public:
|
||||
|
||||
GL_Simplex1to4();
|
||||
virtual ~GL_Simplex1to4();
|
||||
|
||||
void calcClosest(btScalar* m);
|
||||
|
||||
|
||||
@@ -1402,7 +1402,6 @@ static uint8 *resample_row_generic(uint8 *out, uint8 *in_near, uint8 *in_far, in
|
||||
{
|
||||
// resample with nearest-neighbor
|
||||
int i,j;
|
||||
in_far = in_far;
|
||||
for (i=0; i < w; ++i)
|
||||
for (j=0; j < hs; ++j)
|
||||
out[i*hs+j] = in_near[i];
|
||||
|
||||
@@ -631,8 +631,8 @@ void btParticlesDynamicsWorld::runCollideParticlesKernel()
|
||||
{
|
||||
btAlignedObjectArray<int> pairs;
|
||||
|
||||
float particleRad = m_simParams.m_particleRad;
|
||||
float collideDist2 = (particleRad + particleRad)*(particleRad + particleRad);
|
||||
// float particleRad = m_simParams.m_particleRad;
|
||||
// float collideDist2 = (particleRad + particleRad)*(particleRad + particleRad);
|
||||
cl_int ciErrNum;
|
||||
if(m_useCpuControls[SIMSTAGE_COLLIDE_PARTICLES]->m_active)
|
||||
{ // CPU version
|
||||
|
||||
@@ -227,7 +227,7 @@ bool Raytracer::worldRaytest(const btVector3& rayFrom,const btVector3& rayTo,btV
|
||||
bool Raytracer::singleObjectRaytest(const btVector3& rayFrom,const btVector3& rayTo,btVector3& worldNormal,btVector3& worldHitPoint)
|
||||
{
|
||||
|
||||
btScalar closestHitResults = 1.f;
|
||||
// btScalar closestHitResults = 1.f;
|
||||
|
||||
btCollisionWorld::ClosestRayResultCallback resultCallback(rayFrom,rayTo);
|
||||
|
||||
@@ -478,7 +478,9 @@ void Raytracer::displayCallback()
|
||||
rgba[3] = 1.f;
|
||||
raytracePicture->setPixel(x,y,rgba);
|
||||
} else
|
||||
btVector4 rgba = raytracePicture->getPixel(x,y);
|
||||
{
|
||||
// btVector4 rgba = raytracePicture->getPixel(x,y);
|
||||
}
|
||||
if (!rgba.length2())
|
||||
{
|
||||
raytracePicture->setPixel(x,y,btVector4(1,1,1,1));
|
||||
|
||||
@@ -98,8 +98,8 @@ void SerializeDemo::keyboardCallback(unsigned char key, int x, int y)
|
||||
|
||||
btCollisionObject* colObj0 = (btCollisionObject*)manifold->getBody0();
|
||||
btCollisionObject* colObj1 = (btCollisionObject*)manifold->getBody1();
|
||||
int tag0 = (colObj0)->getIslandTag();
|
||||
int tag1 = (colObj1)->getIslandTag();
|
||||
// int tag0 = (colObj0)->getIslandTag();
|
||||
// int tag1 = (colObj1)->getIslandTag();
|
||||
btRigidBody* body0 = btRigidBody::upcast(colObj0);
|
||||
btRigidBody* body1 = btRigidBody::upcast(colObj1);
|
||||
if (bodies.findLinearSearch(body0)==bodies.size())
|
||||
|
||||
@@ -755,7 +755,7 @@ cl_kernel btOpenCLUtils::compileCLKernelFromString(cl_context clContext, cl_devi
|
||||
printf("compiling kernel %s ",kernelName);
|
||||
cl_kernel kernel;
|
||||
cl_int localErrNum;
|
||||
size_t program_length = strlen(kernelSource);
|
||||
//size_t program_length = strlen(kernelSource);
|
||||
|
||||
|
||||
cl_program m_cpProgram = prog;
|
||||
|
||||
@@ -55,7 +55,7 @@ April 24, 2008
|
||||
#endif
|
||||
|
||||
static btPoint2PointConstraint* spP2PConst;
|
||||
static btHingeConstraint* spHingeConst;
|
||||
//static btHingeConstraint* spHingeConst;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ static btRigidBody* staticBody = 0;
|
||||
static float waveheight = 5.f;
|
||||
|
||||
const float TRIANGLE_SIZE=8.f;
|
||||
unsigned int current_demo=20;
|
||||
int current_demo=20;
|
||||
#define DEMO_MODE_TIMEOUT 15.f //15 seconds for each demo
|
||||
|
||||
|
||||
@@ -1663,7 +1663,7 @@ void SoftDemo::clientMoveAndDisplay()
|
||||
|
||||
#else
|
||||
//during idle mode, just run 1 simulation step maximum, otherwise 4 at max
|
||||
int maxSimSubSteps = m_idle ? 1 : 4;
|
||||
// int maxSimSubSteps = m_idle ? 1 : 4;
|
||||
//if (m_idle)
|
||||
// dt = 1.0/420.f;
|
||||
|
||||
@@ -1743,10 +1743,10 @@ void SoftDemo::renderme()
|
||||
glDisable(GL_LIGHTING);
|
||||
m_dynamicsWorld->debugDrawWorld();
|
||||
|
||||
int debugMode = m_dynamicsWorld->getDebugDrawer()? m_dynamicsWorld->getDebugDrawer()->getDebugMode() : -1;
|
||||
//int debugMode = m_dynamicsWorld->getDebugDrawer()? m_dynamicsWorld->getDebugDrawer()->getDebugMode() : -1;
|
||||
|
||||
btSoftRigidDynamicsWorld* softWorld = (btSoftRigidDynamicsWorld*)m_dynamicsWorld;
|
||||
btIDebugDraw* sdraw = softWorld ->getDebugDrawer();
|
||||
//btIDebugDraw* sdraw = softWorld ->getDebugDrawer();
|
||||
|
||||
|
||||
for ( int i=0;i<softWorld->getSoftBodyArray().size();i++)
|
||||
|
||||
@@ -223,8 +223,8 @@ int main(int argc, char **argv)
|
||||
const char* cSourceFile = "VectorAddKernels.cl";
|
||||
|
||||
printf("loadProgSource (%s)...\n", cSourceFile);
|
||||
const char* cPathAndName = cSourceFile;
|
||||
#ifdef LOAD_FROM_FILE
|
||||
const char* cPathAndName = cSourceFile;
|
||||
size_t szKernelLength;
|
||||
const char* cSourceCL = loadProgSource(cPathAndName, "", &szKernelLength);
|
||||
#else
|
||||
|
||||
@@ -65,8 +65,8 @@ void VoronoiFractureDemo::attachFixedConstraints()
|
||||
|
||||
btCollisionObject* colObj0 = (btCollisionObject*)manifold->getBody0();
|
||||
btCollisionObject* colObj1 = (btCollisionObject*)manifold->getBody1();
|
||||
int tag0 = (colObj0)->getIslandTag();
|
||||
int tag1 = (colObj1)->getIslandTag();
|
||||
// int tag0 = (colObj0)->getIslandTag();
|
||||
// int tag1 = (colObj1)->getIslandTag();
|
||||
btRigidBody* body0 = btRigidBody::upcast(colObj0);
|
||||
btRigidBody* body1 = btRigidBody::upcast(colObj1);
|
||||
if (bodies.findLinearSearch(body0)==bodies.size())
|
||||
|
||||
@@ -2534,7 +2534,7 @@ int calchullgen(float3 *verts,int verts_count, int vlimit,Array<btHullTriangle*>
|
||||
vlimit-=4;
|
||||
while(vlimit >0 && (te=extrudable(epsilon, tris)))
|
||||
{
|
||||
int3 ti=*te;
|
||||
// int3 ti=*te;
|
||||
int v=te->vmax;
|
||||
assert(!isextreme[v]); // wtf we've already done this vertex
|
||||
isextreme[v]=1;
|
||||
|
||||
@@ -539,7 +539,7 @@ btCollisionShape* btBulletWorldImporter::convertCollisionShape( btCollisionShap
|
||||
tmpPos[i].deSerializeFloat(mss->m_localPositionArrayPtr[i].m_pos);
|
||||
radii[i] = mss->m_localPositionArrayPtr[i].m_radius;
|
||||
}
|
||||
shape = new btMultiSphereShape(&tmpPos[0],&radii[0],numSpheres);
|
||||
shape = createMultiSphereShape(&tmpPos[0],&radii[0],numSpheres);
|
||||
break;
|
||||
}
|
||||
case CONVEX_HULL_SHAPE_PROXYTYPE:
|
||||
@@ -1393,6 +1393,12 @@ btScaledBvhTriangleMeshShape* btBulletWorldImporter::createScaledTrangleMeshShap
|
||||
return shape;
|
||||
}
|
||||
|
||||
btMultiSphereShape* btBulletWorldImporter::createMultiSphereShape(const btVector3* positions,const btScalar* radi,int numSpheres)
|
||||
{
|
||||
btMultiSphereShape* shape = new btMultiSphereShape(positions, radi, numSpheres);
|
||||
m_allocatedCollisionShapes.push_back(shape);
|
||||
return shape;
|
||||
}
|
||||
|
||||
btRigidBody& btBulletWorldImporter::getFixedBody()
|
||||
{
|
||||
|
||||
@@ -183,6 +183,8 @@ public:
|
||||
virtual class btCompoundShape* createCompoundShape();
|
||||
virtual class btScaledBvhTriangleMeshShape* createScaledTrangleMeshShape(btBvhTriangleMeshShape* meshShape,const btVector3& localScalingbtBvhTriangleMeshShape);
|
||||
|
||||
virtual class btMultiSphereShape* createMultiSphereShape(const btVector3* positions,const btScalar* radi,int numSpheres);
|
||||
|
||||
virtual btTriangleIndexVertexArray* createMeshInterface(btStridingMeshInterfaceData& meshData);
|
||||
|
||||
///acceleration and connectivity structures
|
||||
|
||||
@@ -1017,7 +1017,7 @@ public:
|
||||
spacebar_mouse_click = true; /* Does spacebar simulate a mouse click? */
|
||||
live_type = GLUI_LIVE_NONE;
|
||||
text = "";
|
||||
last_live_text == "";
|
||||
// last_live_text == "";
|
||||
live_inited = false;
|
||||
collapsible = false;
|
||||
is_open = true;
|
||||
|
||||
@@ -9,8 +9,8 @@ solution "0BulletSolution"
|
||||
}
|
||||
|
||||
newoption {
|
||||
trigger = "with-demos",
|
||||
description = "Enable demos and extras"
|
||||
trigger = "without-demos",
|
||||
description = "Disable demos and extras"
|
||||
}
|
||||
|
||||
newoption {
|
||||
@@ -165,7 +165,7 @@ end
|
||||
include "../src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/NVidia"
|
||||
end
|
||||
|
||||
if _OPTIONS["with-demos"] then
|
||||
if not _OPTIONS["without-demos"] then
|
||||
include "../Demos"
|
||||
include "../Extras"
|
||||
end
|
||||
|
||||
@@ -354,7 +354,7 @@ void b2CollidePolygons(btManifoldResult* manifold,
|
||||
btVector3 v11 = vertices1[edge1];
|
||||
btVector3 v12 = edge1 + 1 < count1 ? vertices1[edge1+1] : vertices1[0];
|
||||
|
||||
btVector3 dv = v12 - v11;
|
||||
//btVector3 dv = v12 - v11;
|
||||
btVector3 sideNormal = b2Mul(xf1.getBasis(), v12 - v11);
|
||||
sideNormal.normalize();
|
||||
btVector3 frontNormal = btCrossS(sideNormal, 1.0f);
|
||||
|
||||
@@ -314,8 +314,8 @@ void btConvexConvexAlgorithm ::processCollision (const btCollisionObjectWrapper*
|
||||
{
|
||||
btCapsuleShape* capsuleA = (btCapsuleShape*) min0;
|
||||
btCapsuleShape* capsuleB = (btCapsuleShape*) min1;
|
||||
btVector3 localScalingA = capsuleA->getLocalScaling();
|
||||
btVector3 localScalingB = capsuleB->getLocalScaling();
|
||||
// btVector3 localScalingA = capsuleA->getLocalScaling();
|
||||
// btVector3 localScalingB = capsuleB->getLocalScaling();
|
||||
|
||||
btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr
|
||||
tri_shape->getVertex(1,v1);
|
||||
tri_shape->getVertex(2,v2);
|
||||
|
||||
btVector3 center = (v0+v1+v2)*btScalar(1./3.);
|
||||
//btVector3 center = (v0+v1+v2)*btScalar(1./3.);
|
||||
|
||||
btVector3 red(1,0,0), green(0,1,0),blue(0,0,1),white(1,1,1),black(0,0,0);
|
||||
btVector3 tri_normal;
|
||||
|
||||
@@ -44,7 +44,7 @@ btVector3 btConvexPointCloudShape::localGetSupportingVertexWithoutMargin(const b
|
||||
if( m_numPoints > 0 )
|
||||
{
|
||||
// Here we take advantage of dot(a*b, c) = dot( a, b*c) to do less work. Note this transformation is true mathematically, not numerically.
|
||||
btVector3 scaled = vec * m_localScaling;
|
||||
// btVector3 scaled = vec * m_localScaling;
|
||||
int index = (int) vec.maxDot( &m_unscaledPoints[0], m_numPoints, maxDot); //FIXME: may violate encapsulation of m_unscaledPoints
|
||||
return getScaledPoint(index);
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ const char* btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* s
|
||||
int gfxindex;
|
||||
// btVector3 triangle[3];
|
||||
|
||||
btVector3 meshScaling = getScaling();
|
||||
// btVector3 meshScaling = getScaling();
|
||||
|
||||
///if the number of parts is big, the performance might drop due to the innerloop switch on indextype
|
||||
for (part=0;part<graphicssubparts ;part++,memPtr++)
|
||||
|
||||
@@ -44,8 +44,8 @@ class btManifoldPoint
|
||||
public:
|
||||
btManifoldPoint()
|
||||
:m_userPersistentData(0),
|
||||
m_appliedImpulse(0.f),
|
||||
m_lateralFrictionInitialized(false),
|
||||
m_appliedImpulse(0.f),
|
||||
m_appliedImpulseLateral1(0.f),
|
||||
m_appliedImpulseLateral2(0.f),
|
||||
m_contactMotion1(0.f),
|
||||
@@ -66,8 +66,8 @@ class btManifoldPoint
|
||||
m_combinedFriction(btScalar(0.)),
|
||||
m_combinedRestitution(btScalar(0.)),
|
||||
m_userPersistentData(0),
|
||||
m_appliedImpulse(0.f),
|
||||
m_lateralFrictionInitialized(false),
|
||||
m_appliedImpulse(0.f),
|
||||
m_appliedImpulseLateral1(0.f),
|
||||
m_appliedImpulseLateral2(0.f),
|
||||
m_contactMotion1(0.f),
|
||||
|
||||
@@ -400,9 +400,9 @@ void btPolyhedralContactClipping::clipHullAgainstHull(const btVector3& separatin
|
||||
{
|
||||
|
||||
btVector3 separatingNormal = separatingNormal1.normalized();
|
||||
const btVector3 c0 = transA * hullA.m_localCenter;
|
||||
const btVector3 c1 = transB * hullB.m_localCenter;
|
||||
const btVector3 DeltaC2 = c0 - c1;
|
||||
// const btVector3 c0 = transA * hullA.m_localCenter;
|
||||
// const btVector3 c1 = transB * hullB.m_localCenter;
|
||||
//const btVector3 DeltaC2 = c0 - c1;
|
||||
|
||||
|
||||
int closestFaceB=-1;
|
||||
|
||||
@@ -506,7 +506,7 @@ void btConeTwistConstraint::solveConstraintObsolete(btSolverBody& bodyA,btSolver
|
||||
m_accTwistLimitImpulse = btMax(m_accTwistLimitImpulse + impulseMag, btScalar(0.0) );
|
||||
impulseMag = m_accTwistLimitImpulse - temp;
|
||||
|
||||
btVector3 impulse = m_twistAxis * impulseMag;
|
||||
// btVector3 impulse = m_twistAxis * impulseMag;
|
||||
|
||||
bodyA.internalApplyImpulse(btVector3(0,0,0), m_rbA.getInvInertiaTensorWorld()*m_twistAxis,impulseMag);
|
||||
bodyB.internalApplyImpulse(btVector3(0,0,0), m_rbB.getInvInertiaTensorWorld()*m_twistAxis,-impulseMag);
|
||||
@@ -828,11 +828,10 @@ void btConeTwistConstraint::computeConeLimitInfo(const btQuaternion& qCone,
|
||||
{
|
||||
vSwingAxis = btVector3(qCone.x(), qCone.y(), qCone.z());
|
||||
vSwingAxis.normalize();
|
||||
if (fabs(vSwingAxis.x()) > SIMD_EPSILON)
|
||||
{
|
||||
#if 0
|
||||
// non-zero twist?! this should never happen.
|
||||
int wtf = 0; wtf = wtf;
|
||||
}
|
||||
btAssert(fabs(vSwingAxis.x()) <= SIMD_EPSILON));
|
||||
#endif
|
||||
|
||||
// Compute limit for given swing. tricky:
|
||||
// Given a swing axis, we're looking for the intersection with the bounding cone ellipse.
|
||||
@@ -877,7 +876,9 @@ void btConeTwistConstraint::computeConeLimitInfo(const btQuaternion& qCone,
|
||||
else if (swingAngle < 0)
|
||||
{
|
||||
// this should never happen!
|
||||
int wtf = 0; wtf = wtf;
|
||||
#if 0
|
||||
btAssert(0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -929,7 +930,9 @@ void btConeTwistConstraint::computeTwistLimitInfo(const btQuaternion& qTwist,
|
||||
if (twistAngle < 0)
|
||||
{
|
||||
// this should never happen
|
||||
int wtf = 0; wtf = wtf;
|
||||
#if 0
|
||||
btAssert(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
vTwistAxis = btVector3(qMinTwist.x(), qMinTwist.y(), qMinTwist.z());
|
||||
@@ -976,10 +979,10 @@ void btConeTwistConstraint::setMotorTarget(const btQuaternion &q)
|
||||
{
|
||||
btTransform trACur = m_rbA.getCenterOfMassTransform();
|
||||
btTransform trBCur = m_rbB.getCenterOfMassTransform();
|
||||
btTransform trABCur = trBCur.inverse() * trACur;
|
||||
btQuaternion qABCur = trABCur.getRotation();
|
||||
btTransform trConstraintCur = (trBCur * m_rbBFrame).inverse() * (trACur * m_rbAFrame);
|
||||
btQuaternion qConstraintCur = trConstraintCur.getRotation();
|
||||
// btTransform trABCur = trBCur.inverse() * trACur;
|
||||
// btQuaternion qABCur = trABCur.getRotation();
|
||||
// btTransform trConstraintCur = (trBCur * m_rbBFrame).inverse() * (trACur * m_rbAFrame);
|
||||
//btQuaternion qConstraintCur = trConstraintCur.getRotation();
|
||||
|
||||
btQuaternion qConstraint = m_rbBFrame.getRotation().inverse() * q * m_rbAFrame.getRotation();
|
||||
setMotorTargetInConstraintSpace(qConstraint);
|
||||
|
||||
@@ -144,6 +144,7 @@ public:
|
||||
|
||||
virtual void solveConstraintObsolete(btSolverBody& bodyA,btSolverBody& bodyB,btScalar timeStep);
|
||||
|
||||
|
||||
void updateRHS(btScalar timeStep);
|
||||
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ void btGeneric6DofSpringConstraint::internalUpdateSprings(btConstraintInfo2* inf
|
||||
{
|
||||
// it is assumed that calculateTransforms() have been called before this call
|
||||
int i;
|
||||
btVector3 relVel = m_rbB.getLinearVelocity() - m_rbA.getLinearVelocity();
|
||||
//btVector3 relVel = m_rbB.getLinearVelocity() - m_rbA.getLinearVelocity();
|
||||
for(i = 0; i < 3; i++)
|
||||
{
|
||||
if(m_springEnabled[i])
|
||||
|
||||
@@ -702,8 +702,8 @@ void btHingeConstraint::getInfo2InternalUsingFrameOffset(btConstraintInfo2* info
|
||||
btTransform trA = transA*m_rbAFrame;
|
||||
btTransform trB = transB*m_rbBFrame;
|
||||
// pivot point
|
||||
btVector3 pivotAInW = trA.getOrigin();
|
||||
btVector3 pivotBInW = trB.getOrigin();
|
||||
// btVector3 pivotAInW = trA.getOrigin();
|
||||
// btVector3 pivotBInW = trB.getOrigin();
|
||||
#if 1
|
||||
// difference between frames in WCS
|
||||
btVector3 ofs = trB.getOrigin() - trA.getOrigin();
|
||||
|
||||
@@ -124,7 +124,7 @@ void btPoint2PointConstraint::getInfo2NonVirtual (btConstraintInfo2* info, const
|
||||
btVector3 a2 = body1_trans.getBasis()*getPivotInB();
|
||||
|
||||
{
|
||||
btVector3 a2n = -a2;
|
||||
// btVector3 a2n = -a2;
|
||||
btVector3* angular0 = (btVector3*)(info->m_J2angularAxis);
|
||||
btVector3* angular1 = (btVector3*)(info->m_J2angularAxis+info->rowskip);
|
||||
btVector3* angular2 = (btVector3*)(info->m_J2angularAxis+2*info->rowskip);
|
||||
|
||||
@@ -677,8 +677,8 @@ void btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold* m
|
||||
int solverBodyIdA = getOrInitSolverBody(*colObj0);
|
||||
int solverBodyIdB = getOrInitSolverBody(*colObj1);
|
||||
|
||||
btRigidBody* bodyA = btRigidBody::upcast(colObj0);
|
||||
btRigidBody* bodyB = btRigidBody::upcast(colObj1);
|
||||
// btRigidBody* bodyA = btRigidBody::upcast(colObj0);
|
||||
// btRigidBody* bodyB = btRigidBody::upcast(colObj1);
|
||||
|
||||
btSolverBody* solverBodyA = &m_tmpSolverBodyPool[solverBodyIdA];
|
||||
btSolverBody* solverBodyB = &m_tmpSolverBodyPool[solverBodyIdB];
|
||||
@@ -686,7 +686,7 @@ void btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold* m
|
||||
|
||||
|
||||
///avoid collision response between two static objects
|
||||
if (!solverBodyA || !solverBodyA->m_originalBody && (!solverBodyB || !solverBodyB->m_originalBody))
|
||||
if (!solverBodyA || (!solverBodyA->m_originalBody && (!solverBodyB || !solverBodyB->m_originalBody)))
|
||||
return;
|
||||
|
||||
for (int j=0;j<manifold->getNumContacts();j++)
|
||||
@@ -704,8 +704,8 @@ void btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold* m
|
||||
|
||||
int frictionIndex = m_tmpSolverContactConstraintPool.size();
|
||||
btSolverConstraint& solverConstraint = m_tmpSolverContactConstraintPool.expandNonInitializing();
|
||||
btRigidBody* rb0 = btRigidBody::upcast(colObj0);
|
||||
btRigidBody* rb1 = btRigidBody::upcast(colObj1);
|
||||
// btRigidBody* rb0 = btRigidBody::upcast(colObj0);
|
||||
// btRigidBody* rb1 = btRigidBody::upcast(colObj1);
|
||||
solverConstraint.m_solverBodyIdA = solverBodyIdA;
|
||||
solverConstraint.m_solverBodyIdB = solverBodyIdB;
|
||||
|
||||
@@ -997,7 +997,7 @@ btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCol
|
||||
}
|
||||
}
|
||||
|
||||
btContactSolverInfo info = infoGlobal;
|
||||
// btContactSolverInfo info = infoGlobal;
|
||||
|
||||
|
||||
int numNonContactPool = m_tmpSolverNonContactConstraintPool.size();
|
||||
|
||||
@@ -275,7 +275,7 @@ ATTRIBUTE_ALIGNED64 (struct) btSolverBody
|
||||
btTransform newTransform;
|
||||
if (m_pushVelocity[0]!=0.f || m_pushVelocity[1]!=0 || m_pushVelocity[2]!=0 || m_turnVelocity[0]!=0.f || m_turnVelocity[1]!=0 || m_turnVelocity[2]!=0)
|
||||
{
|
||||
btQuaternion orn = m_worldTransform.getRotation();
|
||||
// btQuaternion orn = m_worldTransform.getRotation();
|
||||
btTransformUtil::integrateTransform(m_worldTransform,m_pushVelocity,m_turnVelocity*splitImpulseTurnErp,timeStep,newTransform);
|
||||
m_worldTransform = newTransform;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class btRigidBody;
|
||||
|
||||
|
||||
///1D constraint along a normal axis between bodyA and bodyB. It can be combined to solve contact and friction constraints.
|
||||
ATTRIBUTE_ALIGNED64 (struct) btSolverConstraint
|
||||
ATTRIBUTE_ALIGNED16 (struct) btSolverConstraint
|
||||
{
|
||||
BT_DECLARE_ALIGNED_ALLOCATOR();
|
||||
|
||||
@@ -43,39 +43,25 @@ ATTRIBUTE_ALIGNED64 (struct) btSolverConstraint
|
||||
mutable btSimdScalar m_appliedPushImpulse;
|
||||
mutable btSimdScalar m_appliedImpulse;
|
||||
|
||||
|
||||
btScalar m_friction;
|
||||
btScalar m_jacDiagABInv;
|
||||
union
|
||||
{
|
||||
int m_numConsecutiveRowsPerKernel;
|
||||
btScalar m_unusedPadding0;
|
||||
};
|
||||
|
||||
int m_overrideNumSolverIterations;
|
||||
|
||||
union
|
||||
{
|
||||
int m_frictionIndex;
|
||||
btScalar m_unusedPadding1;
|
||||
};
|
||||
|
||||
int m_solverBodyIdA;
|
||||
|
||||
int m_solverBodyIdB;
|
||||
btScalar m_rhs;
|
||||
btScalar m_cfm;
|
||||
|
||||
btScalar m_lowerLimit;
|
||||
btScalar m_upperLimit;
|
||||
btScalar m_rhsPenetration;
|
||||
union
|
||||
{
|
||||
void* m_originalContactPoint;
|
||||
btScalar m_unusedPadding4;
|
||||
};
|
||||
|
||||
btScalar m_rhs;
|
||||
btScalar m_cfm;
|
||||
btScalar m_lowerLimit;
|
||||
btScalar m_upperLimit;
|
||||
int m_overrideNumSolverIterations;
|
||||
int m_frictionIndex;
|
||||
int m_solverBodyIdA;
|
||||
int m_solverBodyIdB;
|
||||
|
||||
btScalar m_rhsPenetration;
|
||||
|
||||
enum btSolverConstraintType
|
||||
{
|
||||
|
||||
@@ -203,13 +203,14 @@ struct InplaceSolverIslandCallback : public btSimulationIslandManager::IslandCal
|
||||
|
||||
btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver, btCollisionConfiguration* collisionConfiguration)
|
||||
:btDynamicsWorld(dispatcher,pairCache,collisionConfiguration),
|
||||
m_sortedConstraints (),
|
||||
m_solverIslandCallback ( NULL ),
|
||||
m_constraintSolver(constraintSolver),
|
||||
m_gravity(0,-10,0),
|
||||
m_localTime(0),
|
||||
m_synchronizeAllMotionStates(false),
|
||||
m_profileTimings(0),
|
||||
m_sortedConstraints (),
|
||||
m_solverIslandCallback ( NULL )
|
||||
m_profileTimings(0)
|
||||
|
||||
{
|
||||
if (!m_constraintSolver)
|
||||
{
|
||||
|
||||
@@ -793,7 +793,7 @@ void btOpenCLSoftBodySolver::optimize( btAlignedObjectArray< btSoftBody * > &sof
|
||||
|
||||
int firstLink = getLinkData().getNumLinks();
|
||||
int numLinks = softBody->m_links.size();
|
||||
int maxLinks = numLinks;
|
||||
// int maxLinks = numLinks;
|
||||
|
||||
// Allocate space for the links
|
||||
getLinkData().createLinks( numLinks );
|
||||
|
||||
@@ -460,8 +460,8 @@ void btSoftBody::addAeroForceToNode(const btVector3& windVelocity,int nodeInde
|
||||
const btScalar dt = m_sst.sdt;
|
||||
const btScalar kLF = m_cfg.kLF;
|
||||
const btScalar kDG = m_cfg.kDG;
|
||||
const btScalar kPR = m_cfg.kPR;
|
||||
const btScalar kVC = m_cfg.kVC;
|
||||
//const btScalar kPR = m_cfg.kPR;
|
||||
//const btScalar kVC = m_cfg.kVC;
|
||||
const bool as_lift = kLF>0;
|
||||
const bool as_drag = kDG>0;
|
||||
const bool as_aero = as_lift || as_drag;
|
||||
|
||||
@@ -563,7 +563,7 @@ int HullLibrary::calchullgen(btVector3 *verts,int verts_count, int vlimit)
|
||||
vlimit-=4;
|
||||
while(vlimit >0 && ((te=extrudable(epsilon)) != 0))
|
||||
{
|
||||
int3 ti=*te;
|
||||
//int3 ti=*te;
|
||||
int v=te->vmax;
|
||||
btAssert(v != -1);
|
||||
btAssert(!isextreme[v]); // wtf we've already done this vertex
|
||||
|
||||
Reference in New Issue
Block a user