59 {
61
62 fb::SceneT scene;
64
65 ASSERT_EQ(scene.children.size(), 1u);
66 auto& node = scene.nodes[scene.children[0]];
67
70
71 ASSERT_EQ(node->mesh_primitives.size(), 0u);
72 ASSERT_EQ(node->children.size(), 2u);
73
74
75
76 auto& skinned_node = scene.nodes[node->children[0]];
77 ASSERT_NE(skinned_node->skin, nullptr);
78
79 ASSERT_EQ(skinned_node->mesh_primitives.size(), 2u);
80 auto& bottom_triangle = *skinned_node->mesh_primitives[0];
81 ASSERT_EQ(bottom_triangle.indices->count, 3u);
82
83 ASSERT_EQ(bottom_triangle.vertices.type,
84 fb::VertexBuffer::SkinnedVertexBuffer);
85 auto& vertices = bottom_triangle.vertices.AsSkinnedVertexBuffer()->vertices;
86 ASSERT_EQ(vertices.size(), 3u);
87 auto& vertex = vertices[0];
88
91
94
97
100
103
106
109
110 ASSERT_EQ(scene.animations.size(), 2u);
111 ASSERT_EQ(scene.animations[0]->name, "Idle");
112 ASSERT_EQ(scene.animations[1]->name, "Metronome");
113 ASSERT_EQ(scene.animations[1]->channels.size(), 6u);
114 auto& channel = scene.animations[1]->channels[3];
115 ASSERT_EQ(channel->keyframes.type, fb::Keyframes::RotationKeyframes);
116 auto* keyframes = channel->keyframes.AsRotationKeyframes();
117 ASSERT_EQ(keyframes->values.size(), 40u);
119 Vector4(0.653281, -0.270598, 0.270598, 0.653281));
121 Vector4(0.700151, 0.0989373, -0.0989373, 0.700151));
122}
#define ASSERT_VECTOR4_NEAR(a, b)
#define ASSERT_MATRIX_NEAR(a, b)
#define ASSERT_COLOR_NEAR(a, b)
#define ASSERT_POINT_NEAR(a, b)
#define ASSERT_VECTOR3_NEAR(a, b)
SK_API sk_sp< SkShader > Color(SkColor)
std::unique_ptr< fml::Mapping > OpenFixtureAsMapping(const std::string &fixture_name)
Opens a fixture of the given file name and returns a mapping to its contents.
bool ParseGLTF(const fml::Mapping &source_mapping, fb::SceneT &out_scene)
Vector3 ToVector3(const fb::Vec3 &v)
Vector4 ToVector4(const fb::Vec4 &v)
Vector2 ToVector2(const fb::Vec2 &v)
Color ToColor(const flutter::DlColor &color)
static Matrix ToMatrix(const SkMatrix &m)
SK_API sk_sp< PrecompileColorFilter > Matrix()
A 4x4 matrix using column-major storage.