engine/particle/src/test/test_particle.cpp
/**
* Verify particle rotation using static angular velocity.
*/
Verify particle rotation using static angular velocity.
Verify particle rotation using static angular velocity .
TEST_F(ParticleTest, ParticleAngularVelocity)
{
    float dt = 1.0f;
    ASSERT_TRUE(LoadPrototype("angular_velocity.particlefxc", &m_Prototype));
    dmParticle::HInstance instance = dmParticle::CreateInstance(m_Context, m_Prototype, 0x0);
    dmParticle::Emitter* e = GetEmitter(m_Context, instance, 0);
    dmParticle::StartInstance(m_Context, instance);
    dmParticle::Update(m_Context, dt, 0x0);
    Quat q = e->m_Particles[0].GetRotation();
    Vector3 r = dmVMath::QuatToEuler(q.getX(), q.getY(), q.getZ(), q.getW());
    ASSERT_EQ(0.0f, r.getX());
    ASSERT_EQ(0.0f, r.getY());
    ASSERT_EQ(90.0f, r.getZ());
    dmParticle::Update(m_Context, dt, 0x0);
    q = e->m_Particles[0].GetRotation();
    r = dmVMath::QuatToEuler(q.getX(), q.getY(), q.getZ(), q.getW());
    ASSERT_EQ(0.0f, r.getX());
    ASSERT_EQ(0.0f, r.getY());
    ASSERT_EQ(180.0f, r.getZ());
    dmParticle::DestroyInstance(m_Context, instance);
}
TEST_F ( ParticleTest , ParticleAngularVelocity ) { float dt = 1.0f ; ASSERT_TRUE ( LoadPrototype ( " " , & m_Prototype ) ) ; dmParticle :: HInstance instance = dmParticle :: CreateInstance ( m_Context , m_Prototype , 0x0 ) ; dmParticle :: Emitter * e = GetEmitter ( m_Context , instance , 0 ) ; dmParticle :: StartInstance ( m_Context , instance ) ; dmParticle :: Update ( m_Context , dt , 0x0 ) ; Quat q = e -> m_Particles [ 0 ] . GetRotation ( ) ; Vector3 r = dmVMath :: QuatToEuler ( q . getX ( ) , q . getY ( ) , q . getZ ( ) , q . getW ( ) ) ; ASSERT_EQ ( 0.0f , r . getX ( ) ) ; ASSERT_EQ ( 0.0f , r . getY ( ) ) ; ASSERT_EQ ( 90.0f , r . getZ ( ) ) ; dmParticle :: Update ( m_Context , dt , 0x0 ) ; q = e -> m_Particles [ 0 ] . GetRotation ( ) ; r = dmVMath :: QuatToEuler ( q . getX ( ) , q . getY ( ) , q . getZ ( ) , q . getW ( ) ) ; ASSERT_EQ ( 0.0f , r . getX ( ) ) ; ASSERT_EQ ( 0.0f , r . getY ( ) ) ; ASSERT_EQ ( 180.0f , r . getZ ( ) ) ; dmParticle :: DestroyInstance ( m_Context , instance ) ; }
Verify particle rotation using static angular velocity.
Verify particle rotation using static angular velocity .