本文整理汇总了C++中ParticleEmitter::SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleEmitter::SetPosition方法的具体用法?C++ ParticleEmitter::SetPosition怎么用?C++ ParticleEmitter::SetPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleEmitter
的用法示例。
在下文中一共展示了ParticleEmitter::SetPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeThrust
void PlaneModel::MakeThrust(){
//########################################################################################
//Left afterburner
if(1){
ParticleEmitter* pe = new ParticleEmitter(vec3(0,0,-1));
pe->SetPosition(vec3(-0.5f,-0.1f,-2.4));
AddChild("left-afterburner", pe);
}
//Right afterburner
if(1){
ParticleEmitter* pe = new ParticleEmitter(vec3(0,0,-1));
pe->SetPosition(vec3(0.5f,-0.1f,-2.4));
AddChild("right-afterburner", pe);
}
//Light ---------------------------------------------
if(1){
mLightModel = new LightModel();
AddChild(mLightModel);
mLightModel->SetPosition(vec3(0,0.5f,-2.5f));
mLightModel->SetIntensities(4.2f*vec3(1,0.6f,0.4f));
mLightModel->SetIsDirectional(1);
mLightModel->SetAttenuation(0.05f);
mLightModel->SetAmbientCoefficient(0.0f);
}
//Cast Darkness
if(1){
LightModel* lm = new LightModel();
lm->SetPosition(vec3(0,0.0f,-1.5f));
lm->SetIntensities(-1.2f*vec3(1,0.6f,0.4f));
lm->SetIsDirectional(1);
lm->SetAttenuation(0.2f);
lm->SetAmbientCoefficient(0.0f);
//mLightModel->SetConeAngle(45);
//mLightModel->SetConeDirection(vec3(0,0,-1));//relative to world
AddChild(lm);
}
//*/
}
示例2: GetObjectPointer
RESULT
ParticleManager::SetPosition( IN HParticleEmitter hParticleEmitter, const vec3& position )
{
RESULT rval = S_OK;
ParticleEmitter* pParticleEmitter = GetObjectPointer(hParticleEmitter);
if (!pParticleEmitter)
{
RETAILMSG(ZONE_ERROR, "ERROR: ParticleManager::SetPosition( 0x%x ): invalid ParticleEmitter", (UINT32)hParticleEmitter);
rval = E_INVALID_ARG;
goto Exit;
}
CHR(pParticleEmitter->SetPosition( position ));
Exit:
return rval;
}
示例3:
RenderObject * ParticleEmitter3D::Clone(RenderObject *newObject)
{
if(!newObject)
{
DVASSERT_MSG(IsPointerToExactClass<ParticleEmitter3D>(this), "Can clone only ParticleEmitter3D");
newObject = new ParticleEmitter3D();
}
else
{
CleanupLayers();
ReleaseFromCache(static_cast<ParticleEmitter *>(newObject)->emitterFileName);
}
ParticleEmitter* clonedEmitter = static_cast<ParticleEmitter*>(newObject);
clonedEmitter->SetConfigPath(this->configPath);
clonedEmitter->SetPosition(this->position);
clonedEmitter->SetAngle(this->angle);
clonedEmitter->SetLifeTime(this->lifeTime);
clonedEmitter->SetRepeatCount(this->repeatCount);
clonedEmitter->SetTime(this->time);
clonedEmitter->SetEmitPointsCount(this->emitPointsCount);
clonedEmitter->SetPaused(this->isPaused);
clonedEmitter->SetAutoRestart(this->isAutorestart);
clonedEmitter->SetParticlesFollow(this->particlesFollow);
clonedEmitter->Set3D(this->is3D);
clonedEmitter->SetPlaybackSpeed(this->playbackSpeed);
clonedEmitter->SetInitialTranslationVector(this->initialTranslationVector);
if (this->emissionVector)
{
clonedEmitter->emissionVector = this->emissionVector->Clone();
clonedEmitter->emissionVector->Release();
}
if (this->emissionAngle)
{
clonedEmitter->emissionAngle = this->emissionAngle->Clone();
clonedEmitter->emissionAngle->Release();
}
if (this->emissionRange)
{
clonedEmitter->emissionRange = this->emissionRange->Clone();
clonedEmitter->emissionRange->Release();
}
if (this->radius)
{
clonedEmitter->radius = this->radius->Clone();
clonedEmitter->radius->Release();
}
if (this->colorOverLife)
{
clonedEmitter->colorOverLife = this->colorOverLife->Clone();
clonedEmitter->colorOverLife->Release();
}
if (this->size)
{
clonedEmitter->size = this->size->Clone();
clonedEmitter->size->Release();
}
clonedEmitter->emitterType = this->emitterType;
clonedEmitter->currentColor = this->currentColor;
clonedEmitter->SetShortEffect(shortEffect);
// Now can add Layers. Need to update their parents.
for (Vector<ParticleLayer*>::iterator iter = this->layers.begin(); iter != this->layers.end();
iter ++)
{
ParticleLayer* clonedLayer = (*iter)->Clone(NULL);
ParticleLayer3D* clonedLayer3D = dynamic_cast<ParticleLayer3D*>(clonedLayer);
if (clonedLayer3D)
{
clonedLayer3D->SetParent(clonedEmitter);
}
clonedEmitter->AddLayer(clonedLayer);
SafeRelease(clonedLayer);
}
time = 0.0f;
repeatCount = 0;
lodLevelLocked = false;
currentLodLevel = desiredLodLevel;
clonedEmitter->emitterFileName = emitterFileName;
RetainInCache(emitterFileName);
return newObject;
}