mTxComponentAnimatableBaseValue.PushBack(TransformComponentAnimatable());
mSizeBase.PushBack(Vector3(0.0f, 0.0f, 0.0f));
mComponentDirty.PushBack(CLEAN_FLAG);
- mLocalMatrixDirty.PushBack(false);
+ mWorldMatrixDirty.PushBack(false);
}
else
{
mBoundingSpheres[mComponentCount] = Vector4(0.0f, 0.0f, 0.0f, 0.0f);
mSizeBase[mComponentCount] = Vector3(0.0f, 0.0f, 0.0f);
mComponentDirty[mComponentCount] = CLEAN_FLAG;
- mLocalMatrixDirty[mComponentCount] = false;
+ mWorldMatrixDirty[mComponentCount] = false;
}
mComponentCount++;
mTxComponentAnimatableBaseValue[index] = mTxComponentAnimatableBaseValue[mComponentCount];
mSizeBase[index] = mSizeBase[mComponentCount];
mComponentDirty[index] = mComponentDirty[mComponentCount];
- mLocalMatrixDirty[index] = mLocalMatrixDirty[mComponentCount];
+ mWorldMatrixDirty[index] = mWorldMatrixDirty[mComponentCount];
mBoundingSpheres[index] = mBoundingSpheres[mComponentCount];
TransformId lastItemId = mComponentId[mComponentCount];
if(mUpdated)
{
- memset(&mLocalMatrixDirty[0], false, sizeof(bool) * mComponentCount);
+ memset(&mWorldMatrixDirty[0], false, sizeof(bool) * mComponentCount);
}
}
}
const TransformId& parentIndex = mIds[mParent[i]];
if(DALI_LIKELY(mInheritanceMode[i] == INHERIT_ALL))
{
- if(mComponentDirty[i] || mLocalMatrixDirty[parentIndex])
+ if(mComponentDirty[i] || mWorldMatrixDirty[parentIndex])
{
- mLocalMatrixDirty[i] = true;
+ // TODO : Skip world matrix comparision. Is it improve performance?
+ mWorldMatrixDirty[i] = true;
//Full transform inherited
CalculateCenterPosition(centerPosition, mTxComponentStatic[i], mTxComponentAnimatable[i].mScale, mTxComponentAnimatable[i].mOrientation, mSize[i], half, topLeft);
}
else
{
- // Keep previous localMatrix for comparison.
- Matrix previousLocalMatrix = mLocal[i];
+ // Keep previous worldMatrix for comparison.
+ Matrix previousWorldMatrix = mWorld[i];
// Get Parent information.
Vector3 parentPosition, parentScale;
inverseParentMatrix.SetInverseTransformComponents(parentScale, parentOrientation, parentPosition);
mLocal[i] = inverseParentMatrix * mWorld[i];
- mLocalMatrixDirty[i] = mComponentDirty[i] || (previousLocalMatrix != mLocal[i]);
+ // TODO : We need to check mComponentDirty since we have to check the size changeness.
+ // Could we check size changeness only?
+ mWorldMatrixDirty[i] = mComponentDirty[i] || (previousWorldMatrix != mWorld[i]);
}
}
else //Component has no parent or doesn't inherit transform
{
if(mComponentDirty[i])
{
- mLocalMatrixDirty[i] = true;
+ // TODO : We need to check mComponentDirty since we have to check the size changeness.
+ // Could we check size changeness only?
+ mWorldMatrixDirty[i] = true;
CalculateCenterPosition(centerPosition, mTxComponentStatic[i], mTxComponentAnimatable[i].mScale, mTxComponentAnimatable[i].mOrientation, mSize[i], half, topLeft);
localPosition = mTxComponentAnimatable[i].mPosition + centerPosition;
mBoundingSpheres[i] = mWorld[i].GetTranslation();
mBoundingSpheres[i].w = Length(centerToEdgeWorldSpace);
- mUpdated = mUpdated || mLocalMatrixDirty[i];
+ mUpdated = mUpdated || mWorldMatrixDirty[i];
mComponentDirty[i] >>= 1u; ///< age down.
}
mTxComponentAnimatableBaseValue.Resize(mComponentCount);
mSizeBase.Resize(mComponentCount);
mComponentDirty.Resize(mComponentCount);
- mLocalMatrixDirty.Resize(mComponentCount);
+ mWorldMatrixDirty.Resize(mComponentCount);
mOrderedComponents.Resize(mComponentCount);
mTxComponentAnimatable.ShrinkToFit();
mTxComponentAnimatableBaseValue.ShrinkToFit();
mSizeBase.ShrinkToFit();
mComponentDirty.ShrinkToFit();
- mLocalMatrixDirty.ShrinkToFit();
+ mWorldMatrixDirty.ShrinkToFit();
mOrderedComponents.ShrinkToFit();
}
#endif
Matrix& GetWorldMatrix(TransformId id);
/**
- * Checks if the local transform was updated in the last Update
+ * Checks if the world transform was updated in the last Update
* @param[in] id Id of the transform
- * @return true if local matrix changed in the last update, false otherwise
+ * @return true if world matrix changed in the last update, false otherwise
*/
- bool IsLocalMatrixDirty(TransformId id) const
+ bool IsWorldMatrixDirty(TransformId id) const
{
- return mLocalMatrixDirty[mIds[id]];
+ return mWorldMatrixDirty[mIds[id]];
}
/**
///< Or If we change static component changed, flag become non-zero. Age down at Update time.
///< Note that we don't replace dirty flag as BAKE even if we call Bake operation.
///< (Since single dirty flag controls multiple animatable properties ; Position, Size, Scale, Orientation.)
- Vector<bool> mLocalMatrixDirty; ///< 1u if the local matrix has been updated in this frame, 0 otherwise
+ Vector<bool> mWorldMatrixDirty; ///< 1u if the local matrix has been updated in this frame, 0 otherwise
Vector<SOrderItem> mOrderedComponents; ///< Used to reorder components when hierarchy changes
uint8_t mDirtyFlags : 2; ///< Dirty flags for all transform components. Age down at Update time.