void bhkCapsuleObject::BuildMesh(TimeValue t)
{
   int segs = 12;
   int hsegs = 1;
   int smooth = 1;

   // Start the validity interval at forever and widdle it down.
   //FixHeight(pblock,t,(pmapParam?pmapParam->GetHWnd():NULL),increate);
   ivalid = FOREVER;

   float radius1, radius2, length;
   pblock2->GetValue(PB_RADIUS1,t,radius1,ivalid);
   pblock2->GetValue(PB_RADIUS2,t,radius2,ivalid);
   pblock2->GetValue(PB_LENGTH,t,length,ivalid);
   if (radius2 == 0.0f) radius2 = radius1;

   if (radius1 == 0.0f)
   {
      mesh.setNumVerts(0);
      mesh.setNumFaces(0);
      mesh.setNumTVerts(0);
      mesh.setNumTVFaces(0);
      mesh.setSmoothFlags(smooth != 0);
   }
   else
   {
      BuildScubaMesh(mesh, segs, smooth, hsegs, radius2*bhkScaleFactor, radius1*bhkScaleFactor, length*bhkScaleFactor);
   }
}
Example #2
0
void ScubaObject::BuildMesh(TimeValue t)
	{	
	int segs, smooth, hsegs;
	float radius,height,pie1, pie2,r2;
	int doPie, genUVs,con;	

	// Start the validity interval at forever and widdle it down.
    FixHeight(pblock,t,(pmapParam?pmapParam->GetHWnd():NULL),increate);
	ivalid = FOREVER;
	
	pblock->GetValue(PB_RADIUS,t,radius,ivalid);
	pblock->GetValue(PB_CENTERS,t,con,ivalid);
	pblock->GetValue(PB_HEIGHT,t,height,ivalid);
	r2=2.0f*radius;
	if (con) height+=(height<0.0f?-r2:r2);
	pblock->GetValue(PB_SIDES,t,segs,ivalid);
	pblock->GetValue(PB_HSEGS,t,hsegs,ivalid);
	pblock->GetValue(PB_SMOOTHON,t,smooth,ivalid);	
	pblock->GetValue(PB_SLICEFROM,t,pie1,ivalid);
	pblock->GetValue(PB_SLICETO,t,pie2,ivalid);	
	pblock->GetValue(PB_SLICEON,t,doPie,ivalid);	
	pblock->GetValue(PB_GENUVS,t,genUVs,ivalid);	
	LimitValue(radius, MIN_RADIUS, MAX_RADIUS);
	LimitValue(height, MIN_HEIGHT, MAX_HEIGHT);
	LimitValue(hsegs, MIN_SEGMENTS, MAX_SEGMENTS);
	LimitValue(segs, MIN_SIDES, MAX_SIDES);
	LimitValue(smooth, 0, 1);	
				//        sides, smooth, 			  cylrad  
	BuildScubaMesh(mesh, segs, smooth, hsegs, doPie,radius, height, pie1, pie2, genUVs, GetUsePhysicalScaleUVs());
	}