void Foam::particle::prepareForParallelTransfer
(
    const label patchi,
    TrackData& td
)
{
    // Convert the face index to be local to the processor patch
    facei_ = patchFace(patchi, facei_);
}
Пример #2
0
Q3BSPLeaf *Q3BSPRep::createLeaf( int n ){
	q3_leaf *q3leaf=(q3_leaf*)header.dir[4].lump+n;

	Q3BSPLeaf *leaf=d_new Q3BSPLeaf;

	leaf->cluster=q3leaf->cluster;

	Vector mins( q3leaf->mins[0],q3leaf->mins[1],q3leaf->mins[2] );
	Vector maxs( q3leaf->maxs[0],q3leaf->maxs[1],q3leaf->maxs[2] );
	leaf->box=Box( tf(mins) );
	leaf->box.update( tf(maxs) );
	int *leaffaces=(int*)header.dir[5].lump+q3leaf->leafface;

	for( int k=0;k<q3leaf->n_leaffaces;++k ){

		int face_n=leaffaces[k];

		map<int,Q3BSPFace*>::const_iterator it=q3face_map.find(face_n);
		if( it!=q3face_map.end() ){
			if( it->second ) leaf->faces.push_back( it->second );
			continue;
		}

		q3_face *q3face=(q3_face*)header.dir[13].lump+leaffaces[k];

		if( q3face->type==1 || q3face->type==3 ){
			if( !q3face->n_meshverts || (q3face->n_meshverts%3) ) continue;
		}else if( q3face->type!=2 ) continue;

		bool draw=true,solid=true;

		if( q3face->texture>=0 ){
			q3_tex *q3tex=(q3_tex*)header.dir[1].lump+q3face->texture;
			if( !(q3tex->contents & 1) ) continue;
			if( q3tex->flags & 0x84 ) draw=false;
		}

		if( !draw && !solid ) continue;

		Q3BSPFace *face=0;
		if( draw ){
			Surf *surf=findSurf( q3face );
			face=d_new Q3BSPFace;
			face->t_surf=surf;
			face->vert=surf->verts.size();
			face->tri=surf->tris.size();
			face->n_verts=face->n_tris=0;
			leaf->faces.push_back( face );
			faces.push_back( face );
			q3face_map.insert( make_pair( face_n,face ) );
		}

		if( q3face->type==2 ){
			patchFace( face,q3face,draw,solid,1 );
		}else{
			meshFace( face,q3face,draw,solid );
		}
	}

	return leaf;
}