Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-03-24 11:52:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-24 11:52:14 +0400
commitb8a71efeba70d6c3ebc579f5043daa4162da86e8 (patch)
treed2d89da2a59f8955583f4968a35e48c578fd4d4c /source/gameengine/Physics/Bullet
parent81d8f17843f92c6d6abbacb652ca22917910f4bc (diff)
style cleanup: follow style guide for/with/if spacing
Diffstat (limited to 'source/gameengine/Physics/Bullet')
-rw-r--r--source/gameengine/Physics/Bullet/CcdGraphicController.cpp2
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp96
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp82
3 files changed, 90 insertions, 90 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.cpp b/source/gameengine/Physics/Bullet/CcdGraphicController.cpp
index a5577d5e7d2..92cba6e9afc 100644
--- a/source/gameengine/Physics/Bullet/CcdGraphicController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdGraphicController.cpp
@@ -131,7 +131,7 @@ void CcdGraphicController::SetPhysicsEnvironment(class PHY_IPhysicsEnvironment*
{
CcdPhysicsEnvironment* phyEnv = static_cast<CcdPhysicsEnvironment*>(env);
/* Updates the m_phyEnv's m_cullingTree & m_cullingCache */
- if(getBroadphaseHandle()) {
+ if (getBroadphaseHandle()) {
/* insert into the new physics scene */
Activate(false);
m_phyEnv= phyEnv;
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index 0ece33a7f06..73ba187d732 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -207,14 +207,14 @@ bool CcdPhysicsController::CreateSoftbody()
psb=new btSoftBody(&worldInfo,(int)hres.mNumOutputVertices,
&hres.m_OutputVertices[0],0);
- for(int i=0;i<(int)hres.mNumFaces;++i)
+ for (int i=0;i<(int)hres.mNumFaces;++i)
{
const int idx[]={ hres.m_Indices[i*3+0],
hres.m_Indices[i*3+1],
hres.m_Indices[i*3+2]};
- if(idx[0]<idx[1]) psb->appendLink( idx[0],idx[1]);
- if(idx[1]<idx[2]) psb->appendLink( idx[1],idx[2]);
- if(idx[2]<idx[0]) psb->appendLink( idx[2],idx[0]);
+ if (idx[0]<idx[1]) psb->appendLink( idx[0],idx[1]);
+ if (idx[1]<idx[2]) psb->appendLink( idx[1],idx[2]);
+ if (idx[2]<idx[0]) psb->appendLink( idx[2],idx[0]);
psb->appendFace(idx[0],idx[1],idx[2]);
}
hlib.ReleaseResult(hres);
@@ -379,10 +379,10 @@ bool CcdPhysicsController::CreateSoftbody()
mmat = rasMesh->GetMeshMaterial(m);
slot = mmat->m_baseslot;
- for(slot->begin(it); !slot->end(it); slot->next(it))
+ for (slot->begin(it); !slot->end(it); slot->next(it))
{
int index = 0;
- for(i=it.startvertex; i<it.endvertex; i++,index++)
+ for (i=it.startvertex; i<it.endvertex; i++,index++)
{
RAS_TexVert* vertex = &it.vertex[i];
//search closest index, and store it in vertex
@@ -492,7 +492,7 @@ static void DeleteBulletShape(btCollisionShape* shape, bool free)
if (meshInterface)
delete meshInterface;
}
- if(free) {
+ if (free) {
delete shape;
}
}
@@ -555,12 +555,12 @@ bool CcdPhysicsController::ReplaceControllerShape(btCollisionShape *newShape)
btCollisionObject *ob;
btBroadphaseProxy* proxy;
- for(int i= 0; i < obarr.size(); i++) {
+ for (int i= 0; i < obarr.size(); i++) {
ob= obarr[i];
if (ob->getCollisionShape() == newShape) {
proxy = ob->getBroadphaseHandle();
- if(proxy)
+ if (proxy)
dw->getPairCache()->cleanProxyFromPairs(proxy,dw->getDispatcher());
}
}
@@ -629,7 +629,7 @@ bool CcdPhysicsController::SynchronizeMotionStates(float time)
const btVector3& linvel = body->getLinearVelocity();
float len= linvel.length();
- if((m_cci.m_clamp_vel_max>0.0) && (len > m_cci.m_clamp_vel_max))
+ if ((m_cci.m_clamp_vel_max>0.0) && (len > m_cci.m_clamp_vel_max))
body->setLinearVelocity(linvel * (m_cci.m_clamp_vel_max / len));
else if ((m_cci.m_clamp_vel_min>0.0) && btFuzzyZero(len)==0 && (len < m_cci.m_clamp_vel_min))
@@ -1644,12 +1644,12 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm,
/* If this ever gets confusing, print out an OBJ file for debugging */
#if 0
printf("# vert count %d\n", m_vertexArray.size());
- for(i=0; i<m_vertexArray.size(); i+=1) {
+ for (i=0; i<m_vertexArray.size(); i+=1) {
printf("v %.6f %.6f %.6f\n", m_vertexArray[i].x(), m_vertexArray[i].y(), m_vertexArray[i].z());
}
printf("# face count %d\n", m_triFaceArray.size());
- for(i=0; i<m_triFaceArray.size(); i+=3) {
+ for (i=0; i<m_triFaceArray.size(); i+=3) {
printf("f %d %d %d\n", m_triFaceArray[i]+1, m_triFaceArray[i+1]+1, m_triFaceArray[i+2]+1);
}
#endif
@@ -1701,10 +1701,10 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
const int tri_verts[4]= {0,1,2, -1};
const int *fv_pt;
- if(gameobj==NULL && meshobj==NULL)
+ if (gameobj==NULL && meshobj==NULL)
return false;
- if(m_shapeType != PHY_SHAPE_MESH)
+ if (m_shapeType != PHY_SHAPE_MESH)
return false;
RAS_Deformer *deformer= gameobj ? gameobj->GetDeformer():NULL;
@@ -1714,21 +1714,21 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
dm = deformer->GetPhysicsMesh();
/* get the mesh from the object if not defined */
- if(meshobj==NULL) {
+ if (meshobj==NULL) {
/* modifier mesh */
- if(dm)
+ if (dm)
meshobj= deformer->GetRasMesh();
/* game object first mesh */
- if(meshobj==NULL) {
- if(gameobj->GetMeshCount() > 0) {
+ if (meshobj==NULL) {
+ if (gameobj->GetMeshCount() > 0) {
meshobj= gameobj->GetMesh(0);
}
}
}
- if(dm && deformer->GetRasMesh() == meshobj)
+ if (dm && deformer->GetRasMesh() == meshobj)
{ /*
* Derived Mesh Update
*
@@ -1745,7 +1745,7 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
int flen;
- if(CustomData_has_layer(&dm->faceData, CD_MTFACE))
+ if (CustomData_has_layer(&dm->faceData, CD_MTFACE))
{
MTFace *tface = (MTFace *)dm->getTessFaceDataArray(dm, CD_MTFACE);
MTFace *tf;
@@ -1753,10 +1753,10 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
vector<bool> vert_tag_array(numverts, false);
vector<int> vert_remap_array(numverts, 0);
- for(mf= mface, tf= tface, i=0; i < numpolys; mf++, tf++, i++) {
- if(tf->mode & TF_DYNAMIC)
+ for (mf= mface, tf= tface, i=0; i < numpolys; mf++, tf++, i++) {
+ if (tf->mode & TF_DYNAMIC)
{
- if(mf->v4) {
+ if (mf->v4) {
tot_bt_tris+= 2;
flen= 4;
} else {
@@ -1764,11 +1764,11 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
flen= 3;
}
- for(j=0; j<flen; j++)
+ for (j=0; j<flen; j++)
{
v_orig = (*(&mf->v1 + j));
- if(vert_tag_array[v_orig]==false)
+ if (vert_tag_array[v_orig]==false)
{
vert_tag_array[v_orig]= true;
vert_remap_array[v_orig]= tot_bt_verts;
@@ -1790,13 +1790,13 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
m_polygonIndexArray.resize(tot_bt_tris);
int *poly_index_pt= &m_polygonIndexArray[0];
- for(mf= mface, tf= tface, i=0; i < numpolys; mf++, tf++, i++)
+ for (mf= mface, tf= tface, i=0; i < numpolys; mf++, tf++, i++)
{
- if(tf->mode & TF_DYNAMIC)
+ if (tf->mode & TF_DYNAMIC)
{
int origi = (index)? index[i]: i;
- if(mf->v4) {
+ if (mf->v4) {
fv_pt= quad_verts;
*poly_index_pt++ = origi;
*poly_index_pt++ = origi;
@@ -1807,11 +1807,11 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
flen= 3;
}
- for(; *fv_pt > -1; fv_pt++)
+ for (; *fv_pt > -1; fv_pt++)
{
v_orig = (*(&mf->v1 + (*fv_pt)));
- if(vert_tag_array[v_orig])
+ if (vert_tag_array[v_orig])
{
mv= mvert + v_orig;
*bt++ = mv->co[0];
@@ -1833,7 +1833,7 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
tot_bt_verts= numverts;
- for(mf= mface, i=0; i < numpolys; mf++, i++) {
+ for (mf= mface, i=0; i < numpolys; mf++, i++) {
tot_bt_tris += (mf->v4 ? 2:1);
}
@@ -1848,14 +1848,14 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
m_triFaceUVcoArray.clear();
- for(mv= mvert, i=0; i < numverts; mv++, i++) {
+ for (mv= mvert, i=0; i < numverts; mv++, i++) {
*bt++ = mv->co[0]; *bt++ = mv->co[1]; *bt++ = mv->co[2];
}
- for(mf= mface, i=0; i < numpolys; mf++, i++) {
+ for (mf= mface, i=0; i < numpolys; mf++, i++) {
int origi = (index)? index[i]: i;
- if(mf->v4) {
+ if (mf->v4) {
fv_pt= quad_verts;
*poly_index_pt++ = origi;
*poly_index_pt++ = origi;
@@ -1865,7 +1865,7 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
*poly_index_pt++ = origi;
}
- for(; *fv_pt > -1; fv_pt++)
+ for (; *fv_pt > -1; fv_pt++)
*tri_pt++ = (*(&mf->v1 + (*fv_pt)));
}
}
@@ -1882,7 +1882,7 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
float (*transverts)[3]= NULL;
int transverts_tot= 0; /* with deformed meshes - should always be greater then the max orginal index, or we get crashes */
- if(deformer) {
+ if (deformer) {
/* map locations from the deformed array
*
* Could call deformer->Update(); but rely on redraw updating.
@@ -1899,15 +1899,15 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
vector<bool> vert_tag_array(numverts, false);
vector<int> vert_remap_array(numverts, 0);
- for(int p=0; p<numpolys; p++)
+ for (int p=0; p<numpolys; p++)
{
RAS_Polygon* poly= meshobj->GetPolygon(p);
if (poly->IsCollider())
{
- for(i=0; i < poly->VertexCount(); i++)
+ for (i=0; i < poly->VertexCount(); i++)
{
v_orig= poly->GetVertex(i)->getOrigIndex();
- if(vert_tag_array[v_orig]==false)
+ if (vert_tag_array[v_orig]==false)
{
vert_tag_array[v_orig]= true;
vert_remap_array[v_orig]= tot_bt_verts;
@@ -1929,7 +1929,7 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
m_polygonIndexArray.resize(tot_bt_tris);
- for(int p=0; p<numpolys; p++)
+ for (int p=0; p<numpolys; p++)
{
RAS_Polygon* poly= meshobj->GetPolygon(p);
@@ -1938,13 +1938,13 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
/* quad or tri loop */
fv_pt= (poly->VertexCount()==3 ? tri_verts:quad_verts);
- for(; *fv_pt > -1; fv_pt++)
+ for (; *fv_pt > -1; fv_pt++)
{
v_orig= poly->GetVertex(*fv_pt)->getOrigIndex();
- if(vert_tag_array[v_orig])
+ if (vert_tag_array[v_orig])
{
- if(transverts) {
+ if (transverts) {
/* deformed mesh, using RAS_TexVert locations would be too troublesome
* because they are use the gameob as a hash in the material slot */
*bt++ = transverts[v_orig][0];
@@ -1973,19 +1973,19 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
#if 0
/* needs #include <cstdio> */
printf("# vert count %d\n", m_vertexArray.size());
- for(int i=0; i<m_vertexArray.size(); i+=3) {
+ for (int i=0; i<m_vertexArray.size(); i+=3) {
printf("v %.6f %.6f %.6f\n", m_vertexArray[i], m_vertexArray[i+1], m_vertexArray[i+2]);
}
printf("# face count %d\n", m_triFaceArray.size());
- for(int i=0; i<m_triFaceArray.size(); i+=3) {
+ for (int i=0; i<m_triFaceArray.size(); i+=3) {
printf("f %d %d %d\n", m_triFaceArray[i]+1, m_triFaceArray[i+1]+1, m_triFaceArray[i+2]+1);
}
#endif
/* force recreation of the m_unscaledShape.
* If this has multiple users we cant delete */
- if(m_unscaledShape) {
+ if (m_unscaledShape) {
// don't free now so it can re-allocate under the same location and not break pointers.
// DeleteBulletShape(m_unscaledShape);
m_forceReInstance= true;
@@ -2094,7 +2094,7 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape(btScalar margin, b
collisionMeshData->m_weldingThreshold = m_weldingThreshold1;
bool removeDuplicateVertices=true;
// m_vertexArray not in multiple of 3 anymore, use m_triFaceArray
- for(unsigned int i=0; i<m_triFaceArray.size(); i+=3) {
+ for (unsigned int i=0; i<m_triFaceArray.size(); i+=3) {
btScalar *bt = &m_vertexArray[3*m_triFaceArray[i]];
btVector3 v1(bt[0], bt[1], bt[2]);
bt = &m_vertexArray[3*m_triFaceArray[i+1]];
@@ -2119,7 +2119,7 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape(btScalar margin, b
// this shape will be shared and not deleted until shapeInfo is deleted
// for UpdateMesh, reuse the last memory location so instancing wont crash.
- if(m_unscaledShape) {
+ if (m_unscaledShape) {
DeleteBulletShape(m_unscaledShape, false);
m_unscaledShape->~btBvhTriangleMeshShape();
m_unscaledShape = new(m_unscaledShape) btBvhTriangleMeshShape( indexVertexArrays, true, useBvh );
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
index ba9724f34ab..337e8019aa7 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
@@ -1247,7 +1247,7 @@ struct OcclusionBuffer
{
struct WriteOCL
{
- static inline bool Process(btScalar& q,btScalar v) { if(q<v) q=v;return(false); }
+ static inline bool Process(btScalar& q,btScalar v) { if (q<v) q=v;return(false); }
static inline void Occlusion(bool& flag) { flag = true; }
};
struct QueryOCL
@@ -1377,7 +1377,7 @@ struct OcclusionBuffer
// convert polygon to device coordinates
static bool project(btVector4* p,int n)
{
- for(int i=0;i<n;++i)
+ for (int i=0;i<n;++i)
{
p[i][2]=1/p[i][3];
p[i][0]*=p[i][2];
@@ -1394,21 +1394,21 @@ struct OcclusionBuffer
btVector4 pn[2*NP];
int i, j, m, n, ni;
// deal with near clipping
- for(i=0, m=0;i<NP;++i)
+ for (i=0, m=0;i<NP;++i)
{
s[i]=pi[i][2]+pi[i][3];
- if(s[i]<0) m+=1<<i;
+ if (s[i]<0) m+=1<<i;
}
- if(m==((1<<NP)-1))
+ if (m==((1<<NP)-1))
return(0);
- if(m!=0)
+ if (m!=0)
{
- for(i=NP-1,j=0,n=0;j<NP;i=j++)
+ for (i=NP-1,j=0,n=0;j<NP;i=j++)
{
const btVector4& a=pi[i];
const btVector4& b=pi[j];
const btScalar t=s[i]/(a[3]+a[2]-b[3]-b[2]);
- if((t>0)&&(t<1))
+ if ((t>0)&&(t<1))
{
pn[n][0] = a[0]+(b[0]-a[0])*t;
pn[n][1] = a[1]+(b[1]-a[1])*t;
@@ -1416,7 +1416,7 @@ struct OcclusionBuffer
pn[n][3] = a[3]+(b[3]-a[3])*t;
++n;
}
- if(s[j]>0) pn[n++]=b;
+ if (s[j]>0) pn[n++]=b;
}
// ready to test far clipping, start from the modified polygon
pi = pn;
@@ -1427,21 +1427,21 @@ struct OcclusionBuffer
ni = NP;
}
// now deal with far clipping
- for(i=0, m=0;i<ni;++i)
+ for (i=0, m=0;i<ni;++i)
{
s[i]=pi[i][2]-pi[i][3];
- if(s[i]>0) m+=1<<i;
+ if (s[i]>0) m+=1<<i;
}
- if(m==((1<<ni)-1))
+ if (m==((1<<ni)-1))
return(0);
- if(m!=0)
+ if (m!=0)
{
- for(i=ni-1,j=0,n=0;j<ni;i=j++)
+ for (i=ni-1,j=0,n=0;j<ni;i=j++)
{
const btVector4& a=pi[i];
const btVector4& b=pi[j];
const btScalar t=s[i]/(a[2]-a[3]-b[2]+b[3]);
- if((t>0)&&(t<1))
+ if ((t>0)&&(t<1))
{
po[n][0] = a[0]+(b[0]-a[0])*t;
po[n][1] = a[1]+(b[1]-a[1])*t;
@@ -1449,11 +1449,11 @@ struct OcclusionBuffer
po[n][3] = a[3]+(b[3]-a[3])*t;
++n;
}
- if(s[j]<0) po[n++]=b;
+ if (s[j]<0) po[n++]=b;
}
return(n);
}
- for(int i=0;i<ni;++i) po[i]=pi[i];
+ for (int i=0;i<ni;++i) po[i]=pi[i];
return(ni);
}
// write or check a triangle to buffer. a,b,c in device coordinates (-1,+1)
@@ -1465,7 +1465,7 @@ struct OcclusionBuffer
const btScalar minarea)
{
const btScalar a2=btCross(b-a,c-a)[2];
- if((face*a2)<0.f || btFabs(a2)<minarea)
+ if ((face*a2)<0.f || btFabs(a2)<minarea)
return false;
// further down we are normally going to write to the Zbuffer, mark it so
POLICY::Occlusion(m_occlusion);
@@ -1499,15 +1499,15 @@ struct OcclusionBuffer
// degenerated in at most one single pixel
btScalar* scan=&m_buffer[miy*m_sizes[0]+mix];
// use for loop to detect the case where width or height == 0
- for(int iy=miy;iy<mxy;++iy)
+ for (int iy=miy;iy<mxy;++iy)
{
- for(int ix=mix;ix<mxx;++ix)
+ for (int ix=mix;ix<mxx;++ix)
{
- if(POLICY::Process(*scan,z[0]))
+ if (POLICY::Process(*scan,z[0]))
return(true);
- if(POLICY::Process(*scan,z[1]))
+ if (POLICY::Process(*scan,z[1]))
return(true);
- if(POLICY::Process(*scan,z[2]))
+ if (POLICY::Process(*scan,z[2]))
return(true);
}
}
@@ -1537,13 +1537,13 @@ struct OcclusionBuffer
dy[1] = y[0]-y[1];
dy[2] = y[2]-y[0];
btScalar* scan=&m_buffer[miy*m_sizes[0]+mix];
- for(int iy=miy;iy<mxy;++iy)
+ for (int iy=miy;iy<mxy;++iy)
{
- if(dy[0] >= 0 && POLICY::Process(*scan,v[0]))
+ if (dy[0] >= 0 && POLICY::Process(*scan,v[0]))
return(true);
- if(dy[1] >= 0 && POLICY::Process(*scan,v[1]))
+ if (dy[1] >= 0 && POLICY::Process(*scan,v[1]))
return(true);
- if(dy[2] >= 0 && POLICY::Process(*scan,v[2]))
+ if (dy[2] >= 0 && POLICY::Process(*scan,v[2]))
return(true);
scan+=m_sizes[0];
v[0] += dzy[0]; v[1] += dzy[1]; v[2] += dzy[2];
@@ -1574,13 +1574,13 @@ struct OcclusionBuffer
dx[1] = x[0]-x[1];
dx[2] = x[2]-x[0];
btScalar* scan=&m_buffer[miy*m_sizes[0]+mix];
- for(int ix=mix;ix<mxx;++ix)
+ for (int ix=mix;ix<mxx;++ix)
{
- if(dx[0] >= 0 && POLICY::Process(*scan,v[0]))
+ if (dx[0] >= 0 && POLICY::Process(*scan,v[0]))
return(true);
- if(dx[1] >= 0 && POLICY::Process(*scan,v[1]))
+ if (dx[1] >= 0 && POLICY::Process(*scan,v[1]))
return(true);
- if(dx[2] >= 0 && POLICY::Process(*scan,v[2]))
+ if (dx[2] >= 0 && POLICY::Process(*scan,v[2]))
return(true);
scan++;
v[0] += dzx[0]; v[1] += dzx[1]; v[2] += dzx[2];
@@ -1604,13 +1604,13 @@ struct OcclusionBuffer
miy*x[0]+mix*y[2]-x[0]*y[2]-mix*y[0]+x[2]*y[0]-miy*x[2]};
btScalar v=ia*((z[2]*c[0])+(z[0]*c[1])+(z[1]*c[2]));
btScalar* scan=&m_buffer[miy*m_sizes[0]];
- for(int iy=miy;iy<mxy;++iy)
+ for (int iy=miy;iy<mxy;++iy)
{
- for(int ix=mix;ix<mxx;++ix)
+ for (int ix=mix;ix<mxx;++ix)
{
- if((c[0]>=0)&&(c[1]>=0)&&(c[2]>=0))
+ if ((c[0]>=0)&&(c[1]>=0)&&(c[2]>=0))
{
- if(POLICY::Process(scan[ix],v))
+ if (POLICY::Process(scan[ix],v))
return(true);
}
c[0]+=dx[0];c[1]+=dx[1];c[2]+=dx[2];v+=dzx;
@@ -1633,7 +1633,7 @@ struct OcclusionBuffer
if (n)
{
project(o,n);
- for(int i=2;i<n && !earlyexit;++i)
+ for (int i=2;i<n && !earlyexit;++i)
{
earlyexit|=draw<POLICY>(o[0],o[i-1],o[i],face,minarea);
}
@@ -1685,10 +1685,10 @@ struct OcclusionBuffer
transformW(btVector3(c[0]+e[0],c[1]-e[1],c[2]+e[2]),x[5]);
transformW(btVector3(c[0]+e[0],c[1]+e[1],c[2]+e[2]),x[6]);
transformW(btVector3(c[0]-e[0],c[1]+e[1],c[2]+e[2]),x[7]);
- for(int i=0;i<8;++i)
+ for (int i=0;i<8;++i)
{
// the box is clipped, it's probably a large box, don't waste our time to check
- if((x[i][2]+x[i][3])<=0) return(true);
+ if ((x[i][2]+x[i][3])<=0) return(true);
}
static const int d[]={ 1,0,3,2,
4,5,6,7,
@@ -1696,13 +1696,13 @@ struct OcclusionBuffer
6,5,1,2,
7,6,2,3,
5,4,0,1};
- for(unsigned int i=0;i<(sizeof(d)/sizeof(d[0]));)
+ for (unsigned int i=0;i<(sizeof(d)/sizeof(d[0]));)
{
const btVector4 p[]={ x[d[i++]],
x[d[i++]],
x[d[i++]],
x[d[i++]]};
- if(clipDraw<4,QueryOCL>(p,1.f,0.f))
+ if (clipDraw<4,QueryOCL>(p,1.f,0.f))
return(true);
}
return(false);
@@ -2008,7 +2008,7 @@ void CcdPhysicsEnvironment::setConstraintParam(int constraintId,int param,float
{
//param = 3,4,5 are constraint limits, high limit values
btConeTwistConstraint* coneTwist = (btConeTwistConstraint*)typedConstraint;
- if(value1<0.0f)
+ if (value1<0.0f)
coneTwist->setLimit(param,btScalar(BT_LARGE_FLOAT));
else
coneTwist->setLimit(param,value1);