1 #ifndef _RIVE_CUBIC_WEIGHT_BASE_HPP_
2 #define _RIVE_CUBIC_WEIGHT_BASE_HPP_
3 #include "bones/weight.hpp"
4 #include "core/field_types/core_uint_type.hpp"
7 class CubicWeightBase : public Weight
13 static const uint16_t typeKey = 46;
15 /// Helper to quickly determine if a core object extends another without
17 bool isTypeOf(uint16_t typeKey) const override
21 case CubicWeightBase::typeKey:
22 case WeightBase::typeKey:
23 case ComponentBase::typeKey:
30 uint16_t coreType() const override { return typeKey; }
32 static const uint16_t inValuesPropertyKey = 110;
33 static const uint16_t inIndicesPropertyKey = 111;
34 static const uint16_t outValuesPropertyKey = 112;
35 static const uint16_t outIndicesPropertyKey = 113;
40 int m_OutValues = 255;
43 inline int inValues() const { return m_InValues; }
44 void inValues(int value)
46 if (m_InValues == value)
54 inline int inIndices() const { return m_InIndices; }
55 void inIndices(int value)
57 if (m_InIndices == value)
65 inline int outValues() const { return m_OutValues; }
66 void outValues(int value)
68 if (m_OutValues == value)
76 inline int outIndices() const { return m_OutIndices; }
77 void outIndices(int value)
79 if (m_OutIndices == value)
87 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
91 case inValuesPropertyKey:
92 m_InValues = CoreUintType::deserialize(reader);
94 case inIndicesPropertyKey:
95 m_InIndices = CoreUintType::deserialize(reader);
97 case outValuesPropertyKey:
98 m_OutValues = CoreUintType::deserialize(reader);
100 case outIndicesPropertyKey:
101 m_OutIndices = CoreUintType::deserialize(reader);
104 return Weight::deserialize(propertyKey, reader);
108 virtual void inValuesChanged() {}
109 virtual void inIndicesChanged() {}
110 virtual void outValuesChanged() {}
111 virtual void outIndicesChanged() {}