当前位置: 首页>>代码示例>>C++>>正文


C++ setParam函数代码示例

本文整理汇总了C++中setParam函数的典型用法代码示例。如果您正苦于以下问题:C++ setParam函数的具体用法?C++ setParam怎么用?C++ setParam使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setParam函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: glClearColor

void Renderer::startRender() {
  renderdt_ = Clock::secondsSince(lastRender_);
  lastRender_ = Clock::now();

  renderdt_ *= timeMultiplier_;

  gameTime_ += renderdt_;

  glClearColor(0.f, 0.f, 0.f, 0.f);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

  glEnable(GL_DEPTH_TEST);
  glEnable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

  // Set up matrices
  float aspect = resolution_.x / resolution_.y;
  float fov = 60.f;
  getProjectionStack().clear();
  getProjectionStack().current() = glm::perspective(fov, aspect, 0.1f, 100.f);
  getViewStack().clear();
  getViewStack().current() = camera_.calculateViewMatrix();

  // Set up lights
  // TODO(zack): read light pos from map config
  auto lightPos = applyMatrix(getViewStack().current(), glm::vec3(-5, -5, 10));
  setParam("renderer.lightPos", lightPos);
  setParam("renderer.light.ambient", glm::vec3(0.1f));
  setParam("renderer.light.diffuse", glm::vec3(1.f));
  setParam("renderer.light.specular", glm::vec3(1.f));
}
开发者ID:zackgomez,项目名称:rts,代码行数:31,代码来源:Renderer.cpp

示例2: setParam

bool ConditionDamage::addDamage(int32_t rounds, int32_t time, int32_t value)
{
	if(rounds == -1) //periodic damage
	{
		setParam(CONDITIONPARAM_TICKINTERVAL, time);
		setParam(CONDITIONPARAM_TICKS, -1);

		periodDamage = value;
		return true;
	}

	if(periodDamage > 0)
		return false;

	//rounds, time, damage
	for(int32_t i = 0; i < rounds; ++i)
	{
		IntervalInfo damageInfo;
		damageInfo.interval = time;
		damageInfo.timeLeft = time;
		damageInfo.value = value;

		damageList.push_back(damageInfo);
		if(getTicks() != -1)
			setTicks(getTicks() + damageInfo.interval);
	}

	return true;
}
开发者ID:Codex-NG,项目名称:thecrystalserver,代码行数:29,代码来源:condition.cpp

示例3: setParam

bool ConditionDamage::addDamage(int32_t rounds, int32_t time, int32_t value)
{
	time = std::max<int32_t>(time, EVENT_CREATURE_THINK_INTERVAL);
	if (rounds == -1) {
		//periodic damage
		periodDamage = value;
		setParam(CONDITION_PARAM_TICKINTERVAL, time);
		setParam(CONDITION_PARAM_TICKS, -1);
		return true;
	}

	if (periodDamage > 0) {
		return false;
	}

	//rounds, time, damage
	for (int32_t i = 0; i < rounds; ++i) {
		IntervalInfo damageInfo;
		damageInfo.interval = time;
		damageInfo.timeLeft = time;
		damageInfo.value = value;

		damageList.push_back(damageInfo);

		if (ticks != -1) {
			setTicks(ticks + damageInfo.interval);
		}
	}

	return true;
}
开发者ID:DevelopersPL,项目名称:forgottenserver,代码行数:31,代码来源:condition.cpp

示例4: SeafileApiRequest

GetLatestVersionRequest::GetLatestVersionRequest(const QString& client_id,
                                                 const QString& client_version)
    : SeafileApiRequest(QUrl(kLatestVersionUrl), SeafileApiRequest::METHOD_GET)
{
    setParam("id", client_id.left(8));
    setParam("v", QString(kOsName) + "-" + client_version);
}
开发者ID:PhantomMatthew,项目名称:seafile-client,代码行数:7,代码来源:requests.cpp

示例5: setParam

MLProcDelayOutput::MLProcDelayOutput()
{
	setParam("order", 0);
	setParam("backwards", 0);
	mpDelayInputProc = 0;
	mReadIndex = 0;
	mLengthMask = 0;
}
开发者ID:EQ4,项目名称:madronalib,代码行数:8,代码来源:MLProcDelayOutput.cpp

示例6: setParam

MLProcMatrix::MLProcMatrix()
{
	setParam("in", 0.);
	setParam("out", 0.);
    mInputs = mOutputs = 0;
//	debug() << "MLProcMatrix constructor\n";
	clearConnections();
}
开发者ID:EQ4,项目名称:madronalib,代码行数:8,代码来源:MLProcMatrix.cpp

示例7: setParam

