コード例 #1
0
void ModelExporter::processNodes()
{
	AABB bounds = calculateModelBounds();

	if (_centerObjects)
	{
		// Depending on the center point, we need to use the object bounds
		// or just the translation towards the user-defined origin, ignoring bounds
		_centerTransform = _useOriginAsCenter ?
			Matrix4::getTranslation(-_origin) :
			Matrix4::getTranslation(-bounds.origin);
	}

	for (const scene::INodePtr& node : _nodes)
	{
		if (Node_isModel(node))
		{
			model::ModelNodePtr modelNode = Node_getModel(node);

			// Push the geometry into the exporter
			model::IModel& model = modelNode->getIModel();

			Matrix4 exportTransform = node->localToWorld().getPremultipliedBy(_centerTransform);

			for (int s = 0; s < model.getSurfaceCount(); ++s)
			{
				const model::IModelSurface& surface = model.getSurface(s);

				if (isExportableMaterial(surface.getActiveMaterial()))
				{
					_exporter->addSurface(surface, exportTransform);
				}
			}
		}
		else if (Node_isBrush(node))
		{
			processBrush(node);
		}
		else if (Node_isPatch(node))
		{
			processPatch(node);
		}
		else if (_exportLightsAsObjects && Node_getLightNode(node))
		{
			processLight(node);
		}
	}
}
コード例 #2
0
ファイル: resource_audio.cpp プロジェクト: Tkachov/scummvm
void ResourceManager::addNewGMPatch(SciGameId gameId) {
	Common::String gmPatchFile;

	switch (gameId) {
	case GID_ECOQUEST:
		gmPatchFile = "ECO1GM.PAT";
		break;
	case GID_HOYLE3:
		gmPatchFile = "HOY3GM.PAT";
		break;
	case GID_LSL1:
		gmPatchFile = "LL1_GM.PAT";
		break;
	case GID_LSL5:
		gmPatchFile = "LL5_GM.PAT";
		break;
	case GID_LONGBOW:
		gmPatchFile = "ROBNGM.PAT";
		break;
	case GID_SQ1:
		gmPatchFile = "SQ1_GM.PAT";
		break;
	case GID_SQ4:
		gmPatchFile = "SQ4_GM.PAT";
		break;
	case GID_FAIRYTALES:
		gmPatchFile = "TALEGM.PAT";
		break;
	default:
		break;
	}

	if (!gmPatchFile.empty() && Common::File::exists(gmPatchFile)) {
		ResourceSource *psrcPatch = new PatchResourceSource(gmPatchFile);
		processPatch(psrcPatch, kResourceTypePatch, 4);
	}
}
コード例 #3
0
ファイル: dop_prf.c プロジェクト: DavinSimmons/ASF_MapReady
int main (int argc, char *argv [])
{
/*Structures: these are passed to the sub-routines which need them.*/
    patch *p1,*p2;
    satellite *s;
    rangeRef *r;
    getRec *signalGetRec;
    file *f;
/*Variables.*/
    int n_az,n_range;/*Region to be processed.*/
    int patchNo;/*Loop counter.*/
    double pixShift,dopDel,old_dop;
    int refLen,lineToBeRead;
    int saved_NLA;
    struct ARDOP_PARAMS params,old_params;
    meta_parameters *meta;

    StartWatch();
    if (!quietflag) printf("   Doppler Determination:\n");
    if (logflag) printLog("   Doppler Determination:\n");
    if (!parse_cla(argc,argv,&params,&meta))
      printErr("   ERROR: Usage: dop_prf as ardop\n");

/*Set the initial doppler parameters.*/
    if (!quietflag) printf("   Processing to doppler at %f prf...\n",params.fd);
    if (logflag) {
      sprintf(logbuf,"   Processing to doppler at %f prf...\n",params.fd);
      printLog(logbuf);
    }
    read_params(params.in1,&old_params);/*Read in user's old parameters*/

/*Set params so we're processing at least 300 samples and 500 lines.*/
    refLen=params.fs*params.pulsedur;
    params.nla=smallestPow2(300+refLen)-refLen;
    params.na_valid=500;
    ardop_setup(&params,meta,&n_az,&n_range,&s,&r,&f,&signalGetRec);

    if (!quietflag) {
      printf("   Processing a %d az by %d range patch...\n",n_az,n_range);
      printf("   Of the %d azimuth lines, only %d are valid.\n",n_az,f->n_az_valid);
    }

/*
Create "patch"es of data.
*/
    p1=newPatch(n_az,n_range);
    p2=newPatch(n_az,n_range);

/*Process both patches.*/
    lineToBeRead = f->firstLineToProcess;

    ac_direction=-1;
    setPatchLoc(p1,s,f->skipFile,f->skipSamp,lineToBeRead);/*Update patch parameters for location.*/
    processPatch(p1,signalGetRec,r,s);/*SAR Process patch.*/

    ac_direction=1;
    setPatchLoc(p2,s,f->skipFile,f->skipSamp,lineToBeRead);/*Update patch parameters for location.*/
    processPatch(p2,signalGetRec,r,s);/*SAR Process patch.*/

/*Do range amplitude correlation.*/
    pixShift=amp_corr(p1,p2,f);
    StopWatch();

    dopDel=2*pixShift*f->rngpix/(s->wavl*s->refPerRange/2*(p1->slantToFirst+p1->slantPer*p1->n_range/2));
    if (!quietflag) printf("   The image's doppler is off by %.2f pixels, or %.2f PRF.\n",
                           pixShift,dopDel);
    if (logflag) {
      sprintf(logbuf,"   The image's doppler is off by %.2f pixels, or %.2f PRF.\n",
        pixShift,dopDel);
      printLog(logbuf);
    }

    /*dopDel-=0.2; <-- Constant frequency offset?*/
    dopDel=floor(dopDel+0.5);

    if (!quietflag) printf("   The doppler coefficients should be:\n"
                           "   %.10f %.10f %.10f\n\n",s->orig_fd-dopDel,s->orig_fdd,s->orig_fddd);
    if (!quietflag) printf("   These coefficients have been written into '%s'\n",appendExt(params.in1,".in"));
    if (logflag) {
      sprintf(logbuf,"   The doppler coefficients should be:\n"
              "   %.10f %.10f %.10f\n\n",s->orig_fd-dopDel,s->orig_fdd,s->orig_fddd);
      printLog(logbuf);
      sprintf(logbuf,"   These coefficients have been written into '%s'\n",appendExt(params.in1,".in"));
      printLog(logbuf);
    }

    old_params.fd=s->orig_fd-dopDel;
    old_params.fdd=s->orig_fdd;
    old_params.fddd=s->orig_fddd;

    print_params(params.in1,&old_params,"dop_prf");

    destroyPatch(p1);
    destroyPatch(p2);

    return(0);
}