*/
const Vector3& GetParentOrigin() const
{
- return mParentOrigin.Get(0);
+ if(mTransformManagerData.Id() != INVALID_TRANSFORM_ID)
+ {
+ return mParentOrigin.Get(0);
+ }
+
+ return Vector3::ZERO;
}
/**
*/
const Vector3& GetAnchorPoint() const
{
- return mAnchorPoint.Get(0);
+ if(mTransformManagerData.Id() != INVALID_TRANSFORM_ID)
+ {
+ return mAnchorPoint.Get(0);
+ }
+
+ return Vector3::ZERO;
}
/**
*/
const Vector3& GetWorldPosition(BufferIndex bufferIndex) const
{
- return mWorldPosition.Get(bufferIndex);
+ if(mTransformManagerData.Id() != INVALID_TRANSFORM_ID)
+ {
+ return mWorldPosition.Get(bufferIndex);
+ }
+ return Vector3::ZERO;
}
/**
*/
const Quaternion& GetWorldOrientation(BufferIndex bufferIndex) const
{
- return mWorldOrientation.Get(0);
+ if(mTransformManagerData.Id() != INVALID_TRANSFORM_ID)
+ {
+ return mWorldOrientation.Get(0);
+ }
+ return Quaternion::IDENTITY;
}
/**
*/
const Vector3& GetWorldScale(BufferIndex bufferIndex) const
{
- return mWorldScale.Get(0);
+ if(mTransformManagerData.Id() != INVALID_TRANSFORM_ID)
+ {
+ return mWorldScale.Get(0);
+ }
+ return Vector3::ONE;
}
/**
*/
const Matrix& GetWorldMatrix(BufferIndex bufferIndex) const
{
- return mWorldMatrix.Get(bufferIndex);
+ if(mTransformManagerData.Id() != INVALID_TRANSFORM_ID)
+ {
+ return mWorldMatrix.Get(bufferIndex);
+ }
+
+ return Matrix::IDENTITY;
}
/**
*/
void SetDepthIndex(uint32_t depthIndex)
{
- mDepthIndex = depthIndex;
+ if(depthIndex != mDepthIndex)
+ {
+ SetDirtyFlag(NodePropertyFlags::DEPTH_INDEX);
+ mDepthIndex = depthIndex;
+ }
}
/**