MLProcRingBuffer::MLProcRingBuffer()
{
	// defaults
	// TODO set from component->engine.
	//  will want downsampling for viewing when running at 96k or higher...
	setParam("length", kMLRingBufferDefaultSize);	
	setParam("mode", eMLRingBufferNoTrash);
	mTrig1 = -1.f;
}
开发者ID:EQ4,项目名称:madronalib,代码行数:9,代码来源:MLProcRingBuffer.cpp

示例8: setParam

void
Sinful::setNoUDP(bool flag)
{
	if( !flag ) {
		setParam("noUDP",NULL);
	}
	else {
		setParam("noUDP","");
	}
}
开发者ID:AlainRoy,项目名称:htcondor,代码行数:10,代码来源:condor_sinful.cpp

示例9: isCGATT

bool GPRSHTTP::init(int timeout)
{
    if(timeout > 1000 || timeout < 30)
    {
        _error_condition = SIM900_ERROR_INVALID_HTTP_TIMEOUT;
        if(SIM900_DEBUG_OUTPUT)
        {
            SIM900_DEBUG_OUTPUT_STREAM->println(get_error_message(SIM900_ERROR_INVALID_HTTP_TIMEOUT));
        }
        return false;
    }
    int connected = isCGATT();
    if(connected == -1)
    {
        return false;
    }
    delay(1000);

    if(connected == 1) {
        stopBearer(1, 0);
    }

    if(!startBearer(5, 2000))
    {
        return false;
    }

    initialized = HTTPINIT(5, 2000);
    if(!initialized)
    {
        return false;
    }

    //Set the CID
    if(!setParam("CID", _cid))
    {
        return false;
    }

    //Set the URL
    if(!setParam("URL", url))
    {
        return false;
    }

    //Set the HTTP Timeout
    if(!setParam("TIMEOUT", timeout))
    {
        return false;
    }

    Serial.print("URL: ");
    Serial.println(url);
    return true;
}
开发者ID:andremroch,项目名称:Sim900,代码行数:55,代码来源:Sim900.cpp

示例10: AnaEField

//------------------------------------//
// Main
//------------------------------------//
void AnaEField()
{

  // Make Canvas 
  TCanvas* can = makeCanvas("can");
  can->SetLogy();
  can->SetGridx();
  can->SetGridy();

  // Define the function here with parameters:
  // [0] = L
  // [1] = freq
  // [2] = k
  // [3] = n
  // [4] = sqrt(2pi) * mu * mu0
  TString func = "[4]*[0]*[1]*sin(x/57.2957)*exp(-pow([2]*[0],2)*pow(cos(x/57.2957)-1/[3],2)/2)";
  //TString func = "[4]*[1]*sin(x/57.2957)*exp(-pow([2]*[0],2)*pow(cos(x/57.2957)-1/[3],2)/2)";
  //TString func = "[4]*[0]*[1]*exp(-pow([2]*[0],2)*pow(cos(x/57.2957)-1/[3],2)/2)";

  // Now fix some of the variables:
  double freq = 1e9; //600e6; // Hz
  double c    = 3e8;   // m/s
  double n    = 1.3; //1.78;
  double k    = 2*TMath::Pi() * n * freq/c; // 1/m
  double Const= sqrt(2*TMath::Pi()) * 4 * TMath::Pi() * 1e-7 * 1;

  // Make a dummy histogram
  TH1F* h = makeHist("h",100,0,90,"Angle [deg]", "Field Strength",kBlack,0);
  h->Fill(1e10);
  h->SetMinimum(10);
  h->SetMaximum(3000);
  h->Draw();

  // Make two instances of the function
  TF1* f0 = new TF1("f0",func.Data(),0,90);
  setParam(f0,1.2,freq,k,n,Const,kBlack);

  TF1* f1 = new TF1("f1",func.Data(),0,90);
  setParam(f1,0.1,freq,k,n,Const,kBlue);
 
  // Draw
  f0->Draw("same");
  f1->Draw("same");
  
  // Add Legend
  TLegend* leg = makeLegend(0.15,0.3,0.7,0.9);
  leg->SetHeader("f = 600 MHz");
  leg->AddEntry(f0,"L = 1.2m","l");
  leg->AddEntry(f1,"L = 0.1m","l");
  leg->Draw("same");
  
  //can->SaveAs("../plots/quickAnalytic_600MHz.png");

}
开发者ID:mrelich,项目名称:Simulation,代码行数:57,代码来源:AnaEField.C

示例11: Material

  Material()
  {
    _ambient = (GLfloat*)malloc(sizeof(GLfloat)*4);
    _diffuse = (GLfloat*)malloc(sizeof(GLfloat)*4);;
    _specular = (GLfloat*)malloc(sizeof(GLfloat)*4);
    _emission = (GLfloat*)malloc(sizeof(GLfloat)*4);    

    setParam(AMBIENT, 0.0, 0.0, 0.0, 1.0);
    setParam(DIFFUSE, 0.0, 0.0, 0.0, 1.0);
    setParam(SPECULAR, 0.0, 0.0, 0.0, 1.0);
    setParam(EMISSION, 0.1, 0.1, 0.1, 1.0);
    _shininess = 0.0;
  }
开发者ID:ejaury,项目名称:eece478---OpenGL-based-3D-Model-of-UBC-Campus,代码行数:13,代码来源:Material.hpp

示例12: setParam

void APGSeeker::loadDefaults()
{
    APSequentialSeeker::loadDefaults();

    setParam("windowSize", 200);
    setParam("minDurationToBeConsidered", param("windowSize"));
    setParam("duration", transformSecondsToNumberOfPoints(/*8*/20));
    setParam("allowedDistance", transformSecondsToNumberOfPoints(2));
    setParam("peakWindowSize", 16);

    //	setParam("needsCleanUp", false);
    //	setParam("needsLog", true);
}
开发者ID:franciscoadasme,项目名称:a2epg,代码行数:13,代码来源:apgseeker.cpp

示例13: setParam

/**
 * Set program version.
 */
    void
OptionAgent::prepareVersion()
{
#ifdef VERSION
    setParam("version", VERSION);
#else
    setParam("version", "0.0.1");
#endif
#ifdef PACKAGE
    setParam("package", PACKAGE);
#else
    setParam("package", "A game");
#endif
}
开发者ID:FishFilletsNG,项目名称:ffng-android,代码行数:17,代码来源:OptionAgent.cpp

示例14: configBase

void LCGWSpinBBHNR1::config(ezxml_t xmlbloc)
{
	//! *** Read sky position, polarization and name
	configBase(xmlbloc);
	
	//! ** Reset declination to compute quantities related to sky position 
	setParam(0, Beta);
	
	
	ezxml_t param;
	for(param = ezxml_child(xmlbloc,"Param"); param; param = param->next){
		
		//! *** Read ecliptic lattitude 
		if(MT->wcmp(ezxml_attr(param,"Name"),"EclipticLatitude"))
			setParam(0, MT->gXMLAngle(param));
		
		//! *** Read ecliptic colattitude 
		if(MT->wcmp(ezxml_attr(param,"Name"),"EclipticColatitude"))
			setParam(0, M_PI/2. - MT->gXMLAngle(param));
		
		//! *** Read ecliptic longitude
		if(MT->wcmp(ezxml_attr(param,"Name"),"EclipticLongitude"))
			setParam(1, MT->gXMLAngle(param));
		
		//! *** Read polarization
		if(MT->wcmp(ezxml_attr(param,"Name"),"Polarization"))
			setParam(2, MT->gXMLAngle(param));
		
		
		if(MT->wcmp(ezxml_attr(param,"Name"),"TotalMass"))
			setParam(3, MT->gXMLAstroMass(param) );
		
		if(MT->wcmp(ezxml_attr(param,"Name"),"CoalescenceTime"))
			setParam(4, MT->gXMLTime(param) );
		
		if(MT->wcmp(ezxml_attr(param,"Name"),"Distance"))
			setParam(5, MT->gXMLAstroDistance(param) );
		
		if(MT->wcmp(ezxml_attr(param,"Name"),"PolarAngleTotalMomentuminSBB"))
			setParam(6, MT->gXMLAngle(param) );
		
		if(MT->wcmp(ezxml_attr(param,"Name"),"AzimuthalAngleTotalMomentuminSBB"))
			setParam(7, MT->gXMLAngle(param) );
		
		//if(MT->wcmp(ezxml_attr(param,"Name"),"FileName"))
		//	MT->stripcopy((*param).txt,NRFileName);
		
	}
}
开发者ID:gabrimaine,项目名称:eLISA,代码行数:49,代码来源:LISACODE-GWSpinBBHNR1.cpp

示例15: main

int
main( int argc, char *argv[] )
{
    BOOL    useProxy = FALSE;
    char    ibID[MAX_USERIDLEN];
    int     numOfClips = 0;
    MyClip  *mp = NULL;

    if ( argc <= 1 ) {
        usage();
        return ( 0 );
    }

    memset( ibID, 0x00, MAX_USERIDLEN );

    if ( argc >= 2 )
        setParam( argc, argv, ibID, &useProxy );

    if ( !(ibID[0]) )
        return ( 0 );

    if ( useProxy )
        setUseProxy( useProxy );

    /* BlogPeople IB へ登録済みのブックマークを取得 */
    mp = getIB( ibID, &numOfClips );
    if ( mp && (numOfClips > 0) ) {
        /*  BlogPeople IB 情報を OPML ファイルへ書き出す */
        outputOPML( mp, numOfClips,
                    "BlogPeople Instant Bookmarks", UTF8, stdout );
        free( mp );
    }

    return ( 1 );
}
开发者ID:tsupo,项目名称:bookey,代码行数:35,代码来源:getBP.c


注:本文中的setParam函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。