| Flutter Impeller |

mesh.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_SCENE_MESH_H_
6 #define FLUTTER_IMPELLER_SCENE_MESH_H_
7
8 #include <memory>
9 #include <type_traits>
10
11 #include "flutter/fml/macros.h"
12 #include "impeller/scene/geometry.h"
13 #include "impeller/scene/material.h"
14 #include "impeller/scene/scene_encoder.h"
15
16 namespace impeller {
17 namespace scene {
18
19 class Skin;
20
21 class Mesh final {
22 public:
23 struct Primitive {
24 std::shared_ptr<Geometry> geometry;
25 std::shared_ptr<Material> material;
26 };
27
28 Mesh();
29 ~Mesh();
30
31 Mesh(Mesh&& mesh);
32 Mesh& operator=(Mesh&& mesh);
33
34 void AddPrimitive(Primitive mesh_);
35 std::vector<Primitive>& GetPrimitives();
36
37 bool Render(SceneEncoder& encoder,
38 const Matrix& transform,
39 const std::shared_ptr<Texture>& joints) const;
40
41 private:
42 std::vector<Primitive> primitives_;
43
44 Mesh(const Mesh&) = delete;
45
46 Mesh& operator=(const Mesh&) = delete;
47 };
48
49 } // namespace scene
50 } // namespace impeller
51
52 #endif // FLUTTER_IMPELLER_SCENE_MESH_H_
impeller::scene::Mesh::GetPrimitives
std::vector< Primitive > & GetPrimitives()
Definition: mesh.cc:32
impeller::scene::Mesh
Definition: mesh.h:21
impeller::scene::Mesh::Mesh
Mesh()
impeller::scene::Mesh::Primitive
Definition: mesh.h:23
scene_encoder.h
impeller::scene::Mesh::Render
bool Render(SceneEncoder &encoder, const Matrix &transform, const std::shared_ptr< Texture > &joints) const
Definition: mesh.cc:36
material.h
impeller::scene::Mesh::AddPrimitive
void AddPrimitive(Primitive mesh_)
Definition: mesh.cc:21
impeller::scene::Mesh::~Mesh
~Mesh()
impeller::scene::Mesh::Primitive::material
std::shared_ptr< Material > material
Definition: mesh.h:25
geometry.h
impeller::scene::SceneEncoder
Definition: scene_encoder.h:30
impeller
Definition: aiks_context.cc:10
impeller::scene::Mesh::Primitive::geometry
std::shared_ptr< Geometry > geometry
Definition: mesh.h:24
impeller::scene::Mesh::operator=
Mesh & operator=(Mesh &&mesh)
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37