| 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 #pragma once
6
7 #include <memory>
8 #include <type_traits>
9
10 #include "flutter/fml/macros.h"
11 #include "impeller/scene/geometry.h"
12 #include "impeller/scene/material.h"
13 #include "impeller/scene/scene_encoder.h"
14
15 namespace impeller {
16 namespace scene {
17
18 class Skin;
19
20 class Mesh final {
21 public:
22 struct Primitive {
23 std::shared_ptr<Geometry> geometry;
24 std::shared_ptr<Material> material;
25 };
26
27 Mesh();
28 ~Mesh();
29
30 Mesh(Mesh&& mesh);
31 Mesh& operator=(Mesh&& mesh);
32
33 void AddPrimitive(Primitive mesh_);
34 std::vector<Primitive>& GetPrimitives();
35
36 bool Render(SceneEncoder& encoder,
37 const Matrix& transform,
38 const std::shared_ptr<Texture>& joints) const;
39
40 private:
41 std::vector<Primitive> primitives_;
42
43 FML_DISALLOW_COPY_AND_ASSIGN(Mesh);
44 };
45
46 } // namespace scene
47 } // namespace impeller
impeller::scene::Mesh::GetPrimitives
std::vector< Primitive > & GetPrimitives()
Definition: mesh.cc:32
impeller::scene::Mesh
Definition: mesh.h:20
impeller::scene::Mesh::Mesh
Mesh()
impeller::scene::Mesh::Primitive
Definition: mesh.h:22
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:24
geometry.h
impeller::scene::SceneEncoder
Definition: scene_encoder.h:29
impeller
Definition: aiks_context.cc:10
impeller::scene::Mesh::Primitive::geometry
std::shared_ptr< Geometry > geometry
Definition: mesh.h:23
impeller::scene::Mesh::operator=
Mesh & operator=(Mesh &&mesh)
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:36