PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
morph_mesh_renderer.h
1#pragma once
2
3#include "pixelbullet/filesystem/virtual_path.h"
4#include "pixelbullet/filesystem/virtual_path_serialization.h"
5#include "pixelbullet/scene/entity_id.h"
6#include "pixelbullet/serialization/node.h"
7
8namespace pixelbullet
9{
11{
12 VirtualPath mesh;
13 VirtualPath material;
14 EntityId weights_source = EntityId::Invalid();
15 bool visible = true;
16};
17
18inline Node& operator<<(Node& node, const MorphMeshRenderer& morph_mesh_renderer)
19{
20 node["mesh"] << morph_mesh_renderer.mesh;
21 node["material"] << morph_mesh_renderer.material;
22 node["weightsSource"] << morph_mesh_renderer.weights_source;
23 node["visible"] << morph_mesh_renderer.visible;
24 return node;
25}
26
27inline const Node& operator>>(const Node& node, MorphMeshRenderer& morph_mesh_renderer)
28{
29 node["mesh"] >> morph_mesh_renderer.mesh;
30 node["material"] >> morph_mesh_renderer.material;
31 if (node.HasProperty("weightsSource"))
32 {
33 node["weightsSource"] >> morph_mesh_renderer.weights_source;
34 }
35 else
36 {
37 morph_mesh_renderer.weights_source = EntityId::Invalid();
38 }
39 node["visible"] >> morph_mesh_renderer.visible;
40 return node;
41}
42} // namespace pixelbullet
Definition entity_id.h:11
Represents a hierarchical node capable of storing various data types and supporting YAML serializatio...
Definition node.h:45
Definition virtual_path.h:10
Definition morph_mesh_renderer.h:11