engine/particle/src/test/test_particle.cpp
/**
 * The emitter has a constant for particle size = 0 and spread +- 1.0
 */
The emitter has a constant for particle size = 0 and spread +- 1.0
The emitter has a constant for particle size = 0 and spread + - 1 . 0
TEST_F(ParticleTest, EvaluateEmitterPropertySpread)
{
    float dt = 1.0f / 8.0f;
    ASSERT_TRUE(LoadPrototype("emitter_spline_spread.particlefxc", &m_Prototype));
    for (uint32_t i = 0; i < 1000; ++i)
    {
        dmParticle::HInstance instance = dmParticle::CreateInstance(m_Context, m_Prototype, 0x0);
        dmParticle::Emitter* emitter = GetEmitter(m_Context, instance, 0);
        dmParticle::StartInstance(m_Context, instance);
        dmParticle::Update(m_Context, dt, 0x0);
        dmParticle::Particle* particle = &emitter->m_Particles[0];
        ASSERT_NE(0.0f, minElem(particle->GetScale()) * particle->GetSourceSize());
        ASSERT_GE(1.0f, dmMath::Abs(minElem(particle->GetScale()) * particle->GetSourceSize()));
        dmParticle::DestroyInstance(m_Context, instance);
    }
}
TEST_F ( ParticleTest , EvaluateEmitterPropertySpread ) { float dt = 1.0f / 8.0f ; ASSERT_TRUE ( LoadPrototype ( " " , & m_Prototype ) ) ; for ( uint32_t i = 0 ; i < 1000 ; ++ i ) { dmParticle :: HInstance instance = dmParticle :: CreateInstance ( m_Context , m_Prototype , 0x0 ) ; dmParticle :: Emitter * emitter = GetEmitter ( m_Context , instance , 0 ) ; dmParticle :: StartInstance ( m_Context , instance ) ; dmParticle :: Update ( m_Context , dt , 0x0 ) ; dmParticle :: Particle * particle = & emitter -> m_Particles [ 0 ] ; ASSERT_NE ( 0.0f , minElem ( particle -> GetScale ( ) ) * particle -> GetSourceSize ( ) ) ; ASSERT_GE ( 1.0f , dmMath :: Abs ( minElem ( particle -> GetScale ( ) ) * particle -> GetSourceSize ( ) ) ) ; dmParticle :: DestroyInstance ( m_Context , instance ) ; } }
The emitter has a constant for particle size = 0 and spread +- 1.0
The emitter has a constant for particle size = 0 and spread + - 1 . 0
// NOTE size could potentially be 0, but not likely