本文整理汇总了C++中CNewParticleEffect::SetControlPointOrientation方法的典型用法代码示例。如果您正苦于以下问题:C++ CNewParticleEffect::SetControlPointOrientation方法的具体用法?C++ CNewParticleEffect::SetControlPointOrientation怎么用?C++ CNewParticleEffect::SetControlPointOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNewParticleEffect
的用法示例。
在下文中一共展示了CNewParticleEffect::SetControlPointOrientation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReplaceWith
//-----------------------------------------------------------------------------
// Bounding box
//-----------------------------------------------------------------------------
CNewParticleEffect* CNewParticleEffect::ReplaceWith( const char *pParticleSystemName )
{
StopEmission( false, true, true );
if ( !pParticleSystemName || !pParticleSystemName[0] )
return NULL;
CNewParticleEffect *pNewEffect = CNewParticleEffect::Create( GetOwner(), pParticleSystemName, pParticleSystemName );
if ( !pNewEffect )
return NULL;
// Copy over the control point data
for ( int i = 0; i < MAX_PARTICLE_CONTROL_POINTS; ++i )
{
if ( !ReadsControlPoint( i ) )
continue;
Vector vecForward, vecRight, vecUp;
pNewEffect->SetControlPoint( i, GetControlPointAtCurrentTime( i ) );
GetControlPointOrientationAtCurrentTime( i, &vecForward, &vecRight, &vecUp );
pNewEffect->SetControlPointOrientation( i, vecForward, vecRight, vecUp );
pNewEffect->SetControlPointParent( i, GetControlPointParent( i ) );
}
if ( m_hOwner )
{
m_hOwner->ParticleProp()->ReplaceParticleEffect( this, pNewEffect );
}
// fixup any other references to the old system, to point to the new system
while( m_References.m_pHead )
{
// this will remove the reference from m_References
m_References.m_pHead->Set( pNewEffect );
}
// At this point any references should have been redirected,
// but we may still be running with some stray particles, so we
// might not be flagged for removal - force the issue!
Assert( m_RefCount == 0 );
SetRemoveFlag();
return pNewEffect;
}