mTxComponentAnimatableBaseValue.PushBack(TransformComponentAnimatable());
mSizeBase.PushBack(Vector3(0.0f, 0.0f, 0.0f));
mComponentDirty.PushBack(CLEAN_FLAG);
- mWorldMatrixDirty.PushBack(false);
+ mLocalMatrixDirty.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;
- mWorldMatrixDirty[mComponentCount] = false;
+ mLocalMatrixDirty[mComponentCount] = false;
}
mComponentCount++;
mTxComponentAnimatableBaseValue[index] = mTxComponentAnimatableBaseValue[mComponentCount];
mSizeBase[index] = mSizeBase[mComponentCount];
mComponentDirty[index] = mComponentDirty[mComponentCount];
- mWorldMatrixDirty[index] = mWorldMatrixDirty[mComponentCount];
+ mLocalMatrixDirty[index] = mLocalMatrixDirty[mComponentCount];
mBoundingSpheres[index] = mBoundingSpheres[mComponentCount];
TransformId lastItemId = mComponentId[mComponentCount];
if(mUpdated)
{
- memset(&mWorldMatrixDirty[0], false, sizeof(bool) * mComponentCount);
+ memset(&mLocalMatrixDirty[0], false, sizeof(bool) * mComponentCount);
}
}
}
const TransformId& parentIndex = mIds[mParent[i]];
if(DALI_LIKELY(mInheritanceMode[i] == INHERIT_ALL))
{
- if(mComponentDirty[i] || mWorldMatrixDirty[parentIndex])
+ if(mComponentDirty[i] || mLocalMatrixDirty[parentIndex])
{
- // TODO : Skip world matrix comparision. Is it improve performance?
- mWorldMatrixDirty[i] = true;
+ mLocalMatrixDirty[i] = true;
//Full transform inherited
CalculateCenterPosition(centerPosition, mTxComponentStatic[i], mTxComponentAnimatable[i].mScale, mTxComponentAnimatable[i].mOrientation, mSize[i], half, topLeft);
}
else
{
- // Keep previous worldMatrix for comparison.
- Matrix previousWorldMatrix = mWorld[i];
+ // Keep previous localMatrix for comparison.
+ Matrix previousLocalMatrix = mLocal[i];
// Get Parent information.
Vector3 parentPosition, parentScale;
inverseParentMatrix.SetInverseTransformComponents(parentScale, parentOrientation, parentPosition);
mLocal[i] = inverseParentMatrix * mWorld[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]);
+ mLocalMatrixDirty[i] = mComponentDirty[i] || (previousLocalMatrix != mLocal[i]);
}
}
else //Component has no parent or doesn't inherit transform
{
if(mComponentDirty[i])
{
- // TODO : We need to check mComponentDirty since we have to check the size changeness.
- // Could we check size changeness only?
- mWorldMatrixDirty[i] = true;
+ mLocalMatrixDirty[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 || mWorldMatrixDirty[i];
+ mUpdated = mUpdated || mLocalMatrixDirty[i];
mComponentDirty[i] >>= 1u; ///< age down.
}
mTxComponentAnimatableBaseValue.Resize(mComponentCount);
mSizeBase.Resize(mComponentCount);
mComponentDirty.Resize(mComponentCount);
- mWorldMatrixDirty.Resize(mComponentCount);
+ mLocalMatrixDirty.Resize(mComponentCount);
mOrderedComponents.Resize(mComponentCount);
mTxComponentAnimatable.ShrinkToFit();
mTxComponentAnimatableBaseValue.ShrinkToFit();
mSizeBase.ShrinkToFit();
mComponentDirty.ShrinkToFit();
- mWorldMatrixDirty.ShrinkToFit();
+ mLocalMatrixDirty.ShrinkToFit();
mOrderedComponents.ShrinkToFit();
}
#endif
Matrix& GetWorldMatrix(TransformId id);
/**
- * Checks if the world transform was updated in the last Update
+ * Checks if the local transform was updated in the last Update
* @param[in] id Id of the transform
- * @return true if world matrix changed in the last update, false otherwise
+ * @return true if local matrix changed in the last update, false otherwise
*/
- bool IsWorldMatrixDirty(TransformId id) const
+ bool IsLocalMatrixDirty(TransformId id) const
{
- return mWorldMatrixDirty[mIds[id]];
+ return mLocalMatrixDirty[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> mWorldMatrixDirty; ///< 1u if the local matrix has been updated in this frame, 0 otherwise
+ Vector<bool> mLocalMatrixDirty; ///< 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.
/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void Camera::Update(BufferIndex updateBufferIndex)
{
// if this has changes in world position we need to update camera for next 2 frames
- if(IsWorldMatrixDirty())
+ if(IsLocalMatrixDirty())
{
mUpdateViewFlag = UPDATE_COUNT;
}
{
Matrix& projectionMatrix = mProjectionMatrix.Get(updateBufferIndex);
Orthographic(projectionMatrix,
- static_cast<Dali::DevelCameraActor::ProjectionDirection>(mProjectionDirection[0]),
+ static_cast<Dali::DevelCameraActor::ProjectionDirection>(mProjectionDirection[0]),
mOrthographicSize[updateBufferIndex],
mAspectRatio[updateBufferIndex],
mNearClippingPlane[updateBufferIndex],