Created
November 19, 2022 05:24
-
-
Save intaxwashere/829f49e43d4ad27534dd65e285926d8e to your computer and use it in GitHub Desktop.
Macro versions of set world transform fast path from MassSample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// macro version of static function if performance is very very very critical and you want to ensure function will be inlined. | |
#define SET_WORLD_TRANSFORM_FAST(InComp, InTransform) \ | |
InComp->SetComponentToWorld(InTransform); \ | |
InComp->UpdateBounds(); \ | |
\ | |
InComp->MarkRenderTransformDirty(); \ | |
for (auto Component : InComp->GetAttachChildren()) \ | |
{ \ | |
InTransform = Component->GetRelativeTransform() * InTransform; \ | |
\ | |
SetWorldTransformFastPathWithOverlaps(Component, InTransform); \ | |
} | |
// macro version of static function if performance is very very very critical and you want to ensure function will be inlined. | |
#define SET_WORLD_TRANSFORM_FAST_WITH_OVERLAPS(InComp, InTransform) \ | |
InComp->SetComponentToWorld(InTransform); \ | |
InComp->UpdateBounds(); \ | |
\ | |
InComp->BodyInstance.SetBodyTransform(InTransform, ETeleportType::None); \ | |
InComp->BodyInstance.UpdateBodyScale(InTransform.GetScale3D()); \ | |
\ | |
InComp->MarkRenderTransformDirty(); \ | |
for (auto Component : InComp->GetAttachChildren()) \ | |
{ \ | |
InTransform = Component->GetRelativeTransform() * InTransform; \ | |
\ | |
SetWorldTransformFastPathWithOverlaps(Component, InTransform); \ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment