Updating defs, implementing KeyFrameBool, stubbing translation, scale, rotation constraints.
diff --git a/dev/defs/animation/keyframe_bool.json b/dev/defs/animation/keyframe_bool.json new file mode 100644 index 0000000..7deb70b --- /dev/null +++ b/dev/defs/animation/keyframe_bool.json
@@ -0,0 +1,19 @@ +{ + "name": "KeyFrameBool", + "key": { + "int": 84, + "string": "keyframebool" + }, + "extends": "animation/keyframe.json", + "properties": { + "value": { + "type": "bool", + "typeRuntime": "bool", + "initialValue": "false", + "key": { + "int": 181, + "string": "value" + } + } + } +} \ No newline at end of file
diff --git a/dev/defs/constraints/ik_constraint.json b/dev/defs/constraints/ik_constraint.json index ed1395c..7bc8557 100644 --- a/dev/defs/constraints/ik_constraint.json +++ b/dev/defs/constraints/ik_constraint.json
@@ -9,9 +9,10 @@ "invertDirection": { "type": "bool", "initialValue": "false", + "animates": true, "key": { "int": 174, - "string": "invertdirection" + "string": "invert_direction" }, "description": "True when the direction taken towards the target should be inverted from the default." },
diff --git a/dev/defs/constraints/rotation_constraint.json b/dev/defs/constraints/rotation_constraint.json new file mode 100644 index 0000000..db981c8 --- /dev/null +++ b/dev/defs/constraints/rotation_constraint.json
@@ -0,0 +1,8 @@ +{ + "name": "RotationConstraint", + "key": { + "int": 89, + "string": "rotationconstraint" + }, + "extends": "constraints/transform_component_constraint.json" +} \ No newline at end of file
diff --git a/dev/defs/constraints/scale_constraint.json b/dev/defs/constraints/scale_constraint.json new file mode 100644 index 0000000..a188ed7 --- /dev/null +++ b/dev/defs/constraints/scale_constraint.json
@@ -0,0 +1,8 @@ +{ + "name": "ScaleConstraint", + "key": { + "int": 88, + "string": "scaleconstraint" + }, + "extends": "constraints/transform_component_constraint_y.json" +} \ No newline at end of file
diff --git a/dev/defs/constraints/transform_component_constraint.json b/dev/defs/constraints/transform_component_constraint.json new file mode 100644 index 0000000..e2f2f36 --- /dev/null +++ b/dev/defs/constraints/transform_component_constraint.json
@@ -0,0 +1,83 @@ +{ + "name": "TransformComponentConstraint", + "key": { + "int": 85, + "string": "transformcomponentconstraint" + }, + "abstract": true, + "extends": "constraints/transform_space_constraint.json", + "properties": { + "minMaxSpaceValue": { + "type": "uint", + "initialValue": "0", + "key": { + "int": 195, + "string": "minmaxspacevalue" + }, + "description": "The min/max transform space." + }, + "copyFactor": { + "type": "double", + "initialValue": "1", + "key": { + "int": 182, + "string": "copyfactor" + }, + "description": "Copy factor." + }, + "minValue": { + "type": "double", + "initialValue": "0", + "key": { + "int": 183, + "string": "minvalue" + }, + "description": "Minimum value." + }, + "maxValue": { + "type": "double", + "initialValue": "0", + "key": { + "int": 184, + "string": "maxvalue" + }, + "description": "Maximum value." + }, + "offset": { + "type": "bool", + "initialValue": "false", + "key": { + "int": 188, + "string": "offset" + }, + "description": "True when the original component (rotation/scale/translation) is used to offset the copied one." + }, + "doesCopy": { + "type": "bool", + "initialValue": "true", + "key": { + "int": 189, + "string": "doescopy" + }, + "description": "Whether the component is copied." + }, + "min": { + "type": "bool", + "initialValue": "false", + "key": { + "int": 190, + "string": "min" + }, + "description": "Whether min is used." + }, + "max": { + "type": "bool", + "initialValue": "false", + "key": { + "int": 191, + "string": "max" + }, + "description": "Whether max is used." + } + } +} \ No newline at end of file
diff --git a/dev/defs/constraints/transform_component_constraint_y.json b/dev/defs/constraints/transform_component_constraint_y.json new file mode 100644 index 0000000..d26d40b --- /dev/null +++ b/dev/defs/constraints/transform_component_constraint_y.json
@@ -0,0 +1,65 @@ +{ + "name": "TransformComponentConstraintY", + "key": { + "int": 86, + "string": "transformcomponentconstrainty" + }, + "abstract": true, + "extends": "constraints/transform_component_constraint.json", + "properties": { + "copyFactorY": { + "type": "double", + "initialValue": "1", + "key": { + "int": 185, + "string": "copyfactory" + }, + "description": "Copy factor." + }, + "minValueY": { + "type": "double", + "initialValue": "0", + "key": { + "int": 186, + "string": "minvaluey" + }, + "description": "Minimum value." + }, + "maxValueY": { + "type": "double", + "initialValue": "0", + "key": { + "int": 187, + "string": "maxvaluey" + }, + "description": "Maximum value." + }, + "doesCopyY": { + "type": "bool", + "initialValue": "true", + "key": { + "int": 192, + "string": "doescopyy" + }, + "description": "Whether the Y component is copied." + }, + "minY": { + "type": "bool", + "initialValue": "false", + "key": { + "int": 193, + "string": "miny" + }, + "description": "Whether min Y is used." + }, + "maxY": { + "type": "bool", + "initialValue": "false", + "key": { + "int": 194, + "string": "maxx" + }, + "description": "Whether max Y is used." + } + } +} \ No newline at end of file
diff --git a/dev/defs/constraints/transform_constraint.json b/dev/defs/constraints/transform_constraint.json index add65a0..11b2b42 100644 --- a/dev/defs/constraints/transform_constraint.json +++ b/dev/defs/constraints/transform_constraint.json
@@ -4,25 +4,5 @@ "int": 83, "string": "transformconstraint" }, - "extends": "constraints/targeted_constraint.json", - "properties": { - "sourceSpaceValue": { - "type": "uint", - "initialValue": "0", - "key": { - "int": 179, - "string": "sourcespacevalue" - }, - "description": "The source transform space." - }, - "destSpaceValue": { - "type": "uint", - "initialValue": "0", - "key": { - "int": 180, - "string": "destspacevalue" - }, - "description": "The destination transform space." - } - } + "extends": "constraints/transform_space_constraint.json" } \ No newline at end of file
diff --git a/dev/defs/constraints/transform_space_constraint.json b/dev/defs/constraints/transform_space_constraint.json new file mode 100644 index 0000000..9f2f9ee --- /dev/null +++ b/dev/defs/constraints/transform_space_constraint.json
@@ -0,0 +1,29 @@ +{ + "name": "TransformSpaceConstraint", + "key": { + "int": 90, + "string": "transformspaceconstraint" + }, + "abstract": true, + "extends": "constraints/targeted_constraint.json", + "properties": { + "sourceSpaceValue": { + "type": "uint", + "initialValue": "0", + "key": { + "int": 179, + "string": "sourcespacevalue" + }, + "description": "The source transform space." + }, + "destSpaceValue": { + "type": "uint", + "initialValue": "0", + "key": { + "int": 180, + "string": "destspacevalue" + }, + "description": "The destination transform space." + } + } +} \ No newline at end of file
diff --git a/dev/defs/constraints/translation_constraint.json b/dev/defs/constraints/translation_constraint.json new file mode 100644 index 0000000..ba9346e --- /dev/null +++ b/dev/defs/constraints/translation_constraint.json
@@ -0,0 +1,8 @@ +{ + "name": "TranslationConstraint", + "key": { + "int": 87, + "string": "translationconstraint" + }, + "extends": "constraints/transform_component_constraint_y.json" +} \ No newline at end of file
diff --git a/include/rive/animation/keyframe_bool.hpp b/include/rive/animation/keyframe_bool.hpp new file mode 100644 index 0000000..2f0b67e --- /dev/null +++ b/include/rive/animation/keyframe_bool.hpp
@@ -0,0 +1,19 @@ +#ifndef _RIVE_KEY_FRAME_BOOL_HPP_ +#define _RIVE_KEY_FRAME_BOOL_HPP_ +#include "rive/generated/animation/keyframe_bool_base.hpp" +#include <stdio.h> +namespace rive +{ + class KeyFrameBool : public KeyFrameBoolBase + { + public: + void apply(Core* object, int propertyKey, float mix) override; + void applyInterpolation(Core* object, + int propertyKey, + float seconds, + const KeyFrame* nextFrame, + float mix) override; + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/constraints/rotation_constraint.hpp b/include/rive/constraints/rotation_constraint.hpp new file mode 100644 index 0000000..b015c26 --- /dev/null +++ b/include/rive/constraints/rotation_constraint.hpp
@@ -0,0 +1,14 @@ +#ifndef _RIVE_ROTATION_CONSTRAINT_HPP_ +#define _RIVE_ROTATION_CONSTRAINT_HPP_ +#include "rive/generated/constraints/rotation_constraint_base.hpp" +#include <stdio.h> +namespace rive +{ + class RotationConstraint : public RotationConstraintBase + { + public: + void constrain(TransformComponent* component) override; + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/constraints/scale_constraint.hpp b/include/rive/constraints/scale_constraint.hpp new file mode 100644 index 0000000..e9953d5 --- /dev/null +++ b/include/rive/constraints/scale_constraint.hpp
@@ -0,0 +1,14 @@ +#ifndef _RIVE_SCALE_CONSTRAINT_HPP_ +#define _RIVE_SCALE_CONSTRAINT_HPP_ +#include "rive/generated/constraints/scale_constraint_base.hpp" +#include <stdio.h> +namespace rive +{ + class ScaleConstraint : public ScaleConstraintBase + { + public: + void constrain(TransformComponent* component) override; + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/constraints/transform_component_constraint.hpp b/include/rive/constraints/transform_component_constraint.hpp new file mode 100644 index 0000000..5a2e2ff --- /dev/null +++ b/include/rive/constraints/transform_component_constraint.hpp
@@ -0,0 +1,18 @@ +#ifndef _RIVE_TRANSFORM_COMPONENT_CONSTRAINT_HPP_ +#define _RIVE_TRANSFORM_COMPONENT_CONSTRAINT_HPP_ +#include "rive/generated/constraints/transform_component_constraint_base.hpp" +#include "rive/transform_space.hpp" +#include <stdio.h> +namespace rive +{ + class TransformComponentConstraint : public TransformComponentConstraintBase + { + public: + TransformSpace minMaxSpace() const + { + return (TransformSpace)minMaxSpaceValue(); + } + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/constraints/transform_component_constraint_y.hpp b/include/rive/constraints/transform_component_constraint_y.hpp new file mode 100644 index 0000000..ac98598 --- /dev/null +++ b/include/rive/constraints/transform_component_constraint_y.hpp
@@ -0,0 +1,14 @@ +#ifndef _RIVE_TRANSFORM_COMPONENT_CONSTRAINT_Y_HPP_ +#define _RIVE_TRANSFORM_COMPONENT_CONSTRAINT_Y_HPP_ +#include "rive/generated/constraints/transform_component_constraint_y_base.hpp" +#include <stdio.h> +namespace rive +{ + class TransformComponentConstraintY + : public TransformComponentConstraintYBase + { + public: + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/constraints/transform_space_constraint.hpp b/include/rive/constraints/transform_space_constraint.hpp new file mode 100644 index 0000000..4897451 --- /dev/null +++ b/include/rive/constraints/transform_space_constraint.hpp
@@ -0,0 +1,13 @@ +#ifndef _RIVE_TRANSFORM_SPACE_CONSTRAINT_HPP_ +#define _RIVE_TRANSFORM_SPACE_CONSTRAINT_HPP_ +#include "rive/generated/constraints/transform_space_constraint_base.hpp" +#include <stdio.h> +namespace rive +{ + class TransformSpaceConstraint : public TransformSpaceConstraintBase + { + public: + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/constraints/translation_constraint.hpp b/include/rive/constraints/translation_constraint.hpp new file mode 100644 index 0000000..60f474d --- /dev/null +++ b/include/rive/constraints/translation_constraint.hpp
@@ -0,0 +1,14 @@ +#ifndef _RIVE_TRANSLATION_CONSTRAINT_HPP_ +#define _RIVE_TRANSLATION_CONSTRAINT_HPP_ +#include "rive/generated/constraints/translation_constraint_base.hpp" +#include <stdio.h> +namespace rive +{ + class TranslationConstraint : public TranslationConstraintBase + { + public: + void constrain(TransformComponent* component) override; + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/generated/animation/keyframe_bool_base.hpp b/include/rive/generated/animation/keyframe_bool_base.hpp new file mode 100644 index 0000000..90ef33a --- /dev/null +++ b/include/rive/generated/animation/keyframe_bool_base.hpp
@@ -0,0 +1,70 @@ +#ifndef _RIVE_KEY_FRAME_BOOL_BASE_HPP_ +#define _RIVE_KEY_FRAME_BOOL_BASE_HPP_ +#include "rive/animation/keyframe.hpp" +#include "rive/core/field_types/core_bool_type.hpp" +namespace rive +{ + class KeyFrameBoolBase : public KeyFrame + { + protected: + typedef KeyFrame Super; + + public: + static const uint16_t typeKey = 84; + + /// Helper to quickly determine if a core object extends another without + /// RTTI at runtime. + bool isTypeOf(uint16_t typeKey) const override + { + switch (typeKey) + { + case KeyFrameBoolBase::typeKey: + case KeyFrameBase::typeKey: + return true; + default: + return false; + } + } + + uint16_t coreType() const override { return typeKey; } + + static const uint16_t valuePropertyKey = 181; + + private: + bool m_Value = false; + public: + inline bool value() const { return m_Value; } + void value(bool value) + { + if (m_Value == value) + { + return; + } + m_Value = value; + valueChanged(); + } + + Core* clone() const override; + void copy(const KeyFrameBoolBase& object) + { + m_Value = object.m_Value; + KeyFrame::copy(object); + } + + bool deserialize(uint16_t propertyKey, BinaryReader& reader) override + { + switch (propertyKey) + { + case valuePropertyKey: + m_Value = CoreBoolType::deserialize(reader); + return true; + } + return KeyFrame::deserialize(propertyKey, reader); + } + + protected: + virtual void valueChanged() {} + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/generated/constraints/rotation_constraint_base.hpp b/include/rive/generated/constraints/rotation_constraint_base.hpp new file mode 100644 index 0000000..6ef8f03 --- /dev/null +++ b/include/rive/generated/constraints/rotation_constraint_base.hpp
@@ -0,0 +1,40 @@ +#ifndef _RIVE_ROTATION_CONSTRAINT_BASE_HPP_ +#define _RIVE_ROTATION_CONSTRAINT_BASE_HPP_ +#include "rive/constraints/transform_component_constraint.hpp" +namespace rive +{ + class RotationConstraintBase : public TransformComponentConstraint + { + protected: + typedef TransformComponentConstraint Super; + + public: + static const uint16_t typeKey = 89; + + /// Helper to quickly determine if a core object extends another without + /// RTTI at runtime. + bool isTypeOf(uint16_t typeKey) const override + { + switch (typeKey) + { + case RotationConstraintBase::typeKey: + case TransformComponentConstraintBase::typeKey: + case TransformSpaceConstraintBase::typeKey: + case TargetedConstraintBase::typeKey: + case ConstraintBase::typeKey: + case ComponentBase::typeKey: + return true; + default: + return false; + } + } + + uint16_t coreType() const override { return typeKey; } + + Core* clone() const override; + + protected: + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/generated/constraints/scale_constraint_base.hpp b/include/rive/generated/constraints/scale_constraint_base.hpp new file mode 100644 index 0000000..08ac1cb --- /dev/null +++ b/include/rive/generated/constraints/scale_constraint_base.hpp
@@ -0,0 +1,41 @@ +#ifndef _RIVE_SCALE_CONSTRAINT_BASE_HPP_ +#define _RIVE_SCALE_CONSTRAINT_BASE_HPP_ +#include "rive/constraints/transform_component_constraint_y.hpp" +namespace rive +{ + class ScaleConstraintBase : public TransformComponentConstraintY + { + protected: + typedef TransformComponentConstraintY Super; + + public: + static const uint16_t typeKey = 88; + + /// Helper to quickly determine if a core object extends another without + /// RTTI at runtime. + bool isTypeOf(uint16_t typeKey) const override + { + switch (typeKey) + { + case ScaleConstraintBase::typeKey: + case TransformComponentConstraintYBase::typeKey: + case TransformComponentConstraintBase::typeKey: + case TransformSpaceConstraintBase::typeKey: + case TargetedConstraintBase::typeKey: + case ConstraintBase::typeKey: + case ComponentBase::typeKey: + return true; + default: + return false; + } + } + + uint16_t coreType() const override { return typeKey; } + + Core* clone() const override; + + protected: + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/generated/constraints/transform_component_constraint_base.hpp b/include/rive/generated/constraints/transform_component_constraint_base.hpp new file mode 100644 index 0000000..50fe0f3 --- /dev/null +++ b/include/rive/generated/constraints/transform_component_constraint_base.hpp
@@ -0,0 +1,200 @@ +#ifndef _RIVE_TRANSFORM_COMPONENT_CONSTRAINT_BASE_HPP_ +#define _RIVE_TRANSFORM_COMPONENT_CONSTRAINT_BASE_HPP_ +#include "rive/constraints/transform_space_constraint.hpp" +#include "rive/core/field_types/core_bool_type.hpp" +#include "rive/core/field_types/core_double_type.hpp" +#include "rive/core/field_types/core_uint_type.hpp" +namespace rive +{ + class TransformComponentConstraintBase : public TransformSpaceConstraint + { + protected: + typedef TransformSpaceConstraint Super; + + public: + static const uint16_t typeKey = 85; + + /// Helper to quickly determine if a core object extends another without + /// RTTI at runtime. + bool isTypeOf(uint16_t typeKey) const override + { + switch (typeKey) + { + case TransformComponentConstraintBase::typeKey: + case TransformSpaceConstraintBase::typeKey: + case TargetedConstraintBase::typeKey: + case ConstraintBase::typeKey: + case ComponentBase::typeKey: + return true; + default: + return false; + } + } + + uint16_t coreType() const override { return typeKey; } + + static const uint16_t minMaxSpaceValuePropertyKey = 195; + static const uint16_t copyFactorPropertyKey = 182; + static const uint16_t minValuePropertyKey = 183; + static const uint16_t maxValuePropertyKey = 184; + static const uint16_t offsetPropertyKey = 188; + static const uint16_t doesCopyPropertyKey = 189; + static const uint16_t minPropertyKey = 190; + static const uint16_t maxPropertyKey = 191; + + private: + int m_MinMaxSpaceValue = 0; + float m_CopyFactor = 1.0f; + float m_MinValue = 0.0f; + float m_MaxValue = 0.0f; + bool m_Offset = false; + bool m_DoesCopy = true; + bool m_Min = false; + bool m_Max = false; + public: + inline int minMaxSpaceValue() const { return m_MinMaxSpaceValue; } + void minMaxSpaceValue(int value) + { + if (m_MinMaxSpaceValue == value) + { + return; + } + m_MinMaxSpaceValue = value; + minMaxSpaceValueChanged(); + } + + inline float copyFactor() const { return m_CopyFactor; } + void copyFactor(float value) + { + if (m_CopyFactor == value) + { + return; + } + m_CopyFactor = value; + copyFactorChanged(); + } + + inline float minValue() const { return m_MinValue; } + void minValue(float value) + { + if (m_MinValue == value) + { + return; + } + m_MinValue = value; + minValueChanged(); + } + + inline float maxValue() const { return m_MaxValue; } + void maxValue(float value) + { + if (m_MaxValue == value) + { + return; + } + m_MaxValue = value; + maxValueChanged(); + } + + inline bool offset() const { return m_Offset; } + void offset(bool value) + { + if (m_Offset == value) + { + return; + } + m_Offset = value; + offsetChanged(); + } + + inline bool doesCopy() const { return m_DoesCopy; } + void doesCopy(bool value) + { + if (m_DoesCopy == value) + { + return; + } + m_DoesCopy = value; + doesCopyChanged(); + } + + inline bool min() const { return m_Min; } + void min(bool value) + { + if (m_Min == value) + { + return; + } + m_Min = value; + minChanged(); + } + + inline bool max() const { return m_Max; } + void max(bool value) + { + if (m_Max == value) + { + return; + } + m_Max = value; + maxChanged(); + } + + void copy(const TransformComponentConstraintBase& object) + { + m_MinMaxSpaceValue = object.m_MinMaxSpaceValue; + m_CopyFactor = object.m_CopyFactor; + m_MinValue = object.m_MinValue; + m_MaxValue = object.m_MaxValue; + m_Offset = object.m_Offset; + m_DoesCopy = object.m_DoesCopy; + m_Min = object.m_Min; + m_Max = object.m_Max; + TransformSpaceConstraint::copy(object); + } + + bool deserialize(uint16_t propertyKey, BinaryReader& reader) override + { + switch (propertyKey) + { + case minMaxSpaceValuePropertyKey: + m_MinMaxSpaceValue = CoreUintType::deserialize(reader); + return true; + case copyFactorPropertyKey: + m_CopyFactor = CoreDoubleType::deserialize(reader); + return true; + case minValuePropertyKey: + m_MinValue = CoreDoubleType::deserialize(reader); + return true; + case maxValuePropertyKey: + m_MaxValue = CoreDoubleType::deserialize(reader); + return true; + case offsetPropertyKey: + m_Offset = CoreBoolType::deserialize(reader); + return true; + case doesCopyPropertyKey: + m_DoesCopy = CoreBoolType::deserialize(reader); + return true; + case minPropertyKey: + m_Min = CoreBoolType::deserialize(reader); + return true; + case maxPropertyKey: + m_Max = CoreBoolType::deserialize(reader); + return true; + } + return TransformSpaceConstraint::deserialize(propertyKey, reader); + } + + protected: + virtual void minMaxSpaceValueChanged() {} + virtual void copyFactorChanged() {} + virtual void minValueChanged() {} + virtual void maxValueChanged() {} + virtual void offsetChanged() {} + virtual void doesCopyChanged() {} + virtual void minChanged() {} + virtual void maxChanged() {} + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/generated/constraints/transform_component_constraint_y_base.hpp b/include/rive/generated/constraints/transform_component_constraint_y_base.hpp new file mode 100644 index 0000000..2d8c7b4 --- /dev/null +++ b/include/rive/generated/constraints/transform_component_constraint_y_base.hpp
@@ -0,0 +1,166 @@ +#ifndef _RIVE_TRANSFORM_COMPONENT_CONSTRAINT_YBASE_HPP_ +#define _RIVE_TRANSFORM_COMPONENT_CONSTRAINT_YBASE_HPP_ +#include "rive/constraints/transform_component_constraint.hpp" +#include "rive/core/field_types/core_bool_type.hpp" +#include "rive/core/field_types/core_double_type.hpp" +namespace rive +{ + class TransformComponentConstraintYBase + : public TransformComponentConstraint + { + protected: + typedef TransformComponentConstraint Super; + + public: + static const uint16_t typeKey = 86; + + /// Helper to quickly determine if a core object extends another without + /// RTTI at runtime. + bool isTypeOf(uint16_t typeKey) const override + { + switch (typeKey) + { + case TransformComponentConstraintYBase::typeKey: + case TransformComponentConstraintBase::typeKey: + case TransformSpaceConstraintBase::typeKey: + case TargetedConstraintBase::typeKey: + case ConstraintBase::typeKey: + case ComponentBase::typeKey: + return true; + default: + return false; + } + } + + uint16_t coreType() const override { return typeKey; } + + static const uint16_t copyFactorYPropertyKey = 185; + static const uint16_t minValueYPropertyKey = 186; + static const uint16_t maxValueYPropertyKey = 187; + static const uint16_t doesCopyYPropertyKey = 192; + static const uint16_t minYPropertyKey = 193; + static const uint16_t maxYPropertyKey = 194; + + private: + float m_CopyFactorY = 1.0f; + float m_MinValueY = 0.0f; + float m_MaxValueY = 0.0f; + bool m_DoesCopyY = true; + bool m_MinY = false; + bool m_MaxY = false; + public: + inline float copyFactorY() const { return m_CopyFactorY; } + void copyFactorY(float value) + { + if (m_CopyFactorY == value) + { + return; + } + m_CopyFactorY = value; + copyFactorYChanged(); + } + + inline float minValueY() const { return m_MinValueY; } + void minValueY(float value) + { + if (m_MinValueY == value) + { + return; + } + m_MinValueY = value; + minValueYChanged(); + } + + inline float maxValueY() const { return m_MaxValueY; } + void maxValueY(float value) + { + if (m_MaxValueY == value) + { + return; + } + m_MaxValueY = value; + maxValueYChanged(); + } + + inline bool doesCopyY() const { return m_DoesCopyY; } + void doesCopyY(bool value) + { + if (m_DoesCopyY == value) + { + return; + } + m_DoesCopyY = value; + doesCopyYChanged(); + } + + inline bool minY() const { return m_MinY; } + void minY(bool value) + { + if (m_MinY == value) + { + return; + } + m_MinY = value; + minYChanged(); + } + + inline bool maxY() const { return m_MaxY; } + void maxY(bool value) + { + if (m_MaxY == value) + { + return; + } + m_MaxY = value; + maxYChanged(); + } + + void copy(const TransformComponentConstraintYBase& object) + { + m_CopyFactorY = object.m_CopyFactorY; + m_MinValueY = object.m_MinValueY; + m_MaxValueY = object.m_MaxValueY; + m_DoesCopyY = object.m_DoesCopyY; + m_MinY = object.m_MinY; + m_MaxY = object.m_MaxY; + TransformComponentConstraint::copy(object); + } + + bool deserialize(uint16_t propertyKey, BinaryReader& reader) override + { + switch (propertyKey) + { + case copyFactorYPropertyKey: + m_CopyFactorY = CoreDoubleType::deserialize(reader); + return true; + case minValueYPropertyKey: + m_MinValueY = CoreDoubleType::deserialize(reader); + return true; + case maxValueYPropertyKey: + m_MaxValueY = CoreDoubleType::deserialize(reader); + return true; + case doesCopyYPropertyKey: + m_DoesCopyY = CoreBoolType::deserialize(reader); + return true; + case minYPropertyKey: + m_MinY = CoreBoolType::deserialize(reader); + return true; + case maxYPropertyKey: + m_MaxY = CoreBoolType::deserialize(reader); + return true; + } + return TransformComponentConstraint::deserialize(propertyKey, + reader); + } + + protected: + virtual void copyFactorYChanged() {} + virtual void minValueYChanged() {} + virtual void maxValueYChanged() {} + virtual void doesCopyYChanged() {} + virtual void minYChanged() {} + virtual void maxYChanged() {} + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/generated/constraints/transform_constraint_base.hpp b/include/rive/generated/constraints/transform_constraint_base.hpp index 9a71ce8..6e16ce2 100644 --- a/include/rive/generated/constraints/transform_constraint_base.hpp +++ b/include/rive/generated/constraints/transform_constraint_base.hpp
@@ -1,13 +1,12 @@ #ifndef _RIVE_TRANSFORM_CONSTRAINT_BASE_HPP_ #define _RIVE_TRANSFORM_CONSTRAINT_BASE_HPP_ -#include "rive/constraints/targeted_constraint.hpp" -#include "rive/core/field_types/core_uint_type.hpp" +#include "rive/constraints/transform_space_constraint.hpp" namespace rive { - class TransformConstraintBase : public TargetedConstraint + class TransformConstraintBase : public TransformSpaceConstraint { protected: - typedef TargetedConstraint Super; + typedef TransformSpaceConstraint Super; public: static const uint16_t typeKey = 83; @@ -19,6 +18,7 @@ switch (typeKey) { case TransformConstraintBase::typeKey: + case TransformSpaceConstraintBase::typeKey: case TargetedConstraintBase::typeKey: case ConstraintBase::typeKey: case ComponentBase::typeKey: @@ -30,60 +30,9 @@ uint16_t coreType() const override { return typeKey; } - static const uint16_t sourceSpaceValuePropertyKey = 179; - static const uint16_t destSpaceValuePropertyKey = 180; - - private: - int m_SourceSpaceValue = 0; - int m_DestSpaceValue = 0; - public: - inline int sourceSpaceValue() const { return m_SourceSpaceValue; } - void sourceSpaceValue(int value) - { - if (m_SourceSpaceValue == value) - { - return; - } - m_SourceSpaceValue = value; - sourceSpaceValueChanged(); - } - - inline int destSpaceValue() const { return m_DestSpaceValue; } - void destSpaceValue(int value) - { - if (m_DestSpaceValue == value) - { - return; - } - m_DestSpaceValue = value; - destSpaceValueChanged(); - } - Core* clone() const override; - void copy(const TransformConstraintBase& object) - { - m_SourceSpaceValue = object.m_SourceSpaceValue; - m_DestSpaceValue = object.m_DestSpaceValue; - TargetedConstraint::copy(object); - } - - bool deserialize(uint16_t propertyKey, BinaryReader& reader) override - { - switch (propertyKey) - { - case sourceSpaceValuePropertyKey: - m_SourceSpaceValue = CoreUintType::deserialize(reader); - return true; - case destSpaceValuePropertyKey: - m_DestSpaceValue = CoreUintType::deserialize(reader); - return true; - } - return TargetedConstraint::deserialize(propertyKey, reader); - } protected: - virtual void sourceSpaceValueChanged() {} - virtual void destSpaceValueChanged() {} }; } // namespace rive
diff --git a/include/rive/generated/constraints/transform_space_constraint_base.hpp b/include/rive/generated/constraints/transform_space_constraint_base.hpp new file mode 100644 index 0000000..ac4f948 --- /dev/null +++ b/include/rive/generated/constraints/transform_space_constraint_base.hpp
@@ -0,0 +1,89 @@ +#ifndef _RIVE_TRANSFORM_SPACE_CONSTRAINT_BASE_HPP_ +#define _RIVE_TRANSFORM_SPACE_CONSTRAINT_BASE_HPP_ +#include "rive/constraints/targeted_constraint.hpp" +#include "rive/core/field_types/core_uint_type.hpp" +namespace rive +{ + class TransformSpaceConstraintBase : public TargetedConstraint + { + protected: + typedef TargetedConstraint Super; + + public: + static const uint16_t typeKey = 90; + + /// Helper to quickly determine if a core object extends another without + /// RTTI at runtime. + bool isTypeOf(uint16_t typeKey) const override + { + switch (typeKey) + { + case TransformSpaceConstraintBase::typeKey: + case TargetedConstraintBase::typeKey: + case ConstraintBase::typeKey: + case ComponentBase::typeKey: + return true; + default: + return false; + } + } + + uint16_t coreType() const override { return typeKey; } + + static const uint16_t sourceSpaceValuePropertyKey = 179; + static const uint16_t destSpaceValuePropertyKey = 180; + + private: + int m_SourceSpaceValue = 0; + int m_DestSpaceValue = 0; + public: + inline int sourceSpaceValue() const { return m_SourceSpaceValue; } + void sourceSpaceValue(int value) + { + if (m_SourceSpaceValue == value) + { + return; + } + m_SourceSpaceValue = value; + sourceSpaceValueChanged(); + } + + inline int destSpaceValue() const { return m_DestSpaceValue; } + void destSpaceValue(int value) + { + if (m_DestSpaceValue == value) + { + return; + } + m_DestSpaceValue = value; + destSpaceValueChanged(); + } + + void copy(const TransformSpaceConstraintBase& object) + { + m_SourceSpaceValue = object.m_SourceSpaceValue; + m_DestSpaceValue = object.m_DestSpaceValue; + TargetedConstraint::copy(object); + } + + bool deserialize(uint16_t propertyKey, BinaryReader& reader) override + { + switch (propertyKey) + { + case sourceSpaceValuePropertyKey: + m_SourceSpaceValue = CoreUintType::deserialize(reader); + return true; + case destSpaceValuePropertyKey: + m_DestSpaceValue = CoreUintType::deserialize(reader); + return true; + } + return TargetedConstraint::deserialize(propertyKey, reader); + } + + protected: + virtual void sourceSpaceValueChanged() {} + virtual void destSpaceValueChanged() {} + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/generated/constraints/translation_constraint_base.hpp b/include/rive/generated/constraints/translation_constraint_base.hpp new file mode 100644 index 0000000..188e302 --- /dev/null +++ b/include/rive/generated/constraints/translation_constraint_base.hpp
@@ -0,0 +1,41 @@ +#ifndef _RIVE_TRANSLATION_CONSTRAINT_BASE_HPP_ +#define _RIVE_TRANSLATION_CONSTRAINT_BASE_HPP_ +#include "rive/constraints/transform_component_constraint_y.hpp" +namespace rive +{ + class TranslationConstraintBase : public TransformComponentConstraintY + { + protected: + typedef TransformComponentConstraintY Super; + + public: + static const uint16_t typeKey = 87; + + /// Helper to quickly determine if a core object extends another without + /// RTTI at runtime. + bool isTypeOf(uint16_t typeKey) const override + { + switch (typeKey) + { + case TranslationConstraintBase::typeKey: + case TransformComponentConstraintYBase::typeKey: + case TransformComponentConstraintBase::typeKey: + case TransformSpaceConstraintBase::typeKey: + case TargetedConstraintBase::typeKey: + case ConstraintBase::typeKey: + case ComponentBase::typeKey: + return true; + default: + return false; + } + } + + uint16_t coreType() const override { return typeKey; } + + Core* clone() const override; + + protected: + }; +} // namespace rive + +#endif \ No newline at end of file
diff --git a/include/rive/generated/core_registry.hpp b/include/rive/generated/core_registry.hpp index edc1515..dde79f7 100644 --- a/include/rive/generated/core_registry.hpp +++ b/include/rive/generated/core_registry.hpp
@@ -16,6 +16,7 @@ #include "rive/animation/keyed_object.hpp" #include "rive/animation/keyed_property.hpp" #include "rive/animation/keyframe.hpp" +#include "rive/animation/keyframe_bool.hpp" #include "rive/animation/keyframe_color.hpp" #include "rive/animation/keyframe_double.hpp" #include "rive/animation/keyframe_id.hpp" @@ -48,8 +49,14 @@ #include "rive/constraints/constraint.hpp" #include "rive/constraints/distance_constraint.hpp" #include "rive/constraints/ik_constraint.hpp" +#include "rive/constraints/rotation_constraint.hpp" +#include "rive/constraints/scale_constraint.hpp" #include "rive/constraints/targeted_constraint.hpp" +#include "rive/constraints/transform_component_constraint.hpp" +#include "rive/constraints/transform_component_constraint_y.hpp" #include "rive/constraints/transform_constraint.hpp" +#include "rive/constraints/transform_space_constraint.hpp" +#include "rive/constraints/translation_constraint.hpp" #include "rive/container_component.hpp" #include "rive/draw_rules.hpp" #include "rive/draw_target.hpp" @@ -95,8 +102,14 @@ return new DistanceConstraint(); case IKConstraintBase::typeKey: return new IKConstraint(); + case TranslationConstraintBase::typeKey: + return new TranslationConstraint(); case TransformConstraintBase::typeKey: return new TransformConstraint(); + case ScaleConstraintBase::typeKey: + return new ScaleConstraint(); + case RotationConstraintBase::typeKey: + return new RotationConstraint(); case AnimationStateBase::typeKey: return new AnimationState(); case KeyedObjectBase::typeKey: @@ -111,6 +124,8 @@ return new KeyedProperty(); case KeyFrameIdBase::typeKey: return new KeyFrameId(); + case KeyFrameBoolBase::typeKey: + return new KeyFrameBool(); case TransitionNumberConditionBase::typeKey: return new TransitionNumberCondition(); case AnyStateBase::typeKey: @@ -244,17 +259,22 @@ case DistanceConstraintBase::modeValuePropertyKey: object->as<DistanceConstraintBase>()->modeValue(value); break; + case TransformSpaceConstraintBase::sourceSpaceValuePropertyKey: + object->as<TransformSpaceConstraintBase>() + ->sourceSpaceValue(value); + break; + case TransformSpaceConstraintBase::destSpaceValuePropertyKey: + object->as<TransformSpaceConstraintBase>()->destSpaceValue( + value); + break; + case TransformComponentConstraintBase:: + minMaxSpaceValuePropertyKey: + object->as<TransformComponentConstraintBase>() + ->minMaxSpaceValue(value); + break; case IKConstraintBase::parentBoneCountPropertyKey: object->as<IKConstraintBase>()->parentBoneCount(value); break; - case TransformConstraintBase::sourceSpaceValuePropertyKey: - object->as<TransformConstraintBase>()->sourceSpaceValue( - value); - break; - case TransformConstraintBase::destSpaceValuePropertyKey: - object->as<TransformConstraintBase>()->destSpaceValue( - value); - break; case AnimationStateBase::animationIdPropertyKey: object->as<AnimationStateBase>()->animationId(value); break; @@ -388,6 +408,30 @@ case DistanceConstraintBase::distancePropertyKey: object->as<DistanceConstraintBase>()->distance(value); break; + case TransformComponentConstraintBase::copyFactorPropertyKey: + object->as<TransformComponentConstraintBase>()->copyFactor( + value); + break; + case TransformComponentConstraintBase::minValuePropertyKey: + object->as<TransformComponentConstraintBase>()->minValue( + value); + break; + case TransformComponentConstraintBase::maxValuePropertyKey: + object->as<TransformComponentConstraintBase>()->maxValue( + value); + break; + case TransformComponentConstraintYBase::copyFactorYPropertyKey: + object->as<TransformComponentConstraintYBase>() + ->copyFactorY(value); + break; + case TransformComponentConstraintYBase::minValueYPropertyKey: + object->as<TransformComponentConstraintYBase>()->minValueY( + value); + break; + case TransformComponentConstraintYBase::maxValueYPropertyKey: + object->as<TransformComponentConstraintYBase>()->maxValueY( + value); + break; case StateMachineNumberBase::valuePropertyKey: object->as<StateMachineNumberBase>()->value(value); break; @@ -598,9 +642,38 @@ { switch (propertyKey) { + case TransformComponentConstraintBase::offsetPropertyKey: + object->as<TransformComponentConstraintBase>()->offset( + value); + break; + case TransformComponentConstraintBase::doesCopyPropertyKey: + object->as<TransformComponentConstraintBase>()->doesCopy( + value); + break; + case TransformComponentConstraintBase::minPropertyKey: + object->as<TransformComponentConstraintBase>()->min(value); + break; + case TransformComponentConstraintBase::maxPropertyKey: + object->as<TransformComponentConstraintBase>()->max(value); + break; + case TransformComponentConstraintYBase::doesCopyYPropertyKey: + object->as<TransformComponentConstraintYBase>()->doesCopyY( + value); + break; + case TransformComponentConstraintYBase::minYPropertyKey: + object->as<TransformComponentConstraintYBase>()->minY( + value); + break; + case TransformComponentConstraintYBase::maxYPropertyKey: + object->as<TransformComponentConstraintYBase>()->maxY( + value); + break; case IKConstraintBase::invertDirectionPropertyKey: object->as<IKConstraintBase>()->invertDirection(value); break; + case KeyFrameBoolBase::valuePropertyKey: + object->as<KeyFrameBoolBase>()->value(value); + break; case LinearAnimationBase::enableWorkAreaPropertyKey: object->as<LinearAnimationBase>()->enableWorkArea(value); break; @@ -666,14 +739,18 @@ return object->as<TargetedConstraintBase>()->targetId(); case DistanceConstraintBase::modeValuePropertyKey: return object->as<DistanceConstraintBase>()->modeValue(); + case TransformSpaceConstraintBase::sourceSpaceValuePropertyKey: + return object->as<TransformSpaceConstraintBase>() + ->sourceSpaceValue(); + case TransformSpaceConstraintBase::destSpaceValuePropertyKey: + return object->as<TransformSpaceConstraintBase>() + ->destSpaceValue(); + case TransformComponentConstraintBase:: + minMaxSpaceValuePropertyKey: + return object->as<TransformComponentConstraintBase>() + ->minMaxSpaceValue(); case IKConstraintBase::parentBoneCountPropertyKey: return object->as<IKConstraintBase>()->parentBoneCount(); - case TransformConstraintBase::sourceSpaceValuePropertyKey: - return object->as<TransformConstraintBase>() - ->sourceSpaceValue(); - case TransformConstraintBase::destSpaceValuePropertyKey: - return object->as<TransformConstraintBase>() - ->destSpaceValue(); case AnimationStateBase::animationIdPropertyKey: return object->as<AnimationStateBase>()->animationId(); case KeyedObjectBase::objectIdPropertyKey: @@ -767,6 +844,24 @@ return object->as<ConstraintBase>()->strength(); case DistanceConstraintBase::distancePropertyKey: return object->as<DistanceConstraintBase>()->distance(); + case TransformComponentConstraintBase::copyFactorPropertyKey: + return object->as<TransformComponentConstraintBase>() + ->copyFactor(); + case TransformComponentConstraintBase::minValuePropertyKey: + return object->as<TransformComponentConstraintBase>() + ->minValue(); + case TransformComponentConstraintBase::maxValuePropertyKey: + return object->as<TransformComponentConstraintBase>() + ->maxValue(); + case TransformComponentConstraintYBase::copyFactorYPropertyKey: + return object->as<TransformComponentConstraintYBase>() + ->copyFactorY(); + case TransformComponentConstraintYBase::minValueYPropertyKey: + return object->as<TransformComponentConstraintYBase>() + ->minValueY(); + case TransformComponentConstraintYBase::maxValueYPropertyKey: + return object->as<TransformComponentConstraintYBase>() + ->maxValueY(); case StateMachineNumberBase::valuePropertyKey: return object->as<StateMachineNumberBase>()->value(); case TransitionNumberConditionBase::valuePropertyKey: @@ -912,8 +1007,31 @@ { switch (propertyKey) { + case TransformComponentConstraintBase::offsetPropertyKey: + return object->as<TransformComponentConstraintBase>() + ->offset(); + case TransformComponentConstraintBase::doesCopyPropertyKey: + return object->as<TransformComponentConstraintBase>() + ->doesCopy(); + case TransformComponentConstraintBase::minPropertyKey: + return object->as<TransformComponentConstraintBase>() + ->min(); + case TransformComponentConstraintBase::maxPropertyKey: + return object->as<TransformComponentConstraintBase>() + ->max(); + case TransformComponentConstraintYBase::doesCopyYPropertyKey: + return object->as<TransformComponentConstraintYBase>() + ->doesCopyY(); + case TransformComponentConstraintYBase::minYPropertyKey: + return object->as<TransformComponentConstraintYBase>() + ->minY(); + case TransformComponentConstraintYBase::maxYPropertyKey: + return object->as<TransformComponentConstraintYBase>() + ->maxY(); case IKConstraintBase::invertDirectionPropertyKey: return object->as<IKConstraintBase>()->invertDirection(); + case KeyFrameBoolBase::valuePropertyKey: + return object->as<KeyFrameBoolBase>()->value(); case LinearAnimationBase::enableWorkAreaPropertyKey: return object->as<LinearAnimationBase>()->enableWorkArea(); case StateMachineBoolBase::valuePropertyKey: @@ -957,9 +1075,11 @@ case DrawTargetBase::placementValuePropertyKey: case TargetedConstraintBase::targetIdPropertyKey: case DistanceConstraintBase::modeValuePropertyKey: + case TransformSpaceConstraintBase::sourceSpaceValuePropertyKey: + case TransformSpaceConstraintBase::destSpaceValuePropertyKey: + case TransformComponentConstraintBase:: + minMaxSpaceValuePropertyKey: case IKConstraintBase::parentBoneCountPropertyKey: - case TransformConstraintBase::sourceSpaceValuePropertyKey: - case TransformConstraintBase::destSpaceValuePropertyKey: case AnimationStateBase::animationIdPropertyKey: case KeyedObjectBase::objectIdPropertyKey: case BlendAnimationBase::animationIdPropertyKey: @@ -1003,6 +1123,12 @@ return CoreUintType::id; case ConstraintBase::strengthPropertyKey: case DistanceConstraintBase::distancePropertyKey: + case TransformComponentConstraintBase::copyFactorPropertyKey: + case TransformComponentConstraintBase::minValuePropertyKey: + case TransformComponentConstraintBase::maxValuePropertyKey: + case TransformComponentConstraintYBase::copyFactorYPropertyKey: + case TransformComponentConstraintYBase::minValueYPropertyKey: + case TransformComponentConstraintYBase::maxValueYPropertyKey: case StateMachineNumberBase::valuePropertyKey: case TransitionNumberConditionBase::valuePropertyKey: case CubicInterpolatorBase::x1PropertyKey: @@ -1072,7 +1198,15 @@ case TendonBase::txPropertyKey: case TendonBase::tyPropertyKey: return CoreDoubleType::id; + case TransformComponentConstraintBase::offsetPropertyKey: + case TransformComponentConstraintBase::doesCopyPropertyKey: + case TransformComponentConstraintBase::minPropertyKey: + case TransformComponentConstraintBase::maxPropertyKey: + case TransformComponentConstraintYBase::doesCopyYPropertyKey: + case TransformComponentConstraintYBase::minYPropertyKey: + case TransformComponentConstraintYBase::maxYPropertyKey: case IKConstraintBase::invertDirectionPropertyKey: + case KeyFrameBoolBase::valuePropertyKey: case LinearAnimationBase::enableWorkAreaPropertyKey: case StateMachineBoolBase::valuePropertyKey: case ShapePaintBase::isVisiblePropertyKey:
diff --git a/src/animation/keyframe_bool.cpp b/src/animation/keyframe_bool.cpp new file mode 100644 index 0000000..9144783 --- /dev/null +++ b/src/animation/keyframe_bool.cpp
@@ -0,0 +1,18 @@ +#include "rive/animation/keyframe_id.hpp" +#include "rive/generated/core_registry.hpp" + +using namespace rive; + +void KeyFrameBool::apply(Core* object, int propertyKey, float mix) +{ + CoreRegistry::setBool(object, propertyKey, value()); +} + +void KeyFrameBool::applyInterpolation(Core* object, + int propertyKey, + float currentTime, + const KeyFrame* nextFrame, + float mix) +{ + CoreRegistry::setBool(object, propertyKey, value()); +} \ No newline at end of file
diff --git a/src/constraints/rotation_constraint.cpp b/src/constraints/rotation_constraint.cpp new file mode 100644 index 0000000..a9fead0 --- /dev/null +++ b/src/constraints/rotation_constraint.cpp
@@ -0,0 +1,8 @@ +#include "rive/constraints/rotation_constraint.hpp" +#include "rive/transform_component.hpp" +#include "rive/math/mat2d.hpp" +#include <cmath> + +using namespace rive; + +void RotationConstraint::constrain(TransformComponent* component) {}
diff --git a/src/constraints/scale_constraint.cpp b/src/constraints/scale_constraint.cpp new file mode 100644 index 0000000..bcbc11f --- /dev/null +++ b/src/constraints/scale_constraint.cpp
@@ -0,0 +1,8 @@ +#include "rive/constraints/scale_constraint.hpp" +#include "rive/transform_component.hpp" +#include "rive/math/mat2d.hpp" +#include <cmath> + +using namespace rive; + +void ScaleConstraint::constrain(TransformComponent* component) {}
diff --git a/src/constraints/translation_constraint.cpp b/src/constraints/translation_constraint.cpp new file mode 100644 index 0000000..3e7bc3f --- /dev/null +++ b/src/constraints/translation_constraint.cpp
@@ -0,0 +1,8 @@ +#include "rive/constraints/translation_constraint.hpp" +#include "rive/transform_component.hpp" +#include "rive/math/mat2d.hpp" +#include <cmath> + +using namespace rive; + +void TranslationConstraint::constrain(TransformComponent* component) {}
diff --git a/src/generated/animation/keyframe_bool_base.cpp b/src/generated/animation/keyframe_bool_base.cpp new file mode 100644 index 0000000..e48d649 --- /dev/null +++ b/src/generated/animation/keyframe_bool_base.cpp
@@ -0,0 +1,11 @@ +#include "rive/generated/animation/keyframe_bool_base.hpp" +#include "rive/animation/keyframe_bool.hpp" + +using namespace rive; + +Core* KeyFrameBoolBase::clone() const +{ + auto cloned = new KeyFrameBool(); + cloned->copy(*this); + return cloned; +}
diff --git a/src/generated/constraints/rotation_constraint_base.cpp b/src/generated/constraints/rotation_constraint_base.cpp new file mode 100644 index 0000000..0dc03fd --- /dev/null +++ b/src/generated/constraints/rotation_constraint_base.cpp
@@ -0,0 +1,11 @@ +#include "rive/generated/constraints/rotation_constraint_base.hpp" +#include "rive/constraints/rotation_constraint.hpp" + +using namespace rive; + +Core* RotationConstraintBase::clone() const +{ + auto cloned = new RotationConstraint(); + cloned->copy(*this); + return cloned; +}
diff --git a/src/generated/constraints/scale_constraint_base.cpp b/src/generated/constraints/scale_constraint_base.cpp new file mode 100644 index 0000000..810c95e --- /dev/null +++ b/src/generated/constraints/scale_constraint_base.cpp
@@ -0,0 +1,11 @@ +#include "rive/generated/constraints/scale_constraint_base.hpp" +#include "rive/constraints/scale_constraint.hpp" + +using namespace rive; + +Core* ScaleConstraintBase::clone() const +{ + auto cloned = new ScaleConstraint(); + cloned->copy(*this); + return cloned; +}
diff --git a/src/generated/constraints/translation_constraint_base.cpp b/src/generated/constraints/translation_constraint_base.cpp new file mode 100644 index 0000000..3093023 --- /dev/null +++ b/src/generated/constraints/translation_constraint_base.cpp
@@ -0,0 +1,11 @@ +#include "rive/generated/constraints/translation_constraint_base.hpp" +#include "rive/constraints/translation_constraint.hpp" + +using namespace rive; + +Core* TranslationConstraintBase::clone() const +{ + auto cloned = new TranslationConstraint(); + cloned->copy(*this); + return cloned; +}