本文整理汇总了C++中Content::die方法的典型用法代码示例。如果您正苦于以下问题:C++ Content::die方法的具体用法?C++ Content::die怎么用?C++ Content::die使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Content
的用法示例。
在下文中一共展示了Content::die方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: randFloat
void Path2dApp::update(){
//cout<<thread.mPoints.size()<<endl;
//cout<<(float)app::getFrameRate()<<endl;
if(frameCount % 30 == 0){
//float xPos = lerp( windowWidth, 0, pow(0,windowWidth+ 20));
//float xPos = randFloat(windowWidth-20,windowWidth+20);
float xPos = randFloat(windowWidth, windowWidth+200);
controller->addParticles(NUM_PARTICLES_PER_FRAME, Vec2f(xPos,randFloat(windowHeight*3/8,windowHeight*5/8)), Vec2f(randFloat(),randFloat()));
}
thread.update();
if(frameCount == 0 || frameCount % 620 == 0){
Content *c = new Content(Vec3f(windowWidth+200,randFloat(windowHeight*3/8, windowHeight*5/8),randFloat(-1.0,-1.0)),postIndex);
mContents.push_back(c);
postIndex ++;
if(postIndex>6) postIndex = 0;
}
frameCount ++;
for(std::list<Content*>::iterator i = mContents.begin(); i!= mContents.end();){
Content *c = (*i);
if(c->die()){
i = mContents.erase(i);
delete c;
}else{
Vec2f steer = c->seek(thread.mPoints);
c->addForce(steer);
c->update();
++i;
}
}
double currentTime = app::getElapsedSeconds();
double deltaTime = currentTime - mLastTime;
float delta = (float)app::getFrameRate() / (1.0 / deltaTime);
mLastTime = currentTime;
this->controller->update(delta, mPerlin, thread.mPoints);
}