mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Transform Optimization
This commit is contained in:
@@ -67,6 +67,7 @@ namespace Nuake
|
||||
transformComponent.SetLocalRotation(localRotation);
|
||||
transformComponent.SetLocalScale(localScale);
|
||||
transformComponent.SetLocalTransform(finalTransform);
|
||||
transformComponent.Dirty = false;
|
||||
}
|
||||
|
||||
for (auto& childBone : bone.Children)
|
||||
|
||||
@@ -78,20 +78,33 @@ namespace Nuake
|
||||
Quat globalOrientation = transform.GetLocalRotation();
|
||||
Vector3 globalScale = transform.GetLocalScale();
|
||||
|
||||
#ifndef FRAME_PERFECT_TRANSFORM
|
||||
ParentComponent parentComponent = currentParent.GetComponent<ParentComponent>();
|
||||
while (parentComponent.HasParent)
|
||||
if (parentComponent.HasParent)
|
||||
{
|
||||
TransformComponent& transformComponent = parentComponent.Parent.GetComponent<TransformComponent>();
|
||||
|
||||
globalPosition = transformComponent.GetLocalPosition() + (globalPosition);
|
||||
globalPosition = transformComponent.GetGlobalPosition() + (globalPosition);
|
||||
|
||||
globalScale *= transformComponent.GetGlobalScale();
|
||||
globalOrientation = transformComponent.GetGlobalRotation() * globalOrientation;
|
||||
globalTransform = transformComponent.GetGlobalTransform() * globalTransform;
|
||||
}
|
||||
#else
|
||||
while (parentComponent.HasParent)
|
||||
{
|
||||
TransformComponent& transformComponent = parentComponent.Parent.GetComponent<TransformComponent>();
|
||||
|
||||
globalPosition = transformComponent.GetLocalPosition() + (globalPosition);
|
||||
|
||||
globalScale *= transformComponent.GetLocalScale();
|
||||
globalOrientation = transformComponent.GetLocalRotation() * globalOrientation;
|
||||
globalTransform = transformComponent.GetLocalTransform() * globalTransform;
|
||||
|
||||
|
||||
NameComponent& nameComponent = parentComponent.Parent.GetComponent<NameComponent>();
|
||||
parentComponent = parentComponent.Parent.GetComponent<ParentComponent>();
|
||||
}
|
||||
#endif // FRAME_PERFECT_TRANSFORM
|
||||
|
||||
transform.SetGlobalPosition(globalPosition);
|
||||
transform.SetGlobalRotation(globalOrientation);
|
||||
|
||||
Reference in New Issue
Block a user