本文整理汇总了C++中USceneComponent::SetRelativeScale3D方法的典型用法代码示例。如果您正苦于以下问题:C++ USceneComponent::SetRelativeScale3D方法的具体用法?C++ USceneComponent::SetRelativeScale3D怎么用?C++ USceneComponent::SetRelativeScale3D使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USceneComponent
的用法示例。
在下文中一共展示了USceneComponent::SetRelativeScale3D方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void FMovieScene3DTransformTrackInstance::Update( float Position, float LastPosition, const TArray<UObject*>& RuntimeObjects, class IMovieScenePlayer& Player )
{
FVector Translation;
FRotator Rotation;
FVector Scale;
bool bHasTranslationKeys = false;
bool bHasRotationKeys = false;
bool bHasScaleKeys = false;
if( TransformTrack->Eval( Position, LastPosition, Translation, Rotation, Scale, bHasTranslationKeys, bHasRotationKeys, bHasScaleKeys ) )
{
for( int32 ObjIndex = 0; ObjIndex < RuntimeObjects.Num(); ++ObjIndex )
{
UObject* Object = RuntimeObjects[ObjIndex];
AActor* Actor = Cast<AActor>( Object );
USceneComponent* SceneComponent = NULL;
if( Actor && Actor->GetRootComponent() )
{
// If there is an actor, modify its root component
SceneComponent = Actor->GetRootComponent();
}
else
{
// No actor was found. Attempt to get the object as a component in the case that we are editing them directly.
SceneComponent = Cast<USceneComponent>( Object );
}
// Set the relative translation and rotation. Note they are set once instead of individually to avoid a redundant component transform update.
SceneComponent->SetRelativeLocationAndRotation(
bHasTranslationKeys ? Translation : SceneComponent->RelativeLocation,
bHasRotationKeys ? Rotation : SceneComponent->RelativeRotation );
if( bHasScaleKeys )
{
SceneComponent->SetRelativeScale3D( Scale );
}
}
}
}