1 #ifndef _RIVE_TENDON_BASE_HPP_
2 #define _RIVE_TENDON_BASE_HPP_
3 #include "component.hpp"
4 #include "core/field_types/core_double_type.hpp"
5 #include "core/field_types/core_uint_type.hpp"
8 class TendonBase : public Component
11 typedef Component Super;
14 static const uint16_t typeKey = 44;
16 /// Helper to quickly determine if a core object extends another without
18 bool isTypeOf(uint16_t typeKey) const override
22 case TendonBase::typeKey:
23 case ComponentBase::typeKey:
30 uint16_t coreType() const override { return typeKey; }
32 static const uint16_t boneIdPropertyKey = 95;
33 static const uint16_t xxPropertyKey = 96;
34 static const uint16_t yxPropertyKey = 97;
35 static const uint16_t xyPropertyKey = 98;
36 static const uint16_t yyPropertyKey = 99;
37 static const uint16_t txPropertyKey = 100;
38 static const uint16_t tyPropertyKey = 101;
49 inline int boneId() const { return m_BoneId; }
50 void boneId(int value)
52 if (m_BoneId == value)
60 inline float xx() const { return m_Xx; }
71 inline float yx() const { return m_Yx; }
82 inline float xy() const { return m_Xy; }
93 inline float yy() const { return m_Yy; }
104 inline float tx() const { return m_Tx; }
115 inline float ty() const { return m_Ty; }
126 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
130 case boneIdPropertyKey:
131 m_BoneId = CoreUintType::deserialize(reader);
134 m_Xx = CoreDoubleType::deserialize(reader);
137 m_Yx = CoreDoubleType::deserialize(reader);
140 m_Xy = CoreDoubleType::deserialize(reader);
143 m_Yy = CoreDoubleType::deserialize(reader);
146 m_Tx = CoreDoubleType::deserialize(reader);
149 m_Ty = CoreDoubleType::deserialize(reader);
152 return Component::deserialize(propertyKey, reader);
156 virtual void boneIdChanged() {}
157 virtual void xxChanged() {}
158 virtual void yxChanged() {}
159 virtual void xyChanged() {}
160 virtual void yyChanged() {}
161 virtual void txChanged() {}
162 virtual void tyChanged() {}