| Flutter Impeller |

Classes | Public Member Functions | List of all members
impeller::scene::Mesh Class Referencefinal

`#include <mesh.h>`

## Classes
struct | Primitive

## Public Member Functions
| Mesh ()
| ~Mesh ()
| Mesh (Mesh &&mesh)
Mesh & | operator= (Mesh &&mesh)
void | AddPrimitive (Primitive mesh_)
std::vector< Primitive > & | GetPrimitives ()
bool | Render (SceneEncoder &encoder, const Matrix &transform, const std::shared_ptr< Texture > &joints) const

## Detailed Description

Definition at line 20 of file mesh.h.

## Constructor & Destructor Documentation

## ◆ Mesh() [1/2]

impeller::scene::Mesh::Mesh | ( |  | ) |
| default

## ◆ ~Mesh()

impeller::scene::Mesh::~Mesh | ( |  | ) |
| default

## ◆ Mesh() [2/2]

impeller::scene::Mesh::Mesh | ( | Mesh && | mesh | ) |
| default

## Member Function Documentation

## ◆ AddPrimitive()

void impeller::scene::Mesh::AddPrimitive | ( | Primitive | mesh_ | ) |

Definition at line 21 of file mesh.cc.

21 {
22 if (mesh.geometry == nullptr) {
23 VALIDATION_LOG << "Mesh geometry cannot be null.";
24 }
25 if (mesh.material == nullptr) {
26 VALIDATION_LOG << "Mesh material cannot be null.";
27 }
28
29 primitives_.push_back(std::move(mesh));
30 }

References impeller::scene::Mesh::Primitive::geometry, impeller::scene::Mesh::Primitive::material, and VALIDATION_LOG.

Referenced by impeller::scene::testing::TEST_P().

## ◆ GetPrimitives()

std::vector< Mesh::Primitive > & impeller::scene::Mesh::GetPrimitives | ( |  | ) |

Definition at line 32 of file mesh.cc.

32 {
33 return primitives_;
34 }

## ◆ operator=()

Mesh & impeller::scene::Mesh::operator= | ( | Mesh && | mesh | ) |
| default

## ◆ Render()

bool impeller::scene::Mesh::Render | ( | SceneEncoder & | encoder,
|  | const Matrix & | transform,
|  | const std::shared_ptr< Texture > & | joints
| ) |  | const

Definition at line 36 of file mesh.cc.

38 {
39 for (const auto& mesh : primitives_) {
40 mesh.geometry->SetJointsTexture(joints);
41 SceneCommand command = {
42 .label = "Mesh Primitive",
43 .transform = transform,
44 .geometry = mesh.geometry.get(),
45 .material = mesh.material.get(),
46 };
47 encoder.Add(command);
48 }
49 return true;
50 }

References impeller::scene::SceneEncoder::Add(), and impeller::scene::SceneCommand::label.

Referenced by impeller::scene::Node::Render().

The documentation for this class was generated from the following files:

- impeller/scene/mesh.h
- impeller/scene/mesh.cc
- impeller/scene/node.cc

VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:60