PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
morph_weights_component.h
1#pragma once
2
3#include "pixelbullet/serialization/node.h"
4
5#include <vector>
6
7namespace pixelbullet
8{
10{
11 std::vector<float> weights;
12};
13
14inline bool operator==(const MorphWeightsComponent& lhs, const MorphWeightsComponent& rhs)
15{
16 return lhs.weights == rhs.weights;
17}
18
19inline bool operator!=(const MorphWeightsComponent& lhs, const MorphWeightsComponent& rhs)
20{
21 return !(lhs == rhs);
22}
23
24inline Node& operator<<(Node& node, const MorphWeightsComponent& component)
25{
26 node["weights"] << component.weights;
27 return node;
28}
29
30inline const Node& operator>>(const Node& node, MorphWeightsComponent& component)
31{
32 if (node.HasProperty("weights"))
33 {
34 node["weights"] >> component.weights;
35 }
36 else
37 {
38 component.weights.clear();
39 }
40 return node;
41}
42} // namespace pixelbullet
Represents a hierarchical node capable of storing various data types and supporting YAML serializatio...
Definition node.h:45
Definition morph_weights_component.h:10