// For coverage
DALI_LOG_TRACE_METHOD(gLogFilter);
- struct TestNode
+ struct S
{
Dali::Internal::SceneGraph::TransformManagerData txMgrData;
Dali::Internal::SceneGraph::TransformManagerPropertyQuaternion<sizeof(txMgrData)> property;
- } testNode;
+ } s;
try
{
// There is no float component getter in derived class, only in base class.
- testNode.property.GetFloatComponent(0u);
+ s.property.GetFloatComponent(0u);
}
catch(Dali::DaliException& e)
{
{
TestApplication application;
- struct TestNode
+ struct S
{
const Vector3 input{1.0f, 2.0f, 3.0f};
Dali::Internal::SceneGraph::TransformManagerData txMgrData;
Dali::Internal::SceneGraph::TransformManagerVector3Input<sizeof(txMgrData)> property{Dali::Internal::SceneGraph::TRANSFORM_PROPERTY_POSITION, input};
- } testNode;
+ } s;
- Vector3 output = testNode.property.GetVector3(0);
+ Vector3 output = s.property.GetVector3(0);
tet_infoline("Test that if input property's transform manager data is not initialized, that getting a value returns the initial value of the property.");
- DALI_TEST_EQUALS(testNode.input, output, 0.001f, TEST_LOCATION);
+ DALI_TEST_EQUALS(s.input, output, 0.001f, TEST_LOCATION);
END_TEST;
}
using namespace Dali::Internal::SceneGraph;
int UtcDaliInternalTransformPropertyGetValueSize(void)
{
- struct PropertyValueSizeTestCase
+ struct S
{
Dali::Internal::PropertyInputImpl* property;
Property::Value value;
size_t size;
- PropertyValueSizeTestCase(Dali::Internal::PropertyInputImpl* p, Property::Value v, size_t s)
+ S(Dali::Internal::PropertyInputImpl* p, Property::Value v, size_t s)
: property(p),
value(v),
size(s)
{
}
};
- std::vector<PropertyValueSizeTestCase> properties;
+ std::vector<S> properties;
properties.emplace_back(new TransformManagerPropertyVector3<TransformManagerProperty::TRANSFORM_PROPERTY_SCALE, 0>(), Vector3(2.3f, 4.5f, 1.9f), sizeof(Vector3));
properties.emplace_back(new TransformManagerMatrixInput<0>(), Matrix::IDENTITY, sizeof(Matrix));
- for(auto& valueSizeTestCase : properties)
+ for(auto& s : properties)
{
- DALI_TEST_EQUALS(valueSizeTestCase.property->GetValueSize(), valueSizeTestCase.size, TEST_LOCATION);
+ DALI_TEST_EQUALS(s.property->GetValueSize(), s.size, TEST_LOCATION);
}
END_TEST;
int UtcDaliInternalTransformPropertyGetValueAddress(void)
{
- struct TestNode
+ struct N
{
BASE(TransformManagerData, mTransformManagerData);
PROPERTY_WRAPPER(mTransformManagerData, TransformManagerPropertyVector3, TRANSFORM_PROPERTY_SCALE, mScale);
- PROPERTY_WRAPPER(mScale, TransformManagerPropertyVector3, TRANSFORM_PROPERTY_ANCHOR_POINT, mAnchorPoint);
- PROPERTY_WRAPPER(mAnchorPoint, TransformManagerPropertyVector3, TRANSFORM_PROPERTY_PARENT_ORIGIN, mParentOrigin);
- TEMPLATE_WRAPPER(mParentOrigin, TransformManagerPropertyQuaternion, mOrientation);
+ TEMPLATE_WRAPPER(mScale, TransformManagerPropertyQuaternion, mOrientation);
TEMPLATE_WRAPPER(mOrientation, TransformManagerVector3Input, mWorldPosition);
TEMPLATE_WRAPPER(mWorldPosition, TransformManagerQuaternionInput, mWorldOrientation);
TEMPLATE_WRAPPER(mWorldOrientation, TransformManagerMatrixInput, mWorldMatrix);
- TestNode()
+ N()
: mTransformManagerData(),
mWorldPosition(TRANSFORM_PROPERTY_WORLD_POSITION, Vector3(1.0f, 1.0f, 1.0f)),
mWorldOrientation(),
};
TransformManager testManager;
- TestNode node;
+ N node;
node.mTransformManagerData.mManager = &testManager;
node.mTransformManagerData.mId = testManager.CreateTransform();
DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(1.2f, 1.2f, 1.2f), TEST_LOCATION);
- // Test anchor point, for coverage.
- addr = node.mAnchorPoint.GetValueAddress(0);
- node.mAnchorPoint.Set(0, Vector3(0.5f, 0.1f, 0.0f));
- DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.5f, 0.1f, 0.0f), TEST_LOCATION);
-
- node.mAnchorPoint.SetFloatComponent(0.9f, 1);
- DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.5f, 0.9f, 0.0f), TEST_LOCATION);
-
- node.mAnchorPoint.BakeFloatComponent(0.4f, 2);
- DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.5f, 0.9f, 0.4f), TEST_LOCATION);
-
- node.mAnchorPoint.BakeX(0, 0.0f);
- DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.0f, 0.9f, 0.4f), TEST_LOCATION);
-
- node.mAnchorPoint.BakeY(0, 0.1f);
- DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.0f, 0.1f, 0.4f), TEST_LOCATION);
-
- node.mAnchorPoint.BakeZ(0, 0.2f);
- DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.0f, 0.1f, 0.2f), TEST_LOCATION);
-
- // Test parent origin, for coverage.
- addr = node.mParentOrigin.GetValueAddress(0);
- node.mParentOrigin.Set(0, Vector3(0.5f, 0.1f, 0.0f));
- DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.5f, 0.1f, 0.0f), TEST_LOCATION);
-
- node.mParentOrigin.SetFloatComponent(0.9f, 1);
- DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.5f, 0.9f, 0.0f), TEST_LOCATION);
-
- node.mParentOrigin.BakeFloatComponent(0.4f, 2);
- DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.5f, 0.9f, 0.4f), TEST_LOCATION);
-
- node.mParentOrigin.BakeX(0, 0.0f);
- DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.0f, 0.9f, 0.4f), TEST_LOCATION);
-
- node.mParentOrigin.BakeY(0, 0.1f);
- DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.0f, 0.1f, 0.4f), TEST_LOCATION);
-
- node.mParentOrigin.BakeZ(0, 0.2f);
- DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.0f, 0.1f, 0.2f), TEST_LOCATION);
-
node.mOrientation.Set(0, Quaternion(Radian(1.619f), Vector3::ZAXIS));
addr = node.mOrientation.GetValueAddress(0);
DALI_TEST_EQUALS(*reinterpret_cast<const Quaternion*>(addr), Quaternion(Radian(1.619f), Vector3::ZAXIS), TEST_LOCATION);
- Matrix& worldMatrix = node.mWorldMatrix.Get(0);
- worldMatrix = Matrix::IDENTITY;
+ Matrix& m = node.mWorldMatrix.Get(0);
+ m = Matrix::IDENTITY;
addr = node.mWorldPosition.GetValueAddress(0);
DALI_TEST_EQUALS(*reinterpret_cast<const Vector3*>(addr), Vector3(0.f, 0.f, 0.f), TEST_LOCATION);
}
DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_UPDATE_PROCESS, false);
-
-/**
- * @brief Helper codes to set / bake the dirty flags for the components.
- * It will be useful when we want to reduce the number of lines.
- */
-
-/**
- * @brief Append dirty flags to both component and global dirty flags.
- * @param[in,out] componentDirtyFlag The dirty flag of the component.
- * @param[in,out] globalDirtyFlag The dirty flag of the global.
- * @param[in] flag The flag what we want to append.
- */
-inline void AppendDirtyFlags(uint8_t& componentDirtyFlag, uint8_t& globalDirtyFlag, const uint8_t flag)
-{
- componentDirtyFlag |= flag;
- globalDirtyFlag |= flag;
-}
-
-/**
- * @brief Change the inherit mode for each mode and update dirty flags.
- * @param[in,out] inheritanceMode The inheritance mode of the component.
- * @param[in,out] componentDirtyFlag The dirty flag of the component.
- * @param[in,out] globalDirtyFlag The dirty flag of the global.
- * @param[in] inherit True if we want to set the inherit mode as true. False otherwise.
- */
-inline void UpdateInheritMode(uint32_t& inheritanceMode, uint8_t& componentDirtyFlag, uint8_t& globalDirtyFlag, const InheritanceMode inheritModeFlag, const bool inherit)
-{
- if(inherit)
- {
- if(!(inheritanceMode & inheritModeFlag))
- {
- AppendDirtyFlags(componentDirtyFlag, globalDirtyFlag, STATIC_COMPONENT_FLAG);
- inheritanceMode |= inheritModeFlag;
- }
- }
- else
- {
- if(inheritanceMode & inheritModeFlag)
- {
- AppendDirtyFlags(componentDirtyFlag, globalDirtyFlag, STATIC_COMPONENT_FLAG);
- inheritanceMode &= ~inheritModeFlag;
- }
- }
-}
-
-/**
- * @brief Set transform property value and update dirty flags.
- * @tparam T The type of the transform component. It can be either float or Vector3.
- * @param[in,out] current The current value of the transform component. It would be changed as input vlaue.
- * @param[in,out] componentDirtyFlag The dirty flag of the component.
- * @param[in,out] globalDirtyFlag The dirty flag of the global.
- * @param[in] value The value what we want to set.
- * @param[in] flag The flag what we want to append.
- */
-template<typename T>
-inline void SetTransfromProperty(T& current, uint8_t& componentDirtyFlag, uint8_t& globalDirtyFlag, const T& value, const uint8_t flag = SET_FLAG)
-{
- current = value;
- AppendDirtyFlags(componentDirtyFlag, globalDirtyFlag, flag);
-}
-
-/**
- * @brief Bake transform property value and update dirty flags.
- * @tparam T The type of the transform component. It can be either float or Vector3.
- * @param[in,out] current The current value of the transform component.
- * @param[in,out] base The base value of the transform component.
- * @param[in,out] componentDirtyFlag The dirty flag of the component.
- * @param[in,out] globalDirtyFlag The dirty flag of the global.
- * @param[in] value The value what we want to bake.
- * @param[in] flag The flag what we want to append.
- */
-template<typename T>
-inline void BakeTransfromProperty(T& current, T& base, uint8_t& componentDirtyFlag, uint8_t& globalDirtyFlag, const T& value)
-{
- current = base = value;
- AppendDirtyFlags(componentDirtyFlag, globalDirtyFlag, BAKED_FLAG);
-}
-
-/**
- * @brief Set transform property value and update dirty flags only if current value changed.
- * @tparam T The type of the transform component. It can be either float or Vector3.
- * @param[in,out] current The current value of the transform component.
- * @param[in,out] componentDirtyFlag The dirty flag of the component.
- * @param[in,out] globalDirtyFlag The dirty flag of the global.
- * @param[in] value The value what we want to set.
- * @param[in] flag The flag what we want to append.
- */
-template<typename T>
-inline void SetTransfromPropertyIfChanged(T& current, uint8_t& componentDirtyFlag, uint8_t& globalDirtyFlag, const T& value, const uint8_t flag = SET_FLAG)
-{
- if constexpr(std::is_same_v<T, float>)
- {
- if(!Equals(current, value))
- {
- SetTransfromProperty(current, componentDirtyFlag, globalDirtyFlag, value, flag);
- }
- }
- else
- {
- if(current != value)
- {
- SetTransfromProperty(current, componentDirtyFlag, globalDirtyFlag, value, flag);
- }
- }
-}
-
-/**
- * @brief Bake transform property value and update dirty flags only if base value changed.
- * @tparam T The type of the transform component. It can be either float or Vector3.
- * @param[in,out] current The current value of the transform component.
- * @param[in,out] base The base value of the transform component.
- * @param[in,out] componentDirtyFlag The dirty flag of the component.
- * @param[in,out] globalDirtyFlag The dirty flag of the global.
- * @param[in] value The value what we want to bake.
- * @param[in] flag The flag what we want to append.
- */
-template<typename T>
-inline void BakeTransfromPropertyIfChanged(T& current, T& base, uint8_t& componentDirtyFlag, uint8_t& globalDirtyFlag, const T& value)
-{
- if constexpr(std::is_same_v<T, float>)
- {
- if(!Equals(base, value))
- {
- BakeTransfromProperty(current, base, componentDirtyFlag, globalDirtyFlag, value);
- }
- }
- else
- {
- if(base != value)
- {
- BakeTransfromProperty(current, base, componentDirtyFlag, globalDirtyFlag, value);
- }
- }
-}
-
} // unnamed namespace
TransformManager::TransformManager()
if(DALI_LIKELY(mParent[index] != parentId))
{
mParent[index] = parentId;
- AppendDirtyFlags(mComponentDirty[index], mDirtyFlags, STATIC_COMPONENT_FLAG); ///< Need to calculate local matrix, at least 1 frame.
+ mComponentDirty[index] |= STATIC_COMPONENT_FLAG; ///< Need to calculate local matrix, at least 1 frame.
+ mDirtyFlags |= STATIC_COMPONENT_FLAG;
mReorder = true;
}
void TransformManager::SetInheritPosition(TransformId id, bool inherit)
{
TransformId index = mIds[id];
- UpdateInheritMode(mInheritanceMode[index], mComponentDirty[index], mDirtyFlags, INHERIT_POSITION, inherit);
+ if(inherit)
+ {
+ mInheritanceMode[index] |= INHERIT_POSITION;
+ }
+ else
+ {
+ mInheritanceMode[index] &= ~INHERIT_POSITION;
+ }
+
+ mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
+ mDirtyFlags |= STATIC_COMPONENT_FLAG;
}
void TransformManager::SetInheritScale(TransformId id, bool inherit)
{
TransformId index = mIds[id];
- UpdateInheritMode(mInheritanceMode[index], mComponentDirty[index], mDirtyFlags, INHERIT_SCALE, inherit);
+ if(inherit)
+ {
+ mInheritanceMode[index] |= INHERIT_SCALE;
+ }
+ else
+ {
+ mInheritanceMode[index] &= ~INHERIT_SCALE;
+ }
+
+ mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
+ mDirtyFlags |= STATIC_COMPONENT_FLAG;
}
void TransformManager::SetInheritOrientation(TransformId id, bool inherit)
{
TransformId index = mIds[id];
- UpdateInheritMode(mInheritanceMode[index], mComponentDirty[index], mDirtyFlags, INHERIT_ORIENTATION, inherit);
+ if(inherit)
+ {
+ mInheritanceMode[index] |= INHERIT_ORIENTATION;
+ }
+ else
+ {
+ mInheritanceMode[index] &= ~INHERIT_ORIENTATION;
+ }
+
+ mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
+ mDirtyFlags |= STATIC_COMPONENT_FLAG;
}
void TransformManager::ResetToBaseValue()
{
case TRANSFORM_PROPERTY_POSITION:
{
- return mTxComponentAnimatable[mIds[id]].mPosition;
+ TransformId index(mIds[id]);
+ return mTxComponentAnimatable[index].mPosition;
}
case TRANSFORM_PROPERTY_SCALE:
{
- return mTxComponentAnimatable[mIds[id]].mScale;
+ TransformId index(mIds[id]);
+ return mTxComponentAnimatable[index].mScale;
}
case TRANSFORM_PROPERTY_PARENT_ORIGIN:
{
- return mTxComponentStatic[mIds[id]].mParentOrigin;
+ TransformId index(mIds[id]);
+ return mTxComponentStatic[index].mParentOrigin;
}
case TRANSFORM_PROPERTY_ANCHOR_POINT:
{
- return mTxComponentStatic[mIds[id]].mAnchorPoint;
+ TransformId index(mIds[id]);
+ return mTxComponentStatic[index].mAnchorPoint;
}
case TRANSFORM_PROPERTY_SIZE:
{
- return mSize[mIds[id]];
+ TransformId index(mIds[id]);
+ return mSize[index];
}
default:
{
{
case TRANSFORM_PROPERTY_POSITION:
{
- SetTransfromProperty(mTxComponentAnimatable[index].mPosition, mComponentDirty[index], mDirtyFlags, value);
+ mComponentDirty[index] = mDirtyFlags = SET_FLAG;
+ mTxComponentAnimatable[index].mPosition = value;
break;
}
case TRANSFORM_PROPERTY_SCALE:
{
- SetTransfromProperty(mTxComponentAnimatable[index].mScale, mComponentDirty[index], mDirtyFlags, value);
+ mComponentDirty[index] = mDirtyFlags = SET_FLAG;
+ mTxComponentAnimatable[index].mScale = value;
break;
}
case TRANSFORM_PROPERTY_PARENT_ORIGIN:
{
- SetTransfromProperty(mTxComponentStatic[index].mParentOrigin, mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
+ mDirtyFlags |= STATIC_COMPONENT_FLAG;
+ mTxComponentStatic[index].mParentOrigin = value;
break;
}
case TRANSFORM_PROPERTY_ANCHOR_POINT:
{
- SetTransfromProperty(mTxComponentStatic[index].mAnchorPoint, mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
+ mDirtyFlags |= STATIC_COMPONENT_FLAG;
+ mTxComponentStatic[index].mAnchorPoint = value;
break;
}
case TRANSFORM_PROPERTY_SIZE:
{
- SetTransfromProperty(mSize[index], mComponentDirty[index], mDirtyFlags, value);
+ mComponentDirty[index] = mDirtyFlags = SET_FLAG;
+ mSize[index] = value;
break;
}
default:
{
case TRANSFORM_PROPERTY_POSITION:
{
- SetTransfromPropertyIfChanged(mTxComponentAnimatable[index].mPosition[component], mComponentDirty[index], mDirtyFlags, value);
+ mComponentDirty[index] = mDirtyFlags = SET_FLAG;
+ mTxComponentAnimatable[index].mPosition[component] = value;
break;
}
case TRANSFORM_PROPERTY_SCALE:
{
- SetTransfromPropertyIfChanged(mTxComponentAnimatable[index].mScale[component], mComponentDirty[index], mDirtyFlags, value);
+ mComponentDirty[index] = mDirtyFlags = SET_FLAG;
+ mTxComponentAnimatable[index].mScale[component] = value;
break;
}
case TRANSFORM_PROPERTY_PARENT_ORIGIN:
{
- SetTransfromPropertyIfChanged(mTxComponentStatic[index].mParentOrigin[component], mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
+ mDirtyFlags |= STATIC_COMPONENT_FLAG;
+ mTxComponentStatic[index].mParentOrigin[component] = value;
break;
}
case TRANSFORM_PROPERTY_ANCHOR_POINT:
{
- SetTransfromPropertyIfChanged(mTxComponentStatic[index].mAnchorPoint[component], mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
+ mTxComponentStatic[index].mAnchorPoint[component] = value;
+ mDirtyFlags |= STATIC_COMPONENT_FLAG;
break;
}
case TRANSFORM_PROPERTY_SIZE:
{
- SetTransfromPropertyIfChanged(mSize[index][component], mComponentDirty[index], mDirtyFlags, value);
+ mComponentDirty[index] = mDirtyFlags = SET_FLAG;
+ mSize[index][component] = value;
break;
}
default:
void TransformManager::BakeVector3PropertyValue(TransformId id, TransformManagerProperty property, const Vector3& value)
{
TransformId index(mIds[id]);
+ mComponentDirty[index] |= BAKED_FLAG;
+ mDirtyFlags |= BAKED_FLAG;
switch(property)
{
case TRANSFORM_PROPERTY_POSITION:
{
- BakeTransfromProperty(mTxComponentAnimatable[index].mPosition, mTxComponentAnimatableBaseValue[index].mPosition, mComponentDirty[index], mDirtyFlags, value);
+ mTxComponentAnimatable[index].mPosition = mTxComponentAnimatableBaseValue[index].mPosition = value;
break;
}
case TRANSFORM_PROPERTY_SCALE:
{
- BakeTransfromProperty(mTxComponentAnimatable[index].mScale, mTxComponentAnimatableBaseValue[index].mScale, mComponentDirty[index], mDirtyFlags, value);
+ mTxComponentAnimatable[index].mScale = mTxComponentAnimatableBaseValue[index].mScale = value;
break;
}
case TRANSFORM_PROPERTY_PARENT_ORIGIN:
{
- SetTransfromProperty(mTxComponentStatic[index].mParentOrigin, mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mTxComponentStatic[index].mParentOrigin = value;
break;
}
case TRANSFORM_PROPERTY_ANCHOR_POINT:
{
- SetTransfromProperty(mTxComponentStatic[index].mAnchorPoint, mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mTxComponentStatic[index].mAnchorPoint = value;
break;
}
case TRANSFORM_PROPERTY_SIZE:
{
- BakeTransfromProperty(mSize[index], mSizeBase[index], mComponentDirty[index], mDirtyFlags, value);
+ mSize[index] = mSizeBase[index] = value;
break;
}
default:
void TransformManager::BakeRelativeVector3PropertyValue(TransformId id, TransformManagerProperty property, const Vector3& value)
{
TransformId index(mIds[id]);
- AppendDirtyFlags(mComponentDirty[index], mDirtyFlags, BAKED_FLAG);
+ mComponentDirty[index] |= BAKED_FLAG;
+ mDirtyFlags |= BAKED_FLAG;
switch(property)
{
void TransformManager::BakeMultiplyVector3PropertyValue(TransformId id, TransformManagerProperty property, const Vector3& value)
{
TransformId index(mIds[id]);
- AppendDirtyFlags(mComponentDirty[index], mDirtyFlags, BAKED_FLAG);
+ mComponentDirty[index] |= BAKED_FLAG;
+ mDirtyFlags |= BAKED_FLAG;
switch(property)
{
void TransformManager::BakeVector3PropertyComponentValue(TransformId id, TransformManagerProperty property, float value, unsigned int component)
{
TransformId index(mIds[id]);
+ mComponentDirty[index] |= BAKED_FLAG;
+ mDirtyFlags |= BAKED_FLAG;
switch(property)
{
case TRANSFORM_PROPERTY_POSITION:
{
- BakeTransfromPropertyIfChanged(mTxComponentAnimatable[index].mPosition[component], mTxComponentAnimatableBaseValue[index].mPosition[component], mComponentDirty[index], mDirtyFlags, value);
+ mTxComponentAnimatable[index].mPosition[component] = mTxComponentAnimatableBaseValue[index].mPosition[component] = value;
break;
}
case TRANSFORM_PROPERTY_SCALE:
{
- BakeTransfromPropertyIfChanged(mTxComponentAnimatable[index].mScale[component], mTxComponentAnimatableBaseValue[index].mScale[component], mComponentDirty[index], mDirtyFlags, value);
+ mTxComponentAnimatable[index].mScale[component] = mTxComponentAnimatableBaseValue[index].mScale[component] = value;
break;
}
case TRANSFORM_PROPERTY_PARENT_ORIGIN:
{
- SetTransfromPropertyIfChanged(mTxComponentStatic[index].mParentOrigin[component], mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mTxComponentStatic[index].mParentOrigin[component] = value;
break;
}
case TRANSFORM_PROPERTY_ANCHOR_POINT:
{
- SetTransfromPropertyIfChanged(mTxComponentStatic[index].mAnchorPoint[component], mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mTxComponentStatic[index].mAnchorPoint[component] = value;
break;
}
case TRANSFORM_PROPERTY_SIZE:
{
- BakeTransfromPropertyIfChanged(mSize[index][component], mSizeBase[index][component], mComponentDirty[index], mDirtyFlags, value);
+ mSize[index][component] = mSizeBase[index][component] = value;
break;
}
default:
void TransformManager::BakeXVector3PropertyValue(TransformId id, TransformManagerProperty property, float value)
{
TransformId index(mIds[id]);
+ mComponentDirty[index] |= BAKED_FLAG;
+ mDirtyFlags |= BAKED_FLAG;
switch(property)
{
case TRANSFORM_PROPERTY_POSITION:
{
- BakeTransfromPropertyIfChanged(mTxComponentAnimatable[index].mPosition.x, mTxComponentAnimatableBaseValue[index].mPosition.x, mComponentDirty[index], mDirtyFlags, value);
+ mTxComponentAnimatable[index].mPosition.x = mTxComponentAnimatableBaseValue[index].mPosition.x = value;
break;
}
case TRANSFORM_PROPERTY_SCALE:
{
- BakeTransfromPropertyIfChanged(mTxComponentAnimatable[index].mScale.x, mTxComponentAnimatableBaseValue[index].mScale.x, mComponentDirty[index], mDirtyFlags, value);
+ mTxComponentAnimatable[index].mScale.x = mTxComponentAnimatableBaseValue[index].mScale.x = value;
break;
}
case TRANSFORM_PROPERTY_PARENT_ORIGIN:
{
- SetTransfromPropertyIfChanged(mTxComponentStatic[index].mParentOrigin.x, mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mTxComponentStatic[index].mParentOrigin.x = value;
break;
}
case TRANSFORM_PROPERTY_ANCHOR_POINT:
{
- SetTransfromPropertyIfChanged(mTxComponentStatic[index].mAnchorPoint.x, mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mTxComponentStatic[index].mAnchorPoint.x = value;
break;
}
case TRANSFORM_PROPERTY_SIZE:
{
- BakeTransfromPropertyIfChanged(mSize[index].x, mSizeBase[index].x, mComponentDirty[index], mDirtyFlags, value);
+ mSize[index].x = mSizeBase[index].x = value;
break;
}
default:
void TransformManager::BakeYVector3PropertyValue(TransformId id, TransformManagerProperty property, float value)
{
TransformId index(mIds[id]);
+ mComponentDirty[index] |= BAKED_FLAG;
+ mDirtyFlags |= BAKED_FLAG;
switch(property)
{
case TRANSFORM_PROPERTY_POSITION:
{
- BakeTransfromPropertyIfChanged(mTxComponentAnimatable[index].mPosition.y, mTxComponentAnimatableBaseValue[index].mPosition.y, mComponentDirty[index], mDirtyFlags, value);
+ mTxComponentAnimatable[index].mPosition.y = mTxComponentAnimatableBaseValue[index].mPosition.y = value;
break;
}
case TRANSFORM_PROPERTY_SCALE:
{
- BakeTransfromPropertyIfChanged(mTxComponentAnimatable[index].mScale.y, mTxComponentAnimatableBaseValue[index].mScale.y, mComponentDirty[index], mDirtyFlags, value);
+ mTxComponentAnimatable[index].mScale.y = mTxComponentAnimatableBaseValue[index].mScale.y = value;
break;
}
case TRANSFORM_PROPERTY_PARENT_ORIGIN:
{
- SetTransfromPropertyIfChanged(mTxComponentStatic[index].mParentOrigin.y, mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mTxComponentStatic[index].mParentOrigin.y = value;
break;
}
case TRANSFORM_PROPERTY_ANCHOR_POINT:
{
- SetTransfromPropertyIfChanged(mTxComponentStatic[index].mAnchorPoint.y, mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mTxComponentStatic[index].mAnchorPoint.y = value;
break;
}
case TRANSFORM_PROPERTY_SIZE:
{
- BakeTransfromPropertyIfChanged(mSize[index].y, mSizeBase[index].y, mComponentDirty[index], mDirtyFlags, value);
+ mSize[index].y = mSizeBase[index].y = value;
break;
}
default:
void TransformManager::BakeZVector3PropertyValue(TransformId id, TransformManagerProperty property, float value)
{
TransformId index(mIds[id]);
+ mComponentDirty[index] |= BAKED_FLAG;
+ mDirtyFlags |= BAKED_FLAG;
switch(property)
{
case TRANSFORM_PROPERTY_POSITION:
{
- BakeTransfromPropertyIfChanged(mTxComponentAnimatable[index].mPosition.z, mTxComponentAnimatableBaseValue[index].mPosition.z, mComponentDirty[index], mDirtyFlags, value);
+ mTxComponentAnimatable[index].mPosition.z = mTxComponentAnimatableBaseValue[index].mPosition.z = value;
break;
}
case TRANSFORM_PROPERTY_SCALE:
{
- BakeTransfromPropertyIfChanged(mTxComponentAnimatable[index].mScale.z, mTxComponentAnimatableBaseValue[index].mScale.z, mComponentDirty[index], mDirtyFlags, value);
+ mTxComponentAnimatable[index].mScale.z = mTxComponentAnimatableBaseValue[index].mScale.z = value;
break;
}
case TRANSFORM_PROPERTY_PARENT_ORIGIN:
{
- SetTransfromPropertyIfChanged(mTxComponentStatic[index].mParentOrigin.z, mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mTxComponentStatic[index].mParentOrigin.z = value;
break;
}
case TRANSFORM_PROPERTY_ANCHOR_POINT:
{
- SetTransfromPropertyIfChanged(mTxComponentStatic[index].mAnchorPoint.z, mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mTxComponentStatic[index].mAnchorPoint.z = value;
break;
}
case TRANSFORM_PROPERTY_SIZE:
{
- BakeTransfromPropertyIfChanged(mSize[index].z, mSizeBase[index].z, mComponentDirty[index], mDirtyFlags, value);
+ mSize[index].z = mSizeBase[index].z = value;
break;
}
default:
Quaternion& TransformManager::GetQuaternionPropertyValue(TransformId id)
{
- return mTxComponentAnimatable[mIds[id]].mOrientation;
+ TransformId index(mIds[id]);
+ return mTxComponentAnimatable[index].mOrientation;
}
const Quaternion& TransformManager::GetQuaternionPropertyValue(TransformId id) const
void TransformManager::SetQuaternionPropertyValue(TransformId id, const Quaternion& q)
{
TransformId index(mIds[id]);
- SetTransfromProperty(mTxComponentAnimatable[index].mOrientation, mComponentDirty[index], mDirtyFlags, q);
+ mComponentDirty[index] = mDirtyFlags = SET_FLAG;
+
+ mTxComponentAnimatable[index].mOrientation = q;
}
void TransformManager::BakeQuaternionPropertyValue(TransformId id, const Quaternion& q)
{
TransformId index(mIds[id]);
- BakeTransfromProperty(mTxComponentAnimatable[index].mOrientation, mTxComponentAnimatableBaseValue[index].mOrientation, mComponentDirty[index], mDirtyFlags, q);
+ mComponentDirty[index] |= BAKED_FLAG;
+ mDirtyFlags |= BAKED_FLAG;
+
+ mTxComponentAnimatable[index].mOrientation = mTxComponentAnimatableBaseValue[index].mOrientation = q;
}
void TransformManager::BakeRelativeQuaternionPropertyValue(TransformId id, const Quaternion& q)
{
TransformId index(mIds[id]);
- AppendDirtyFlags(mComponentDirty[index], mDirtyFlags, BAKED_FLAG);
+ mComponentDirty[index] |= BAKED_FLAG;
+ mDirtyFlags |= BAKED_FLAG;
mTxComponentAnimatable[index].mOrientation = mTxComponentAnimatableBaseValue[index].mOrientation = mTxComponentAnimatable[index].mOrientation * q;
}
void TransformManager::SetPositionUsesAnchorPoint(TransformId id, bool value)
{
TransformId index(mIds[id]);
+ mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
+ mDirtyFlags |= STATIC_COMPONENT_FLAG;
- SetTransfromPropertyIfChanged(mTxComponentStatic[index].mPositionUsesAnchorPoint, mComponentDirty[index], mDirtyFlags, value, STATIC_COMPONENT_FLAG);
+ mTxComponentStatic[index].mPositionUsesAnchorPoint = value;
}
} //namespace SceneGraph