2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/update/manager/transform-manager.h>
26 #include <dali/public-api/common/constants.h>
27 #include <dali/public-api/common/compile-time-assert.h>
40 //Default values for scale (1.0,1.0,1.0), orientation (Identity) and position (0.0,0.0,0.0)
41 static const float gDefaultTransformComponentAnimatableData[] = { 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f };
43 //Default values for anchor point (CENTER) and parent origin (TOP_LEFT)
44 static const float gDefaultTransformComponentStaticData[] = { 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 0.5f };
46 DALI_COMPILE_TIME_ASSERT( sizeof(gDefaultTransformComponentAnimatableData) == sizeof(TransformComponentAnimatable) );
47 DALI_COMPILE_TIME_ASSERT( sizeof(gDefaultTransformComponentStaticData) == sizeof(TransformComponentStatic) );
50 TransformManager::TransformManager()
55 TransformManager::~TransformManager()
58 TransformId TransformManager::CreateTransform()
60 //Get id for the new component
61 TransformId id = mIds.Add(mComponentCount);
63 if( mTxComponentAnimatable.Size() <= mComponentCount )
65 //Make room for another component
66 mTxComponentAnimatable.PushBack(TransformComponentAnimatable());
67 mTxComponentStatic.PushBack(TransformComponentStatic());
68 mInheritanceMode.PushBack(INHERIT_ALL);
69 mComponentId.PushBack(id);
70 mSize.PushBack(Vector3(0.0f,0.0f,0.0f));
71 mParent.PushBack(INVALID_TRANSFORM_ID);
72 mWorld.PushBack(Matrix::IDENTITY);
73 mLocal.PushBack(Matrix::IDENTITY);
74 mTxComponentAnimatableBaseValue.PushBack(TransformComponentAnimatable());
75 mSizeBase.PushBack(Vector3(0.0f,0.0f,0.0f));
76 mComponentDirty.PushBack(false);
77 mLocalMatrixDirty.PushBack(false);
82 memcpy( &mTxComponentAnimatable[mComponentCount], &gDefaultTransformComponentAnimatableData, sizeof( TransformComponentAnimatable ) );
83 memcpy( &mTxComponentStatic[mComponentCount], &gDefaultTransformComponentStaticData, sizeof( TransformComponentStatic ) );
84 memcpy( &mTxComponentAnimatableBaseValue[mComponentCount], &gDefaultTransformComponentAnimatableData, sizeof( TransformComponentAnimatable ) );
85 mInheritanceMode[mComponentCount] = INHERIT_ALL;
86 mComponentId[mComponentCount] = id;
87 mSize[mComponentCount] = Vector3(0.0f,0.0f,0.0f);
88 mParent[mComponentCount] = INVALID_TRANSFORM_ID;
89 mLocal[mComponentCount].SetIdentity();
90 mWorld[mComponentCount].SetIdentity();
91 mSizeBase[mComponentCount] = Vector3(0.0f,0.0f,0.0f);
92 mComponentDirty[mComponentCount] = false;
93 mLocalMatrixDirty[mComponentCount] = false;
100 void TransformManager::RemoveTransform(TransformId id)
102 //Move the last element to the gap
104 unsigned int index = mIds[id];
105 mTxComponentAnimatable[index] = mTxComponentAnimatable[mComponentCount];
106 mTxComponentStatic[index] = mTxComponentStatic[mComponentCount];
107 mInheritanceMode[index] = mInheritanceMode[mComponentCount];
108 mSize[index] = mSize[mComponentCount];
109 mParent[index] = mParent[mComponentCount];
110 mWorld[index] = mWorld[mComponentCount];
111 mLocal[index] = mLocal[mComponentCount];
112 mTxComponentAnimatableBaseValue[index] = mTxComponentAnimatableBaseValue[mComponentCount];
113 mSizeBase[index] = mSizeBase[mComponentCount];
114 mComponentDirty[index] = mComponentDirty[mComponentCount];
115 mLocalMatrixDirty[index] = mLocalMatrixDirty[mComponentCount];
117 TransformId lastItemId = mComponentId[mComponentCount];
118 mIds[ lastItemId ] = index;
119 mComponentId[index] = lastItemId;
125 void TransformManager::SetParent( TransformId id, TransformId parentId )
127 DALI_ASSERT_ALWAYS( id != parentId );
128 mParent[ mIds[id] ] = parentId;
132 const Matrix& TransformManager::GetWorldMatrix( TransformId id ) const
134 return mWorld[ mIds[id] ];
137 Matrix& TransformManager::GetWorldMatrix( TransformId id )
139 return mWorld[ mIds[id] ];
142 void TransformManager::SetInheritPosition( TransformId id, bool inherit )
144 unsigned int index = mIds[id];
147 mInheritanceMode[ index ] |= INHERIT_POSITION;
151 mInheritanceMode[ index ] &= ~INHERIT_POSITION;
154 mComponentDirty[index] = true;
157 void TransformManager::SetInheritScale( TransformId id, bool inherit )
159 unsigned int index = mIds[id];
162 mInheritanceMode[ index ] |= INHERIT_SCALE;
166 mInheritanceMode[ index ] &= ~INHERIT_SCALE;
169 mComponentDirty[index] = true;
172 void TransformManager::SetInheritOrientation( TransformId id, bool inherit )
174 unsigned int index = mIds[id];
177 mInheritanceMode[ index ] |= INHERIT_ORIENTATION;
181 mInheritanceMode[ index ] &= ~INHERIT_ORIENTATION;
184 mComponentDirty[index] = true;
187 void TransformManager::ResetToBaseValue()
189 if( mComponentCount )
191 memcpy( &mTxComponentAnimatable[0], &mTxComponentAnimatableBaseValue[0], sizeof(TransformComponentAnimatable)*mComponentCount );
192 memcpy( &mSize[0], &mSizeBase[0], sizeof(Vector3)*mComponentCount );
193 memset( &mLocalMatrixDirty[0], false, sizeof(bool)*mComponentCount );
197 void TransformManager::Update()
201 //If some transform component has change its parent or has been removed since last update
202 //we need to reorder the vectors
207 //Iterate through all components to compute its world matrix
208 Vector3 anchorPosition;
209 Vector3 localPosition;
210 Vector3 half( 0.5f,0.5f,0.5f );
211 for( unsigned int i(0); i<mComponentCount; ++i )
213 if( DALI_LIKELY( mInheritanceMode[i] != DONT_INHERIT_TRANSFORM && mParent[i] != INVALID_TRANSFORM_ID ) )
215 const unsigned int& parentIndex = mIds[mParent[i] ];
216 if( DALI_LIKELY( mInheritanceMode[i] == INHERIT_ALL ) )
218 if( mComponentDirty[i] || mLocalMatrixDirty[parentIndex])
220 //Full transform inherited
221 mComponentDirty[i] = false;
222 mLocalMatrixDirty[i] = true;
224 anchorPosition = ( half - mTxComponentStatic[i].mAnchorPoint ) * mSize[i] * mTxComponentAnimatable[i].mScale;
225 anchorPosition *= mTxComponentAnimatable[i].mOrientation;
226 localPosition = mTxComponentAnimatable[i].mPosition + anchorPosition + ( mTxComponentStatic[i].mParentOrigin - half ) * mSize[parentIndex];
227 mLocal[i].SetTransformComponents( mTxComponentAnimatable[i].mScale,mTxComponentAnimatable[i].mOrientation, localPosition );
230 Matrix::Multiply( mWorld[i], mLocal[i], mWorld[parentIndex]);
234 //Some components are not inherited
235 Vector3 parentPosition, parentScale;
236 Quaternion parentOrientation;
237 const Matrix& parentMatrix = mWorld[parentIndex];
238 parentMatrix.GetTransformComponents( parentPosition, parentOrientation, parentScale );
240 Vector3 localScale = mTxComponentAnimatable[i].mScale;
241 if( (mInheritanceMode[i] & INHERIT_SCALE) == 0 )
243 //Don't inherit scale
244 localScale /= parentScale;
247 Quaternion localOrientation( mTxComponentAnimatable[i].mOrientation );
248 if( (mInheritanceMode[i] & INHERIT_ORIENTATION) == 0 )
250 //Don't inherit orientation
251 parentOrientation.Invert();
252 localOrientation = parentOrientation * mTxComponentAnimatable[i].mOrientation;
255 if( (mInheritanceMode[i] & INHERIT_POSITION) == 0 )
257 //Don't inherit position
258 mLocal[i].SetTransformComponents( localScale, localOrientation, Vector3::ZERO );
259 Matrix::Multiply( mWorld[i], mLocal[i], parentMatrix );
260 mWorld[i].SetTranslation( mTxComponentAnimatable[i].mPosition);
264 anchorPosition = ( half - mTxComponentStatic[i].mAnchorPoint ) * mSize[i] * mTxComponentAnimatable[i].mScale;
265 anchorPosition *= mTxComponentAnimatable[i].mOrientation;
266 localPosition = mTxComponentAnimatable[i].mPosition + anchorPosition + ( mTxComponentStatic[i].mParentOrigin - half ) * mSize[parentIndex];
267 mLocal[i].SetTransformComponents( localScale, localOrientation, localPosition );
268 Matrix::Multiply( mWorld[i], mLocal[i], parentMatrix );
272 else //Component has no parent or doesn't inherit transform
274 anchorPosition = ( half - mTxComponentStatic[i].mAnchorPoint ) * mSize[i] * mTxComponentAnimatable[i].mScale;
275 anchorPosition *= mTxComponentAnimatable[i].mOrientation;
276 localPosition = mTxComponentAnimatable[i].mPosition + anchorPosition;
277 mWorld[i].SetTransformComponents( mTxComponentAnimatable[i].mScale, mTxComponentAnimatable[i].mOrientation, localPosition );
282 void TransformManager::SwapComponents( unsigned int i, unsigned int j )
284 std::swap( mTxComponentAnimatable[i], mTxComponentAnimatable[j] );
285 std::swap( mTxComponentStatic[i], mTxComponentStatic[j] );
286 std::swap( mInheritanceMode[i], mInheritanceMode[j] );
287 std::swap( mSize[i], mSize[j] );
288 std::swap( mParent[i], mParent[j] );
289 std::swap( mComponentId[i], mComponentId[j] );
290 std::swap( mTxComponentAnimatableBaseValue[i], mTxComponentAnimatableBaseValue[j] );
291 std::swap( mSizeBase[i], mSizeBase[j] );
292 std::swap( mLocal[i], mLocal[j] );
293 std::swap( mComponentDirty[i], mComponentDirty[j] );
295 mIds[ mComponentId[i] ] = i;
296 mIds[ mComponentId[j] ] = j;
299 void TransformManager::ReorderComponents()
301 mOrderedComponents.Resize(mComponentCount);
303 TransformId parentId;
304 for( size_t i(0); i<mComponentCount; ++i )
306 mOrderedComponents[i].id = mComponentId[i];
307 mOrderedComponents[i].level = 0u;
309 parentId = mParent[i];
310 while( parentId != INVALID_TRANSFORM_ID )
312 mOrderedComponents[i].level++;
313 parentId = mParent[ mIds[parentId] ];
317 std::sort( mOrderedComponents.Begin(), mOrderedComponents.End());
318 for( size_t i(0); i<mComponentCount-1; ++i )
320 SwapComponents( mIds[mOrderedComponents[i].id], i);
324 Vector3& TransformManager::GetVector3PropertyValue( TransformId id, TransformManagerProperty property )
328 case TRANSFORM_PROPERTY_POSITION:
330 unsigned int index( mIds[id] );
331 mComponentDirty[ index ] = true;
332 return mTxComponentAnimatable[ index ].mPosition;
334 case TRANSFORM_PROPERTY_SCALE:
336 unsigned int index( mIds[id] );
337 mComponentDirty[ index ] = true;
338 return mTxComponentAnimatable[ index ].mScale;
340 case TRANSFORM_PROPERTY_PARENT_ORIGIN:
342 unsigned int index( mIds[id] );
343 mComponentDirty[ index ] = true;
344 return mTxComponentStatic[ index ].mParentOrigin;
346 case TRANSFORM_PROPERTY_ANCHOR_POINT:
348 unsigned int index( mIds[id] );
349 mComponentDirty[ index ] = true;
350 return mTxComponentStatic[ index ].mAnchorPoint;
352 case TRANSFORM_PROPERTY_SIZE:
354 unsigned int index( mIds[id] );
355 mComponentDirty[ index ] = true;
356 return mSize[ index ];
360 DALI_ASSERT_ALWAYS(false);
361 return mTxComponentAnimatable[ mIds[id] ].mPosition;
366 const Vector3& TransformManager::GetVector3PropertyValue( TransformId id, TransformManagerProperty property ) const
370 case TRANSFORM_PROPERTY_POSITION:
372 return mTxComponentAnimatable[ mIds[id] ].mPosition;
374 case TRANSFORM_PROPERTY_SCALE:
376 return mTxComponentAnimatable[ mIds[id] ].mScale;
378 case TRANSFORM_PROPERTY_PARENT_ORIGIN:
380 return mTxComponentStatic[ mIds[id] ].mParentOrigin;
382 case TRANSFORM_PROPERTY_ANCHOR_POINT:
384 return mTxComponentStatic[ mIds[id] ].mAnchorPoint;
386 case TRANSFORM_PROPERTY_SIZE:
388 return mSize[ mIds[id] ];
392 DALI_ASSERT_ALWAYS(false);
393 return mTxComponentAnimatable[ mIds[id] ].mPosition;
398 const float& TransformManager::GetVector3PropertyComponentValue(TransformId id, TransformManagerProperty property, unsigned int component ) const
402 case TRANSFORM_PROPERTY_POSITION:
404 return mTxComponentAnimatable[ mIds[id] ].mPosition[component];
406 case TRANSFORM_PROPERTY_SCALE:
408 return mTxComponentAnimatable[ mIds[id] ].mScale[component];
410 case TRANSFORM_PROPERTY_PARENT_ORIGIN:
412 return mTxComponentStatic[ mIds[id] ].mParentOrigin[component];
414 case TRANSFORM_PROPERTY_ANCHOR_POINT:
416 return mTxComponentStatic[ mIds[id] ].mAnchorPoint[component];
418 case TRANSFORM_PROPERTY_SIZE:
420 return mSize[ mIds[id] ][component];
424 DALI_ASSERT_ALWAYS(false);
425 return mTxComponentAnimatable[ mIds[id] ].mPosition[component];
430 void TransformManager::SetVector3PropertyValue( TransformId id, TransformManagerProperty property, const Vector3& value )
432 unsigned int index( mIds[id] );
433 mComponentDirty[ index ] = true;
437 case TRANSFORM_PROPERTY_POSITION:
439 mTxComponentAnimatable[ index ].mPosition = value;
442 case TRANSFORM_PROPERTY_SCALE:
444 mTxComponentAnimatable[ index ].mScale = value;
447 case TRANSFORM_PROPERTY_PARENT_ORIGIN:
449 mTxComponentStatic[ index ].mParentOrigin = value;
452 case TRANSFORM_PROPERTY_ANCHOR_POINT:
454 mTxComponentStatic[ index ].mAnchorPoint = value;
457 case TRANSFORM_PROPERTY_SIZE:
459 mSize[ index ] = value;
464 DALI_ASSERT_ALWAYS(false);
469 void TransformManager::SetVector3PropertyComponentValue( TransformId id, TransformManagerProperty property, float value, unsigned int component )
471 unsigned int index( mIds[id] );
472 mComponentDirty[ index ] = true;
476 case TRANSFORM_PROPERTY_POSITION:
478 mTxComponentAnimatable[ index ].mPosition[component] = value;
481 case TRANSFORM_PROPERTY_SCALE:
483 mTxComponentAnimatable[ index ].mScale[component] = value;
486 case TRANSFORM_PROPERTY_PARENT_ORIGIN:
488 mTxComponentStatic[ index ].mParentOrigin[component] = value;
491 case TRANSFORM_PROPERTY_ANCHOR_POINT:
493 mTxComponentStatic[ index ].mAnchorPoint[component] = value;
496 case TRANSFORM_PROPERTY_SIZE:
498 mSize[ index ][component] = value;
503 DALI_ASSERT_ALWAYS(false);
508 void TransformManager::BakeVector3PropertyValue( TransformId id, TransformManagerProperty property, const Vector3& value )
510 unsigned int index( mIds[id] );
511 mComponentDirty[ index ] = true;
515 case TRANSFORM_PROPERTY_POSITION:
517 mTxComponentAnimatable[ index ].mPosition = mTxComponentAnimatableBaseValue[index].mPosition = value;
520 case TRANSFORM_PROPERTY_SCALE:
522 mTxComponentAnimatable[ index ].mScale = mTxComponentAnimatableBaseValue[index].mScale = value;
525 case TRANSFORM_PROPERTY_PARENT_ORIGIN:
527 mTxComponentStatic[ index ].mParentOrigin = value;
530 case TRANSFORM_PROPERTY_ANCHOR_POINT:
532 mTxComponentStatic[ index ].mAnchorPoint = value;
535 case TRANSFORM_PROPERTY_SIZE:
537 mSize[ index ] = mSizeBase[index] = value;
542 DALI_ASSERT_ALWAYS(false);
547 void TransformManager::BakeRelativeVector3PropertyValue( TransformId id, TransformManagerProperty property, const Vector3& value )
549 unsigned int index( mIds[id] );
550 mComponentDirty[ index ] = true;
554 case TRANSFORM_PROPERTY_POSITION:
556 mTxComponentAnimatable[ index ].mPosition = mTxComponentAnimatableBaseValue[index].mPosition = mTxComponentAnimatable[ index ].mPosition + value;
559 case TRANSFORM_PROPERTY_SCALE:
561 mTxComponentAnimatable[ index ].mScale = mTxComponentAnimatableBaseValue[index].mScale = mTxComponentAnimatable[ index ].mScale + value;
564 case TRANSFORM_PROPERTY_PARENT_ORIGIN:
566 mTxComponentStatic[ index ].mParentOrigin = mTxComponentStatic[ index ].mParentOrigin + value;
569 case TRANSFORM_PROPERTY_ANCHOR_POINT:
571 mTxComponentStatic[ index ].mAnchorPoint = mTxComponentStatic[ index ].mAnchorPoint + value;
574 case TRANSFORM_PROPERTY_SIZE:
576 mSize[ index ] = mSizeBase[index] = mSize[ index ] + value;
581 DALI_ASSERT_ALWAYS(false);
586 void TransformManager::BakeMultiplyVector3PropertyValue( TransformId id, TransformManagerProperty property, const Vector3& value )
588 unsigned int index( mIds[id] );
589 mComponentDirty[ index ] = true;
593 case TRANSFORM_PROPERTY_POSITION:
595 mTxComponentAnimatable[ index ].mPosition = mTxComponentAnimatableBaseValue[index].mPosition = mTxComponentAnimatable[ index ].mPosition * value;
598 case TRANSFORM_PROPERTY_SCALE:
600 mTxComponentAnimatable[ index ].mScale = mTxComponentAnimatableBaseValue[index].mScale = mTxComponentAnimatable[ index ].mScale * value;
603 case TRANSFORM_PROPERTY_PARENT_ORIGIN:
605 mTxComponentStatic[ index ].mParentOrigin = mTxComponentStatic[ index ].mParentOrigin * value;
608 case TRANSFORM_PROPERTY_ANCHOR_POINT:
610 mTxComponentStatic[ index ].mAnchorPoint = mTxComponentStatic[ index ].mAnchorPoint * value;
613 case TRANSFORM_PROPERTY_SIZE:
615 mSize[ index ] = mSizeBase[index] = mSize[ index ] * value;
620 DALI_ASSERT_ALWAYS(false);
625 void TransformManager::BakeVector3PropertyComponentValue( TransformId id, TransformManagerProperty property, float value, unsigned int component )
627 unsigned int index( mIds[id] );
628 mComponentDirty[ index ] = true;
632 case TRANSFORM_PROPERTY_POSITION:
634 mTxComponentAnimatable[ index ].mPosition[component] = mTxComponentAnimatableBaseValue[index].mPosition[component] = value;
637 case TRANSFORM_PROPERTY_SCALE:
639 mTxComponentAnimatable[ index ].mScale[component] = mTxComponentAnimatableBaseValue[index].mScale[component] = value;
642 case TRANSFORM_PROPERTY_PARENT_ORIGIN:
644 mTxComponentStatic[ index ].mParentOrigin[component] = value;
647 case TRANSFORM_PROPERTY_ANCHOR_POINT:
649 mTxComponentStatic[ index ].mAnchorPoint[component] = value;
652 case TRANSFORM_PROPERTY_SIZE:
654 mSize[ index ][component] = mSizeBase[index][component] = value;
659 DALI_ASSERT_ALWAYS(false);
664 void TransformManager::BakeXVector3PropertyValue( TransformId id, TransformManagerProperty property, float value )
666 unsigned int index( mIds[id] );
667 mComponentDirty[ index ] = true;
671 case TRANSFORM_PROPERTY_POSITION:
673 mTxComponentAnimatable[ index ].mPosition.x = mTxComponentAnimatableBaseValue[index].mPosition.x = value;
676 case TRANSFORM_PROPERTY_SCALE:
678 mTxComponentAnimatable[ index ].mScale.x = mTxComponentAnimatableBaseValue[index].mScale.x = value;
681 case TRANSFORM_PROPERTY_PARENT_ORIGIN:
683 mTxComponentStatic[ index ].mParentOrigin.x = value;
686 case TRANSFORM_PROPERTY_ANCHOR_POINT:
688 mTxComponentStatic[ index ].mAnchorPoint.x = value;
691 case TRANSFORM_PROPERTY_SIZE:
693 mSize[ index ].x = mSizeBase[index].x = value;
698 DALI_ASSERT_ALWAYS(false);
703 void TransformManager::BakeYVector3PropertyValue( TransformId id, TransformManagerProperty property, float value )
705 unsigned int index( mIds[id] );
706 mComponentDirty[ index ] = true;
710 case TRANSFORM_PROPERTY_POSITION:
712 mTxComponentAnimatable[ index ].mPosition.y = mTxComponentAnimatableBaseValue[index].mPosition.y = value;
715 case TRANSFORM_PROPERTY_SCALE:
717 mTxComponentAnimatable[ index ].mScale.y = mTxComponentAnimatableBaseValue[index].mScale.y = value;
720 case TRANSFORM_PROPERTY_PARENT_ORIGIN:
722 mTxComponentStatic[ index ].mParentOrigin.y = value;
725 case TRANSFORM_PROPERTY_ANCHOR_POINT:
727 mTxComponentStatic[ index ].mAnchorPoint.y = value;
730 case TRANSFORM_PROPERTY_SIZE:
732 mSize[ index ].y = mSizeBase[index].y = value;
737 DALI_ASSERT_ALWAYS(false);
742 void TransformManager::BakeZVector3PropertyValue( TransformId id, TransformManagerProperty property, float value )
744 unsigned int index( mIds[id] );
745 mComponentDirty[ index ] = true;
749 case TRANSFORM_PROPERTY_POSITION:
751 mTxComponentAnimatable[ index ].mPosition.z = mTxComponentAnimatableBaseValue[index].mPosition.z = value;
754 case TRANSFORM_PROPERTY_SCALE:
756 mTxComponentAnimatable[ index ].mScale.z = mTxComponentAnimatableBaseValue[index].mScale.z = value;
759 case TRANSFORM_PROPERTY_PARENT_ORIGIN:
761 mTxComponentStatic[ index ].mParentOrigin.z = value;
764 case TRANSFORM_PROPERTY_ANCHOR_POINT:
766 mTxComponentStatic[ index ].mAnchorPoint.z = value;
769 case TRANSFORM_PROPERTY_SIZE:
771 mSize[ index ].z = mSizeBase[index].z = value;
776 DALI_ASSERT_ALWAYS(false);
781 Quaternion& TransformManager::GetQuaternionPropertyValue( TransformId id )
783 unsigned int index( mIds[id] );
784 mComponentDirty[ index ] = true;
785 return mTxComponentAnimatable[ index ].mOrientation;
788 const Quaternion& TransformManager::GetQuaternionPropertyValue( TransformId id ) const
790 return mTxComponentAnimatable[ mIds[id] ].mOrientation;
793 void TransformManager::SetQuaternionPropertyValue( TransformId id, const Quaternion& q )
795 unsigned int index( mIds[id] );
796 mTxComponentAnimatable[ index ].mOrientation = q;
797 mComponentDirty[ index ] = true;
800 void TransformManager::BakeQuaternionPropertyValue( TransformId id, const Quaternion& q )
802 unsigned int index( mIds[id] );
803 mTxComponentAnimatable[ index ].mOrientation = mTxComponentAnimatableBaseValue[index].mOrientation = q;
804 mComponentDirty[ index ] = true;
807 void TransformManager::BakeRelativeQuaternionPropertyValue( TransformId id, const Quaternion& q )
809 unsigned int index( mIds[id] );
810 mTxComponentAnimatable[ index ].mOrientation = mTxComponentAnimatableBaseValue[index].mOrientation = mTxComponentAnimatable[ index ].mOrientation * q;
811 mComponentDirty[ index ] = true;
814 } //namespace SceneGraph
815 } //namespace Internal