MCPcopy Create free account
hub / github.com/defold/defold / DEF3121_EventCallback

Function DEF3121_EventCallback

engine/rig/src/test/test_rig.cpp:1924–1931  ·  view source on GitHub ↗

DEF-3121 - Starting new animation from inside a "animation completed callback" would previously use the wrong animation for one frame. In the test we register a "completion callback", play one animation forward once, then play another animation once the callback is triggered. We test that the root bone is on the expected position after each animation.

Source from the content-addressed store, hash-verified

1922// animation once the callback is triggered. We test that the root bone is on the expected position
1923// after each animation.
1924static void DEF3121_EventCallback(dmRig::RigEventType event_type, void* event_data, void* user_data1, void* user_data2)
1925{
1926 ASSERT_EQ(dmRig::RIG_EVENT_TYPE_COMPLETED, event_type);
1927 dmRig::HRigInstance instance = *(dmRig::HRigInstance*)user_data1;
1928 ASSERT_NE((dmRig::HRigInstance)0x0, instance);
1929
1930 ASSERT_EQ(dmRig::RESULT_OK, dmRig::PlayAnimation(instance, dmHashString64("trans_rot"), dmRig::PLAYBACK_ONCE_FORWARD, 0.0f, 0.0f, 1.0f));
1931}
1932
1933TEST_F(RigContextTest, DEF_3121)
1934{

Callers

nothing calls this directly

Calls 1

PlayAnimationFunction · 0.50

Tested by

no test coverage detected