1 #ifndef DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H
2 #define DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H
5 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
25 #include <dali/internal/common/matrix-utils.h>
26 #include <dali/internal/common/message.h>
27 #include <dali/internal/event/common/event-thread-services.h>
28 #include <dali/internal/event/common/property-input-impl.h>
29 #include <dali/internal/update/common/double-buffered.h>
30 #include <dali/internal/update/common/property-base.h>
31 #include <dali/internal/update/common/scene-graph-buffers.h>
32 #include <dali/public-api/common/dali-common.h>
33 #include <dali/public-api/object/property-input.h>
34 #include <dali/public-api/object/property-types.h>
35 #include <dali/public-api/object/property.h>
44 * Dirty flags record whether an animatable property has changed.
45 * In the frame following a change, the property is reset to a base value.
47 * If the property was "Baked", then the base value matches the (double-buffered) value from the previous frame.
48 * Therefore when reset, the property is flagged as "clean".
50 * However if the property was only "Set" (and not "Baked"), then typically the base value and previous value will not match.
51 * In this case the reset operation is equivalent to a "Bake", and the value is considered "dirty" for an additional frame.
53 static const uint32_t CLEAN_FLAG = 0x00; ///< Indicates that the value did not change in this, or the previous frame
54 static const uint32_t BAKED_FLAG = 0x01; ///< Indicates that the value was Baked during the previous frame
55 static const uint32_t SET_FLAG = 0x02; ///< Indicates that the value was Set during the previous frame
56 static const uint32_t RESET_FLAG = 0x02; ///< Indicates that the value should be reset to the base value in the next two frames
59 class AnimatableProperty;
62 * Base class to reduce code size from the templates.
64 class AnimatablePropertyBase : public PropertyBase
68 * Constructor, initialize the dirty flag
70 AnimatablePropertyBase()
72 mDirtyFlags(BAKED_FLAG)
79 ~AnimatablePropertyBase() override = default;
81 protected: // for derived classes
83 * Flag that the property has been Set during the current frame.
87 mDirtyFlags = SET_FLAG;
91 * Flag that the property has been Baked during the current frame.
95 mDirtyFlags = BAKED_FLAG;
100 * Mark the property as dirty so that it will be reset to the base value in the next two frames.
104 mDirtyFlags = RESET_FLAG;
107 public: // From PropertyBase
109 * @copydoc Dali::Internal::SceneGraph::PropertyBase::IsClean()
111 bool IsClean() const override
113 return (CLEAN_FLAG == mDirtyFlags);
117 * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
119 bool InputInitialized() const override
121 return true; // Animatable properties are always valid
124 protected: // so that ResetToBaseValue can set it directly
125 uint32_t mDirtyFlags; ///< Flag whether value changed during previous 2 frames
129 * An boolean animatable property of a scene-graph object.
132 class AnimatableProperty<bool> : public AnimatablePropertyBase
136 * Create an animatable property.
137 * @param [in] initialValue The initial value of the property.
139 AnimatableProperty(bool initialValue)
140 : mValue(initialValue),
141 mBaseValue(initialValue)
146 * Virtual destructor.
148 ~AnimatableProperty() override = default;
151 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
153 Dali::Property::Type GetType() const override
155 return Dali::PropertyTypes::Get<bool>();
159 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
161 void ResetToBaseValue(BufferIndex updateBufferIndex) override
163 if(CLEAN_FLAG != mDirtyFlags)
165 mValue[updateBufferIndex] = mBaseValue;
167 mDirtyFlags = (mDirtyFlags >> 1);
172 * @copydoc Dali::Internal::PropertyInputImpl::GetBoolean()
174 const bool& GetBoolean(BufferIndex bufferIndex) const override
176 return mValue[bufferIndex];
180 * Set the property value. This will only persist for the current frame; the property
181 * will be reset with the base value, at the beginning of the next frame.
182 * @param[in] bufferIndex The buffer to write.
183 * @param[in] value The new property value.
185 void Set(BufferIndex bufferIndex, bool value)
187 // check if the value actually changed to avoid dirtying nodes unnecessarily
188 if(mValue[bufferIndex] != value)
190 mValue[bufferIndex] = value;
197 * Change the property value by a relative amount.
198 * @param[in] bufferIndex The buffer to write.
199 * @param[in] delta The property will change by this amount.
201 void SetRelative(BufferIndex bufferIndex, bool delta)
203 // check if the value actually changed to avoid dirtying nodes unnecessarily
204 // false + false does not change value, true + false does not either
205 if(delta && !mValue[bufferIndex])
207 mValue[bufferIndex] = delta;
214 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
216 bool& Get(BufferIndex bufferIndex)
218 return mValue[bufferIndex];
222 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
224 const bool& Get(BufferIndex bufferIndex) const
226 return mValue[bufferIndex];
230 * Retrieve the property value.
231 * @param[in] bufferIndex The buffer to read.
232 * @return The property value.
234 bool& operator[](BufferIndex bufferIndex)
236 return mValue[bufferIndex];
240 * Retrieve the property value.
241 * @param[in] bufferIndex The buffer to read.
242 * @return The property value.
244 const bool& operator[](BufferIndex bufferIndex) const
246 return mValue[bufferIndex];
250 * Set both the property value & base value.
251 * @param[in] bufferIndex The buffer to write for the property value.
252 * @param[in] value The new property value.
254 void Bake(BufferIndex bufferIndex, bool value)
256 // bake has to check the base value as current buffer value can be correct by constraint or something else
257 if(mBaseValue != value)
260 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
261 // has never been atomically safe.
262 mValue[bufferIndex] = value;
263 mValue[1 - bufferIndex] = value;
270 * Change the property value & base value by a relative amount.
271 * @param[in] bufferIndex The buffer to write for the local property value.
272 * @param[in] delta The property will change by this amount.
274 void BakeRelative(BufferIndex bufferIndex, bool delta)
276 mValue[bufferIndex] = mValue[bufferIndex] || delta;
277 mBaseValue = mValue[bufferIndex];
284 AnimatableProperty(const AnimatableProperty& property);
287 AnimatableProperty& operator=(const AnimatableProperty& rhs);
290 DoubleBuffered<bool> mValue; ///< The double-buffered property value
291 bool mBaseValue; ///< Reset to this base value at the beginning of each frame
295 * An integer animatable property of a scene-graph object.
298 class AnimatableProperty<int> : public AnimatablePropertyBase
302 * Create an animatable property.
303 * @param [in] initialValue The initial value of the property.
305 AnimatableProperty(int initialValue)
306 : mValue(initialValue),
307 mBaseValue(initialValue)
312 * Virtual destructor.
314 ~AnimatableProperty() override = default;
317 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
319 Dali::Property::Type GetType() const override
321 return Dali::PropertyTypes::Get<int>();
325 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
327 void ResetToBaseValue(BufferIndex updateBufferIndex) override
329 if(CLEAN_FLAG != mDirtyFlags)
331 mValue[updateBufferIndex] = mBaseValue;
333 mDirtyFlags = (mDirtyFlags >> 1);
338 * @copydoc Dali::Internal::PropertyInputImpl::GetInteger()
340 const int& GetInteger(BufferIndex bufferIndex) const override
342 return mValue[bufferIndex];
346 * Set the property value. This will only persist for the current frame; the property
347 * will be reset with the base value, at the beginning of the next frame.
348 * @param[in] bufferIndex The buffer to write.
349 * @param[in] value The new property value.
351 void Set(BufferIndex bufferIndex, int value)
353 mValue[bufferIndex] = value;
359 * Change the property value by a relative amount.
360 * @param[in] bufferIndex The buffer to write.
361 * @param[in] delta The property will change by this amount.
363 void SetRelative(BufferIndex bufferIndex, int delta)
365 mValue[bufferIndex] = mValue[bufferIndex] + delta;
371 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
373 int& Get(BufferIndex bufferIndex)
375 return mValue[bufferIndex];
379 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
381 const int& Get(BufferIndex bufferIndex) const
383 return mValue[bufferIndex];
387 * Retrieve the property value.
388 * @param[in] bufferIndex The buffer to read.
389 * @return The property value.
391 int& operator[](BufferIndex bufferIndex)
393 return mValue[bufferIndex];
397 * Retrieve the property value.
398 * @param[in] bufferIndex The buffer to read.
399 * @return The property value.
401 const int& operator[](BufferIndex bufferIndex) const
403 return mValue[bufferIndex];
407 * Set both the property value & base value.
408 * @param[in] bufferIndex The buffer to write for the property value.
409 * @param[in] value The new property value.
411 void Bake(BufferIndex bufferIndex, int value)
413 mValue[bufferIndex] = value;
414 mValue[1 - bufferIndex] = value;
415 mBaseValue = mValue[bufferIndex];
421 * Change the property value & base value by a relative amount.
422 * @param[in] bufferIndex The buffer to write for the local property value.
423 * @param[in] delta The property will change by this amount.
425 void BakeRelative(BufferIndex bufferIndex, int delta)
427 mValue[bufferIndex] = mValue[bufferIndex] + delta;
428 mBaseValue = mValue[bufferIndex];
434 * Sets both double-buffered values & the base value.
435 * This should only be used when the owning object has not been connected to the scene-graph.
436 * @param[in] value The new property value.
438 void SetInitial(const int& value)
441 mValue[1] = mValue[0];
442 mBaseValue = mValue[0];
446 * Change both double-buffered values & the base value by a relative amount.
447 * This should only be used when the owning object has not been connected to the scene-graph.
448 * @param[in] delta The property will change by this amount.
450 void SetInitialRelative(const int& delta)
452 mValue[0] = mValue[0] + delta;
453 mValue[1] = mValue[0];
454 mBaseValue = mValue[0];
459 AnimatableProperty(const AnimatableProperty& property);
462 AnimatableProperty& operator=(const AnimatableProperty& rhs);
465 DoubleBuffered<int> mValue; ///< The double-buffered property value
466 int mBaseValue; ///< Reset to this base value at the beginning of each frame
470 * An float animatable property of a scene-graph object.
473 class AnimatableProperty<float> : public AnimatablePropertyBase
477 * Create an animatable property.
478 * @param [in] initialValue The initial value of the property.
480 AnimatableProperty(float initialValue)
481 : mValue(initialValue),
482 mBaseValue(initialValue)
487 * Virtual destructor.
489 ~AnimatableProperty() override = default;
492 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
494 Dali::Property::Type GetType() const override
496 return Dali::PropertyTypes::Get<float>();
500 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
502 void ResetToBaseValue(BufferIndex updateBufferIndex) override
504 if(CLEAN_FLAG != mDirtyFlags)
506 mValue[updateBufferIndex] = mBaseValue;
508 mDirtyFlags = (mDirtyFlags >> 1);
513 * @copydoc Dali::Internal::PropertyInputImpl::GetFloat()
515 const float& GetFloat(BufferIndex bufferIndex) const override
517 return mValue[bufferIndex];
521 * Set the property value. This will only persist for the current frame; the property
522 * will be reset with the base value, at the beginning of the next frame.
523 * @param[in] bufferIndex The buffer to write.
524 * @param[in] value The new property value.
526 void Set(BufferIndex bufferIndex, float value)
528 mValue[bufferIndex] = value;
534 * Change the property value by a relative amount.
535 * @param[in] bufferIndex The buffer to write.
536 * @param[in] delta The property will change by this amount.
538 void SetRelative(BufferIndex bufferIndex, float delta)
540 mValue[bufferIndex] = mValue[bufferIndex] + delta;
546 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
548 float& Get(BufferIndex bufferIndex)
550 return mValue[bufferIndex];
554 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
556 const float& Get(BufferIndex bufferIndex) const
558 return mValue[bufferIndex];
562 * Retrieve the property value.
563 * @param[in] bufferIndex The buffer to read.
564 * @return The property value.
566 float& operator[](BufferIndex bufferIndex)
568 return mValue[bufferIndex];
572 * Retrieve the property value.
573 * @param[in] bufferIndex The buffer to read.
574 * @return The property value.
576 const float& operator[](BufferIndex bufferIndex) const
578 return mValue[bufferIndex];
582 * Set both the property value & base value.
583 * @param[in] bufferIndex The buffer to write for the property value.
584 * @param[in] value The new property value.
586 void Bake(BufferIndex bufferIndex, float value)
588 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
589 // has never been atomically safe.
590 mValue[bufferIndex] = value;
591 mValue[1 - bufferIndex] = value;
592 mBaseValue = mValue[bufferIndex];
598 * Change the property value & base value by a relative amount.
599 * @param[in] bufferIndex The buffer to write for the local property value.
600 * @param[in] delta The property will change by this amount.
602 void BakeRelative(BufferIndex bufferIndex, float delta)
604 mValue[bufferIndex] = mValue[bufferIndex] + delta;
605 mBaseValue = mValue[bufferIndex];
611 * Sets both double-buffered values & the base value.
612 * This should only be used when the owning object has not been connected to the scene-graph.
613 * @param[in] value The new property value.
615 void SetInitial(const float& value)
618 mValue[1] = mValue[0];
619 mBaseValue = mValue[0];
623 * Change both double-buffered values & the base value by a relative amount.
624 * This should only be used when the owning object has not been connected to the scene-graph.
625 * @param[in] delta The property will change by this amount.
627 void SetInitialRelative(const float& delta)
629 mValue[0] = mValue[0] + delta;
630 mValue[1] = mValue[0];
631 mBaseValue = mValue[0];
636 AnimatableProperty(const AnimatableProperty& property);
639 AnimatableProperty& operator=(const AnimatableProperty& rhs);
642 DoubleBuffered<float> mValue; ///< The double-buffered property value
643 float mBaseValue; ///< Reset to this base value at the beginning of each frame
647 * An Vector2 animatable property of a scene-graph object.
650 class AnimatableProperty<Vector2> : public AnimatablePropertyBase
654 * Create an animatable property.
655 * @param [in] initialValue The initial value of the property.
657 AnimatableProperty(const Vector2& initialValue)
658 : mValue(initialValue),
659 mBaseValue(initialValue)
664 * Virtual destructor.
666 ~AnimatableProperty() override = default;
669 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
671 Dali::Property::Type GetType() const override
673 return Dali::PropertyTypes::Get<Vector2>();
677 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
679 void ResetToBaseValue(BufferIndex updateBufferIndex) override
681 if(CLEAN_FLAG != mDirtyFlags)
683 mValue[updateBufferIndex] = mBaseValue;
685 mDirtyFlags = (mDirtyFlags >> 1);
690 * @copydoc Dali::PropertyInput::GetVector2()
692 const Vector2& GetVector2(BufferIndex bufferIndex) const override
694 return mValue[bufferIndex];
698 * Set the property value. This will only persist for the current frame; the property
699 * will be reset with the base value, at the beginning of the next frame.
700 * @param[in] bufferIndex The buffer to write.
701 * @param[in] value The new property value.
703 void Set(BufferIndex bufferIndex, const Vector2& value)
705 mValue[bufferIndex] = value;
711 * Set the property value. This will only persist for the current frame; the property
712 * will be reset with the base value, at the beginning of the next frame.
713 * @param[in] bufferIndex The buffer to write.
714 * @param[in] value The new X value.
716 void SetX(BufferIndex bufferIndex, float value)
718 mValue[bufferIndex].x = value;
724 * Set the property value. This will only persist for the current frame; the property
725 * will be reset with the base value, at the beginning of the next frame.
726 * @param[in] bufferIndex The buffer to write.
727 * @param[in] value The new Y value.
729 void SetY(BufferIndex bufferIndex, float value)
731 mValue[bufferIndex].y = value;
737 * Change the property value by a relative amount.
738 * @param[in] bufferIndex The buffer to write.
739 * @param[in] delta The property will change by this amount.
741 void SetRelative(BufferIndex bufferIndex, const Vector2& delta)
743 mValue[bufferIndex] += delta;
749 * Change the X value by a relative amount.
750 * @param[in] bufferIndex The buffer to write.
751 * @param[in] delta The X value will change by this amount.
753 void SetXRelative(BufferIndex bufferIndex, float delta)
755 mValue[bufferIndex].x += delta;
761 * Change the Y value by a relative amount.
762 * @param[in] bufferIndex The buffer to write.
763 * @param[in] delta The Y value will change by this amount.
765 void SetYRelative(BufferIndex bufferIndex, float delta)
767 mValue[bufferIndex].y += delta;
773 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
775 Vector2& Get(BufferIndex bufferIndex)
777 return mValue[bufferIndex];
781 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
783 const Vector2& Get(BufferIndex bufferIndex) const
785 return mValue[bufferIndex];
789 * Retrieve the property value.
790 * @param[in] bufferIndex The buffer to read.
791 * @return The property value.
793 Vector2& operator[](BufferIndex bufferIndex)
795 return mValue[bufferIndex];
799 * Retrieve the property value.
800 * @param[in] bufferIndex The buffer to read.
801 * @return The property value.
803 const Vector2& operator[](BufferIndex bufferIndex) const
805 return mValue[bufferIndex];
809 * Set both the property value & base value.
810 * @param[in] bufferIndex The buffer to write for the property value.
811 * @param[in] value The new property value.
813 void Bake(BufferIndex bufferIndex, const Vector2& value)
815 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
816 // has never been atomically safe.
817 mValue[bufferIndex] = value;
818 mValue[1 - bufferIndex] = value;
825 * Set both the X value & base X value.
826 * @param[in] bufferIndex The buffer to write for the property value.
827 * @param[in] value The new property value.
829 void BakeX(BufferIndex bufferIndex, float value)
831 mValue[bufferIndex].x = value;
832 mValue[1 - bufferIndex].x = value;
833 mBaseValue.x = value;
839 * Set both the Y value & base Y value.
840 * @param[in] bufferIndex The buffer to write for the property value.
841 * @param[in] value The new property value.
843 void BakeY(BufferIndex bufferIndex, float value)
845 mValue[bufferIndex].y = value;
846 mValue[1 - bufferIndex].y = value;
847 mBaseValue.y = value;
853 * Change the property value & base value by a relative amount.
854 * @param[in] bufferIndex The buffer to write for the local property value.
855 * @param[in] delta The property will change by this amount.
857 void BakeRelative(BufferIndex bufferIndex, const Vector2& delta)
859 mValue[bufferIndex] += delta;
860 mBaseValue = mValue[bufferIndex];
866 * Change the X value & base X value by a relative amount.
867 * @param[in] bufferIndex The buffer to write for the local property value.
868 * @param[in] delta The X value will change by this amount.
870 void BakeXRelative(BufferIndex bufferIndex, float delta)
872 mValue[bufferIndex].x += delta;
873 mBaseValue.x = mValue[bufferIndex].x;
879 * Change the Y value & base Y value by a relative amount.
880 * @param[in] bufferIndex The buffer to write for the local property value.
881 * @param[in] delta The Y value will change by this amount.
883 void BakeYRelative(BufferIndex bufferIndex, float delta)
885 mValue[bufferIndex].y += delta;
886 mBaseValue.y = mValue[bufferIndex].y;
893 AnimatableProperty(const AnimatableProperty& property);
896 AnimatableProperty& operator=(const AnimatableProperty& rhs);
899 DoubleBuffered<Vector2> mValue; ///< The double-buffered property value
900 Vector2 mBaseValue; ///< Reset to this base value at the beginning of each frame
904 * A Vector3 animatable property of a scene-graph object.
907 class AnimatableProperty<Vector3> : public AnimatablePropertyBase
911 * Create an animatable property.
920 * Create an animatable property.
921 * @param [in] initialValue The initial value of the property.
923 AnimatableProperty(const Vector3& initialValue)
924 : mValue(initialValue),
925 mBaseValue(initialValue)
930 * Virtual destructor.
932 ~AnimatableProperty() override = default;
935 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
937 Dali::Property::Type GetType() const override
939 return Dali::PropertyTypes::Get<Vector3>();
943 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
945 void ResetToBaseValue(BufferIndex updateBufferIndex) override
947 if(CLEAN_FLAG != mDirtyFlags)
949 mValue[updateBufferIndex] = mBaseValue;
951 mDirtyFlags = (mDirtyFlags >> 1);
956 * @copydoc Dali::PropertyInput::GetVector3()
958 const Vector3& GetVector3(BufferIndex bufferIndex) const override
960 return mValue[bufferIndex];
964 * Set the property value. This will only persist for the current frame; the property
965 * will be reset with the base value, at the beginning of the next frame.
966 * @param[in] bufferIndex The buffer to write.
967 * @param[in] value The new property value.
969 void Set(BufferIndex bufferIndex, const Vector3& value)
971 mValue[bufferIndex] = value;
977 * Set the property value. This will only persist for the current frame; the property
978 * will be reset with the base value, at the beginning of the next frame.
979 * @param[in] bufferIndex The buffer to write.
980 * @param[in] value The new X value.
982 void SetX(BufferIndex bufferIndex, float value)
984 mValue[bufferIndex].x = value;
990 * Set the property value. This will only persist for the current frame; the property
991 * will be reset with the base value, at the beginning of the next frame.
992 * @param[in] bufferIndex The buffer to write.
993 * @param[in] value The new Y value.
995 void SetY(BufferIndex bufferIndex, float value)
997 mValue[bufferIndex].y = value;
1003 * Set the property value. This will only persist for the current frame; the property
1004 * will be reset with the base value, at the beginning of the next frame.
1005 * @param[in] bufferIndex The buffer to write.
1006 * @param[in] value The new Z value.
1008 void SetZ(BufferIndex bufferIndex, float value)
1010 mValue[bufferIndex].z = value;
1016 * Change the property value by a relative amount.
1017 * @param[in] bufferIndex The buffer to write.
1018 * @param[in] delta The property will change by this amount.
1020 void SetRelative(BufferIndex bufferIndex, const Vector3& delta)
1022 mValue[bufferIndex] += delta;
1028 * Change the X value by a relative amount.
1029 * @param[in] bufferIndex The buffer to write.
1030 * @param[in] delta The X value will change by this amount.
1032 void SetXRelative(BufferIndex bufferIndex, float delta)
1034 mValue[bufferIndex].x += delta;
1040 * Change the Y value by a relative amount.
1041 * @param[in] bufferIndex The buffer to write.
1042 * @param[in] delta The Y value will change by this amount.
1044 void SetYRelative(BufferIndex bufferIndex, float delta)
1046 mValue[bufferIndex].y += delta;
1052 * Change the Z value by a relative amount.
1053 * @param[in] bufferIndex The buffer to write.
1054 * @param[in] delta The Z value will change by this amount.
1056 void SetZRelative(BufferIndex bufferIndex, float delta)
1058 mValue[bufferIndex].z += delta;
1064 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1066 Vector3& Get(BufferIndex bufferIndex)
1068 return mValue[bufferIndex];
1072 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1074 const Vector3& Get(BufferIndex bufferIndex) const
1076 return mValue[bufferIndex];
1080 * Retrieve the property value.
1081 * @param[in] bufferIndex The buffer to read.
1082 * @return The property value.
1084 Vector3& operator[](BufferIndex bufferIndex)
1086 return mValue[bufferIndex];
1090 * Retrieve the property value.
1091 * @param[in] bufferIndex The buffer to read.
1092 * @return The property value.
1094 const Vector3& operator[](BufferIndex bufferIndex) const
1096 return mValue[bufferIndex];
1100 * Set both the property value & base value.
1101 * @param[in] bufferIndex The buffer to write for the property value.
1102 * @param[in] value The new property value.
1104 void Bake(BufferIndex bufferIndex, const Vector3& value)
1106 mValue[bufferIndex] = value;
1107 mValue[1 - bufferIndex] = value;
1114 * Set both the X value & base X value.
1115 * @param[in] bufferIndex The buffer to write for the property value.
1116 * @param[in] value The new property value.
1118 void BakeX(BufferIndex bufferIndex, float value)
1120 mValue[bufferIndex].x = value;
1121 mValue[1 - bufferIndex].x = value;
1122 mBaseValue.x = value;
1128 * Set both the Y value & base Y value.
1129 * @param[in] bufferIndex The buffer to write for the property value.
1130 * @param[in] value The new property value.
1132 void BakeY(BufferIndex bufferIndex, float value)
1134 mValue[bufferIndex].y = value;
1135 mValue[1 - bufferIndex].y = value;
1136 mBaseValue.y = value;
1142 * Set both the Z value & base Z value.
1143 * @param[in] bufferIndex The buffer to write for the property value.
1144 * @param[in] value The new property value.
1146 void BakeZ(BufferIndex bufferIndex, float value)
1148 mValue[bufferIndex].z = value;
1149 mValue[1 - bufferIndex].z = value;
1150 mBaseValue.z = value;
1156 * Change the property value & base value by a relative amount.
1157 * @param[in] bufferIndex The buffer to write for the local property value.
1158 * @param[in] delta The property will change by this amount.
1160 void BakeRelative(BufferIndex bufferIndex, const Vector3& delta)
1162 mValue[bufferIndex] += delta;
1163 mBaseValue = mValue[bufferIndex];
1169 * Change the property value & base value by a relative amount.
1170 * @param[in] bufferIndex The buffer to write for the local property value.
1171 * @param[in] delta The property will change by this amount.
1173 void BakeRelativeMultiply(BufferIndex bufferIndex, const Vector3& delta)
1175 mValue[bufferIndex] *= delta;
1176 mBaseValue = mValue[bufferIndex];
1182 * Change the X value & base X value by a relative amount.
1183 * @param[in] bufferIndex The buffer to write for the local property value.
1184 * @param[in] delta The X value will change by this amount.
1186 void BakeXRelative(BufferIndex bufferIndex, float delta)
1188 mValue[bufferIndex].x += delta;
1189 mBaseValue.x = mValue[bufferIndex].x;
1195 * Change the Y value & base Y value by a relative amount.
1196 * @param[in] bufferIndex The buffer to write for the local property value.
1197 * @param[in] delta The Y value will change by this amount.
1199 void BakeYRelative(BufferIndex bufferIndex, float delta)
1201 mValue[bufferIndex].y += delta;
1202 mBaseValue.y = mValue[bufferIndex].y;
1208 * Change the Z value & base Z value by a relative amount.
1209 * @param[in] bufferIndex The buffer to write for the local property value.
1210 * @param[in] delta The Z value will change by this amount.
1212 void BakeZRelative(BufferIndex bufferIndex, float delta)
1214 mValue[bufferIndex].z += delta;
1215 mBaseValue.z = mValue[bufferIndex].z;
1222 AnimatableProperty(const AnimatableProperty& property);
1225 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1228 DoubleBuffered<Vector3> mValue; ///< The double-buffered property value
1229 Vector3 mBaseValue; ///< Reset to this base value at the beginning of each frame
1233 * A Vector4 animatable property of a scene-graph object.
1236 class AnimatableProperty<Vector4> : public AnimatablePropertyBase
1240 * Create an animatable property.
1241 * @param [in] initialValue The initial value of the property.
1243 AnimatableProperty(const Vector4& initialValue)
1244 : mValue(initialValue),
1245 mBaseValue(initialValue)
1250 * Virtual destructor.
1252 ~AnimatableProperty() override = default;
1255 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1257 Dali::Property::Type GetType() const override
1259 return Dali::PropertyTypes::Get<Vector4>();
1263 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1265 void ResetToBaseValue(BufferIndex updateBufferIndex) override
1267 if(CLEAN_FLAG != mDirtyFlags)
1269 mValue[updateBufferIndex] = mBaseValue;
1271 mDirtyFlags = (mDirtyFlags >> 1);
1276 * @copydoc Dali::PropertyInput::GetVector4()
1278 const Vector4& GetVector4(BufferIndex bufferIndex) const override
1280 return mValue[bufferIndex];
1284 * Set the property value. This will only persist for the current frame; the property
1285 * will be reset with the base value, at the beginning of the next frame.
1286 * @param[in] bufferIndex The buffer to write.
1287 * @param[in] value The new property value.
1289 void Set(BufferIndex bufferIndex, const Vector4& value)
1291 mValue[bufferIndex] = value;
1297 * Set the X value. This will only persist for the current frame; the property
1298 * will be reset with the base value, at the beginning of the next frame.
1299 * @param[in] bufferIndex The buffer to write.
1300 * @param[in] value The new X value.
1302 void SetX(BufferIndex bufferIndex, float value)
1304 mValue[bufferIndex].x = value;
1310 * Set the Y value. This will only persist for the current frame; the property
1311 * will be reset with the base value, at the beginning of the next frame.
1312 * @param[in] bufferIndex The buffer to write.
1313 * @param[in] value The new Y value.
1315 void SetY(BufferIndex bufferIndex, float value)
1317 mValue[bufferIndex].y = value;
1323 * Set the Z value. This will only persist for the current frame; the property
1324 * will be reset with the base value, at the beginning of the next frame.
1325 * @param[in] bufferIndex The buffer to write.
1326 * @param[in] value The new Z value.
1328 void SetZ(BufferIndex bufferIndex, float value)
1330 mValue[bufferIndex].z = value;
1336 * Set the W value. This will only persist for the current frame; the property
1337 * will be reset with the base value, at the beginning of the next frame.
1338 * @param[in] bufferIndex The buffer to write.
1339 * @param[in] value The new W value.
1341 void SetW(BufferIndex bufferIndex, float value)
1343 mValue[bufferIndex].w = value;
1349 * Change the property value by a relative amount.
1350 * @param[in] bufferIndex The buffer to write.
1351 * @param[in] delta The property will change by this amount.
1353 void SetRelative(BufferIndex bufferIndex, const Vector4& delta)
1355 mValue[bufferIndex] = mValue[bufferIndex] + delta;
1361 * Change the X value by a relative amount.
1362 * @param[in] bufferIndex The buffer to write.
1363 * @param[in] delta The X value will change by this amount.
1365 void SetXRelative(BufferIndex bufferIndex, float delta)
1367 mValue[bufferIndex].x = mValue[bufferIndex].x + delta;
1373 * Change the Y value by a relative amount.
1374 * @param[in] bufferIndex The buffer to write.
1375 * @param[in] delta The Y value will change by this amount.
1377 void SetYRelative(BufferIndex bufferIndex, float delta)
1379 mValue[bufferIndex].y = mValue[bufferIndex].y + delta;
1385 * Change the Z value by a relative amount.
1386 * @param[in] bufferIndex The buffer to write.
1387 * @param[in] delta The Z value will change by this amount.
1389 void SetZRelative(BufferIndex bufferIndex, float delta)
1391 mValue[bufferIndex].z = mValue[bufferIndex].z + delta;
1397 * Change the W value by a relative amount.
1398 * @param[in] bufferIndex The buffer to write.
1399 * @param[in] delta The W value will change by this amount.
1401 void SetWRelative(BufferIndex bufferIndex, float delta)
1403 mValue[bufferIndex].w = mValue[bufferIndex].w + delta;
1409 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1411 Vector4& Get(BufferIndex bufferIndex)
1413 return mValue[bufferIndex];
1417 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1419 const Vector4& Get(BufferIndex bufferIndex) const
1421 return mValue[bufferIndex];
1425 * Retrieve the property value.
1426 * @param[in] bufferIndex The buffer to read.
1427 * @return The property value.
1429 Vector4& operator[](BufferIndex bufferIndex)
1431 return mValue[bufferIndex];
1435 * Retrieve the property value.
1436 * @param[in] bufferIndex The buffer to read.
1437 * @return The property value.
1439 const Vector4& operator[](BufferIndex bufferIndex) const
1441 return mValue[bufferIndex];
1445 * Set both the property value & base value.
1446 * @param[in] bufferIndex The buffer to write for the property value.
1447 * @param[in] value The new property value.
1449 void Bake(BufferIndex bufferIndex, const Vector4& value)
1451 mValue[bufferIndex] = value;
1452 mValue[1 - bufferIndex] = value;
1453 mBaseValue = mValue[bufferIndex];
1459 * Set both the X value & base X value.
1460 * @param[in] bufferIndex The buffer to write for the property value.
1461 * @param[in] value The new property value.
1463 void BakeX(BufferIndex bufferIndex, float value)
1465 mValue[bufferIndex].x = value;
1466 mValue[1 - bufferIndex].x = value;
1467 mBaseValue.x = mValue[bufferIndex].x;
1473 * Set both the Y value & base Y value.
1474 * @param[in] bufferIndex The buffer to write for the property value.
1475 * @param[in] value The new property value.
1477 void BakeY(BufferIndex bufferIndex, float value)
1479 mValue[bufferIndex].y = value;
1480 mValue[1 - bufferIndex].y = value;
1481 mBaseValue.y = mValue[bufferIndex].y;
1487 * Set both the Z value & base Z value.
1488 * @param[in] bufferIndex The buffer to write for the property value.
1489 * @param[in] value The new property value.
1491 void BakeZ(BufferIndex bufferIndex, float value)
1493 mValue[bufferIndex].z = value;
1494 mValue[1 - bufferIndex].z = value;
1495 mBaseValue.z = mValue[bufferIndex].z;
1501 * Set both the W value & base W value.
1502 * @param[in] bufferIndex The buffer to write for the property value.
1503 * @param[in] value The new property value.
1505 void BakeW(BufferIndex bufferIndex, float value)
1507 mValue[bufferIndex].w = value;
1508 mValue[1 - bufferIndex].w = value;
1509 mBaseValue.w = mValue[bufferIndex].w;
1515 * Change the property value & base value by a relative amount.
1516 * @param[in] bufferIndex The buffer to write for the local property value.
1517 * @param[in] delta The property will change by this amount.
1519 void BakeRelative(BufferIndex bufferIndex, const Vector4& delta)
1521 mValue[bufferIndex] = mValue[bufferIndex] + delta;
1522 mBaseValue = mValue[bufferIndex];
1528 * Change the X value & base X value by a relative amount.
1529 * @param[in] bufferIndex The buffer to write for the local property value.
1530 * @param[in] delta The X value will change by this amount.
1532 void BakeXRelative(BufferIndex bufferIndex, float delta)
1534 mValue[bufferIndex].x = mValue[bufferIndex].x + delta;
1535 mBaseValue.x = mValue[bufferIndex].x;
1541 * Change the Y value & base Y value by a relative amount.
1542 * @param[in] bufferIndex The buffer to write for the local property value.
1543 * @param[in] delta The Y value will change by this amount.
1545 void BakeYRelative(BufferIndex bufferIndex, float delta)
1547 mValue[bufferIndex].y = mValue[bufferIndex].y + delta;
1548 mBaseValue.y = mValue[bufferIndex].y;
1554 * Change the Z value & base Z value by a relative amount.
1555 * @param[in] bufferIndex The buffer to write for the local property value.
1556 * @param[in] delta The Z value will change by this amount.
1558 void BakeZRelative(BufferIndex bufferIndex, float delta)
1560 mValue[bufferIndex].z = mValue[bufferIndex].z + delta;
1561 mBaseValue.z = mValue[bufferIndex].z;
1567 * Change the W value & base W value by a relative amount.
1568 * @param[in] bufferIndex The buffer to write for the local property value.
1569 * @param[in] delta The W value will change by this amount.
1571 void BakeWRelative(BufferIndex bufferIndex, float delta)
1573 mValue[bufferIndex].w = mValue[bufferIndex].w + delta;
1574 mBaseValue.w = mValue[bufferIndex].w;
1580 * Sets both double-buffered W values & the base W value.
1581 * This should only be used when the owning object has not been connected to the scene-graph.
1582 * @param[in] value The new W value.
1584 void SetWInitial(float value)
1586 mValue[0].w = value;
1587 mValue[1].w = mValue[0].w;
1588 mBaseValue.w = mValue[0].w;
1593 AnimatableProperty(const AnimatableProperty& property);
1596 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1599 DoubleBuffered<Vector4> mValue; ///< The double-buffered property value
1600 Vector4 mBaseValue; ///< Reset to this base value at the beginning of each frame
1603 * An Quaternion animatable property of a scene-graph object.
1606 class AnimatableProperty<Quaternion> : public AnimatablePropertyBase
1610 * Create an animatable property.
1612 AnimatableProperty()
1619 * Create an animatable property.
1620 * @param [in] initialValue The initial value of the property.
1622 AnimatableProperty(const Quaternion& initialValue)
1623 : mValue(initialValue),
1624 mBaseValue(initialValue)
1629 * Virtual destructor.
1631 ~AnimatableProperty() override = default;
1634 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1636 Dali::Property::Type GetType() const override
1638 return Dali::PropertyTypes::Get<Quaternion>();
1642 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1644 void ResetToBaseValue(BufferIndex updateBufferIndex) override
1646 if(CLEAN_FLAG != mDirtyFlags)
1648 mValue[updateBufferIndex] = mBaseValue;
1650 mDirtyFlags = (mDirtyFlags >> 1);
1655 * @copydoc Dali::PropertyInput::GetQuaternion()
1657 const Quaternion& GetQuaternion(BufferIndex bufferIndex) const override
1659 return mValue[bufferIndex];
1663 * Set the property value. This will only persist for the current frame; the property
1664 * will be reset with the base value, at the beginning of the next frame.
1665 * @param[in] bufferIndex The buffer to write.
1666 * @param[in] value The new property value.
1668 void Set(BufferIndex bufferIndex, const Quaternion& value)
1670 mValue[bufferIndex] = value;
1676 * Change the property value by a relative amount.
1677 * @param[in] bufferIndex The buffer to write.
1678 * @param[in] delta The property will change by this amount.
1680 void SetRelative(BufferIndex bufferIndex, const Quaternion& delta)
1682 mValue[bufferIndex] *= delta;
1688 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1690 Quaternion& Get(BufferIndex bufferIndex)
1692 return mValue[bufferIndex];
1696 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1698 const Quaternion& Get(BufferIndex bufferIndex) const
1700 return mValue[bufferIndex];
1704 * Retrieve the property value.
1705 * @param[in] bufferIndex The buffer to read.
1706 * @return The property value.
1708 Quaternion& operator[](BufferIndex bufferIndex)
1710 return mValue[bufferIndex];
1714 * Retrieve the property value.
1715 * @param[in] bufferIndex The buffer to read.
1716 * @return The property value.
1718 const Quaternion& operator[](BufferIndex bufferIndex) const
1720 return mValue[bufferIndex];
1724 * Set both the property value & base value.
1725 * @param[in] bufferIndex The buffer to write for the property value.
1726 * @param[in] value The new property value.
1728 void Bake(BufferIndex bufferIndex, const Quaternion& value)
1730 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
1731 // has never been atomically safe.
1732 mValue[bufferIndex] = value;
1733 mValue[1 - bufferIndex] = value;
1740 * Change the property value & base value by a relative amount.
1741 * @param[in] bufferIndex The buffer to write for the local property value.
1742 * @param[in] delta The property will change by this amount.
1744 void BakeRelative(BufferIndex bufferIndex, const Quaternion& delta)
1746 mValue[bufferIndex] *= delta;
1747 mBaseValue = mValue[bufferIndex];
1754 AnimatableProperty(const AnimatableProperty& property);
1757 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1760 DoubleBuffered<Quaternion> mValue; ///< The double-buffered property value
1761 Quaternion mBaseValue; ///< Reset to this base value at the beginning of each frame
1765 * A Matrix animatable property of a scene-graph object.
1768 class AnimatableProperty<Matrix> : public AnimatablePropertyBase
1772 * Create an animatable property.
1773 * @param [in] initialValue The initial value of the property.
1775 AnimatableProperty(const Matrix& initialValue)
1776 : mValue(initialValue),
1777 mBaseValue(initialValue)
1782 * Virtual destructor.
1784 ~AnimatableProperty() override = default;
1787 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1789 Dali::Property::Type GetType() const override
1791 return Dali::PropertyTypes::Get<Matrix>();
1795 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1797 void ResetToBaseValue(BufferIndex updateBufferIndex) override
1799 if(CLEAN_FLAG != mDirtyFlags)
1801 mValue[updateBufferIndex] = mBaseValue;
1803 mDirtyFlags = (mDirtyFlags >> 1);
1808 * @copydoc Dali::Internal::PropertyInputImpl::GetMatrix()
1810 const Matrix& GetMatrix(BufferIndex bufferIndex) const override
1812 return mValue[bufferIndex];
1816 * Set the property value. This will only persist for the current frame; the property
1817 * will be reset with the base value, at the beginning of the next frame.
1818 * @param[in] bufferIndex The buffer to write.
1819 * @param[in] value The new property value.
1821 void Set(BufferIndex bufferIndex, const Matrix& value)
1823 mValue[bufferIndex] = value;
1828 * Change the property value by a relative amount.
1829 * @param[in] bufferIndex The buffer to write.
1830 * @param[in] delta The property will change by this amount.
1832 void SetRelative(BufferIndex bufferIndex, const Matrix& delta)
1835 MatrixUtils::Multiply(temp, mValue[bufferIndex], delta);
1836 mValue[bufferIndex] = temp;
1842 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1844 Matrix& Get(BufferIndex bufferIndex)
1846 return mValue[bufferIndex];
1850 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1852 const Matrix& Get(BufferIndex bufferIndex) const
1854 return mValue[bufferIndex];
1858 * Retrieve the property value.
1859 * @param[in] bufferIndex The buffer to read.
1860 * @return The property value.
1862 Matrix& operator[](BufferIndex bufferIndex)
1864 return mValue[bufferIndex];
1868 * Retrieve the property value.
1869 * @param[in] bufferIndex The buffer to read.
1870 * @return The property value.
1872 const Matrix& operator[](BufferIndex bufferIndex) const
1874 return mValue[bufferIndex];
1878 * Set both the property value & base value.
1879 * @param[in] bufferIndex The buffer to write for the property value.
1880 * @param[in] value The new property value.
1882 void Bake(BufferIndex bufferIndex, const Matrix& value)
1884 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
1885 // has never been atomically safe.
1886 mValue[bufferIndex] = value;
1887 mValue[1 - bufferIndex] = value;
1888 mBaseValue = mValue[bufferIndex];
1894 * Change the property value & base value by a relative amount.
1895 * @param[in] bufferIndex The buffer to write for the local property value.
1896 * @param[in] delta The property will change by this amount.
1898 void BakeRelative(BufferIndex bufferIndex, const Matrix& delta)
1901 MatrixUtils::Multiply(temp, mValue[bufferIndex], delta);
1902 mValue[bufferIndex] = temp;
1910 AnimatableProperty(const AnimatableProperty& property);
1913 AnimatableProperty& operator=(const AnimatableProperty& rhs);
1916 DoubleBuffered<Matrix> mValue; ///< The double-buffered property value
1917 Matrix mBaseValue; ///< Reset to this base value at the beginning of each frame
1921 * A Matrix3 animatable property of a scene-graph object.
1924 class AnimatableProperty<Matrix3> : public AnimatablePropertyBase
1928 * Create an animatable property.
1929 * @param [in] initialValue The initial value of the property.
1931 AnimatableProperty(const Matrix3& initialValue)
1932 : mValue(initialValue),
1933 mBaseValue(initialValue)
1938 * Virtual destructor.
1940 ~AnimatableProperty() override = default;
1943 * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
1945 Dali::Property::Type GetType() const override
1947 return Dali::PropertyTypes::Get<Matrix3>();
1951 * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
1953 void ResetToBaseValue(BufferIndex updateBufferIndex) override
1955 if(CLEAN_FLAG != mDirtyFlags)
1957 mValue[updateBufferIndex] = mBaseValue;
1959 mDirtyFlags = (mDirtyFlags >> 1);
1964 * @copydoc Dali::Internal::PropertyInputImpl::GetMatrix3()
1966 const Matrix3& GetMatrix3(BufferIndex bufferIndex) const override
1968 return mValue[bufferIndex];
1972 * Set the property value. This will only persist for the current frame; the property
1973 * will be reset with the base value, at the beginning of the next frame.
1974 * @param[in] bufferIndex The buffer to write.
1975 * @param[in] value The new property value.
1977 void Set(BufferIndex bufferIndex, const Matrix3& value)
1979 mValue[bufferIndex] = value;
1984 * Change the property value by a relative amount.
1985 * @param[in] bufferIndex The buffer to write.
1986 * @param[in] delta The property will change by this amount.
1988 void SetRelative(BufferIndex bufferIndex, const Matrix3& delta)
1991 MatrixUtils::Multiply(temp, mValue[bufferIndex], delta);
1992 mValue[bufferIndex] = temp;
1997 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
1999 Matrix3& Get(BufferIndex bufferIndex)
2001 return mValue[bufferIndex];
2005 * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
2007 const Matrix3& Get(BufferIndex bufferIndex) const
2009 return mValue[bufferIndex];
2013 * Retrieve the property value.
2014 * @param[in] bufferIndex The buffer to read.
2015 * @return The property value.
2017 Matrix3& operator[](BufferIndex bufferIndex)
2019 return mValue[bufferIndex];
2023 * Retrieve the property value.
2024 * @param[in] bufferIndex The buffer to read.
2025 * @return The property value.
2027 const Matrix3& operator[](BufferIndex bufferIndex) const
2029 return mValue[bufferIndex];
2033 * Set both the property value & base value.
2034 * @param[in] bufferIndex The buffer to write for the property value.
2035 * @param[in] value The new property value.
2037 void Bake(BufferIndex bufferIndex, const Matrix3& value)
2039 // It's ok to bake both buffers as render is performed in same thread as update. Reading from event side
2040 // has never been atomically safe.
2041 mValue[bufferIndex] = value;
2042 mValue[1 - bufferIndex] = value;
2043 mBaseValue = mValue[bufferIndex];
2049 * Change the property value & base value by a relative amount.
2050 * @param[in] bufferIndex The buffer to write for the local property value.
2051 * @param[in] delta The property will change by this amount.
2053 void BakeRelative(BufferIndex bufferIndex, const Matrix3& delta)
2056 MatrixUtils::Multiply(temp, mValue[bufferIndex], delta);
2057 mValue[bufferIndex] = temp;
2065 AnimatableProperty(const AnimatableProperty& property);
2068 AnimatableProperty& operator=(const AnimatableProperty& rhs);
2071 DoubleBuffered<Matrix3> mValue; ///< The double-buffered property value
2072 Matrix3 mBaseValue; ///< Reset to this base value at the beginning of each frame
2075 } // namespace SceneGraph
2077 // Messages for AnimatableProperty<T>
2080 void BakeMessage(EventThreadServices& eventThreadServices,
2081 const SceneGraph::AnimatableProperty<T>& property,
2082 typename ParameterType<T>::PassingType newValue)
2084 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, T>;
2086 // Reserve some memory inside the message queue
2087 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
2089 // Construct message in the message queue memory; note that delete should not be called on the return value
2090 new(slot) LocalType(&property,
2091 &SceneGraph::AnimatableProperty<T>::Bake,
2096 void BakeRelativeMessage(EventThreadServices& eventThreadServices,
2097 const SceneGraph::AnimatableProperty<T>& property,
2100 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, const T&>;
2102 // Reserve some memory inside the message queue
2103 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
2105 // Construct message in the message queue memory; note that delete should not be called on the return value
2106 new(slot) LocalType(&property,
2107 &SceneGraph::AnimatableProperty<T>::BakeRelative,
2112 void SetXComponentMessage(EventThreadServices& eventThreadServices,
2113 const SceneGraph::AnimatableProperty<T>& property,
2114 typename ParameterType<float>::PassingType newValue)
2116 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
2118 // Reserve some memory inside the message queue
2119 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
2121 // Construct message in the message queue memory; note that delete should not be called on the return value
2122 new(slot) LocalType(&property,
2123 &SceneGraph::AnimatableProperty<T>::BakeX,
2128 void SetYComponentMessage(EventThreadServices& eventThreadServices,
2129 const SceneGraph::AnimatableProperty<T>& property,
2130 typename ParameterType<float>::PassingType newValue)
2132 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
2134 // Reserve some memory inside the message queue
2135 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
2137 // Construct message in the message queue memory; note that delete should not be called on the return value
2138 new(slot) LocalType(&property,
2139 &SceneGraph::AnimatableProperty<T>::BakeY,
2144 void SetZComponentMessage(EventThreadServices& eventThreadServices,
2145 const SceneGraph::AnimatableProperty<T>& property,
2146 typename ParameterType<float>::PassingType newValue)
2148 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
2150 // Reserve some memory inside the message queue
2151 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
2153 // Construct message in the message queue memory; note that delete should not be called on the return value
2154 new(slot) LocalType(&property,
2155 &SceneGraph::AnimatableProperty<T>::BakeZ,
2160 void SetWComponentMessage(EventThreadServices& eventThreadServices,
2161 const SceneGraph::AnimatableProperty<T>& property,
2162 typename ParameterType<float>::PassingType newValue)
2164 using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
2166 // Reserve some memory inside the message queue
2167 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
2169 // Construct message in the message queue memory; note that delete should not be called on the return value
2170 new(slot) LocalType(&property,
2171 &SceneGraph::AnimatableProperty<T>::BakeW,
2175 } // namespace Internal
2179 #endif // DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H