engine/particle/src/test/test_particle.cpp
/**
 * Verify that particles are scaled with the instance
 */
Verify that particles are scaled with the instance
Verify that particles are scaled with the instance
TEST_F(ParticleTest, ParticleInstanceScale)
{
    float dt = 1.0f;
    ASSERT_TRUE(LoadPrototype("instance_scale.particlefxc", &m_Prototype));
    dmParticle::HInstance instance = dmParticle::CreateInstance(m_Context, m_Prototype, 0x0);
    dmParticle::SetScale(m_Context, instance, 2.0f);
    dmParticle::StartInstance(m_Context, instance);
    dmParticle::Update(m_Context, dt, 0x0);
    dmParticle::Emitter* e = GetEmitter(m_Context, instance, 0);
    dmParticle::Particle* p = &e->m_Particles[0];
    ASSERT_EQ(2.0f, minElem(p->GetScale()) * p->GetSourceSize());
    dmParticle::DestroyInstance(m_Context, instance);
}
TEST_F ( ParticleTest , ParticleInstanceScale ) { float dt = 1.0f ; ASSERT_TRUE ( LoadPrototype ( " " , & m_Prototype ) ) ; dmParticle :: HInstance instance = dmParticle :: CreateInstance ( m_Context , m_Prototype , 0x0 ) ; dmParticle :: SetScale ( m_Context , instance , 2.0f ) ; dmParticle :: StartInstance ( m_Context , instance ) ; dmParticle :: Update ( m_Context , dt , 0x0 ) ; dmParticle :: Emitter * e = GetEmitter ( m_Context , instance , 0 ) ; dmParticle :: Particle * p = & e -> m_Particles [ 0 ] ; ASSERT_EQ ( 2.0f , minElem ( p -> GetScale ( ) ) * p -> GetSourceSize ( ) ) ; dmParticle :: DestroyInstance ( m_Context , instance ) ; }
Verify that particles are scaled with the instance
Verify that particles are scaled with the instance