Header <Components/SceneComponent.h>

#include "Components/SceneComponent.h"
Module: Engine Source: Engine/Source/Runtime/Engine/Classes/Components/SceneComponent.h

Includes 7

<EngineDefines.h>
<UObject/ObjectMacros.h>
<Math/BoxSphereBounds.h>
<UObject/UObjectGlobals.h>
<ComponentInstanceDataCache.h>
<Components/ActorComponent.h>
<TransformStateStreamHandle.h>

Contents

USceneComponent
A SceneComponent has a transform and supports attachment, but has no rendering or collision capabilities. Useful as a 'dummy' component in the hierarchy to offset others.
(uclass class : UActorComponent)
Functions13 free functions
(namespace scope)

class USceneComponent

class USceneComponent : public UActorComponentUCLASSClassGroup=(Utility, Common)BlueprintTypehideCategories=(Trigger, PhysicsVolume)MinimalAPI
A SceneComponent has a transform and supports attachment, but has no rendering or collision capabilities. Useful as a 'dummy' component in the hierarchy to offset others.

Constructors 1

USceneComponent
USceneComponent(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
UObject constructor that takes an optional ObjectInitializer

Member functions 184

GetLocalBounds
FBoxSphereBounds GetLocalBounds() const;
Get the current local bounds of the component
ClearSkipUpdateOverlaps
void ClearSkipUpdateOverlaps();
Clears the skip update overlaps flag. This should be called any time a change to state would prevent the result of UpdateOverlaps. For example attachment, changing collision settings, etc...
ShouldSkipUpdateOverlaps
bool ShouldSkipUpdateOverlaps() const;
If true, we can use the old computed overlaps
GetShouldUpdatePhysicsVolume
bool GetShouldUpdatePhysicsVolume() const;UFUNCTION
Gets whether or not the cached PhysicsVolume this component overlaps should be updated when the component is moved.
SetShouldUpdatePhysicsVolume
void SetShouldUpdatePhysicsVolume(bool bInShouldUpdatePhysicsVolume);UFUNCTION
Sets whether or not the cached PhysicsVolume this component overlaps should be updated when the component is moved.
GetCurrentScopedMovement
FScopedMovementUpdate* GetCurrentScopedMovement() const;
Returns the current scoped movement update, or NULL if there is none. @see FScopedMovementUpdate
ProcessDeferredMovementGroup
void ProcessDeferredMovementGroup(const struct FDeferredComponentMoveData& MoveData);
Process a single instance of a scoped movement. This is called from the world when we are flushing the deferred group movement queue.
SetRelativeRotationCache
void SetRelativeRotationCache(const FRotationConversionCache& InCache);
Sets the RelativeRotationCache. Used to ensure component ends up with the same RelativeRotation after calling SetWorldTransform().
GetRelativeRotationCache
const FRotationConversionCache& GetRelativeRotationCache() const;
Get the RelativeRotationCache.
GetOrCreateTransformHandle
FTransformHandle& GetOrCreateTransformHandle();
GetRelativeRotationFromWorld
FQuat GetRelativeRotationFromWorld(const FQuat & WorldRotation);
Convenience function to get the relative rotation from the passed in world rotation
SetRelativeRotationExact
void SetRelativeRotationExact(FRotator NewRotation, bool bSweep = false, FHitResult* OutSweepHitResult = nullptr, ETeleportType Teleport = ETeleportType::None);
Set the rotation of the component relative to its parent and force RelativeRotation to be equal to new rotation. This allows us to set and save Rotators with angles out side the normalized range, Note that doing so…
K2_SetRelativeLocation
void K2_SetRelativeLocation(FVector NewLocation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Set the location of the component relative to its parent
SetRelativeLocation
void SetRelativeLocation(FVector NewLocation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
K2_SetRelativeRotation
void K2_SetRelativeRotation(FRotator NewRotation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Set the rotation of the component relative to its parent
SetRelativeRotation
void SetRelativeRotation(FRotator NewRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
void SetRelativeRotation(const FQuat& NewRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
K2_SetRelativeTransform
void K2_SetRelativeTransform(const FTransform& NewTransform, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Set the transform of the component relative to its parent
SetRelativeTransform
void SetRelativeTransform(const FTransform& NewTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
GetRelativeTransform
FTransform GetRelativeTransform() const;UFUNCTIONBlueprintCallableCategory=Transformation
Returns the transform of the component relative to its parent
ResetRelativeTransform
void ResetRelativeTransform();UFUNCTIONBlueprintCallableCategory=Transformation
Reset the transform of the component relative to its parent. Sets relative location to zero, relative rotation to no rotation, and Scale to 1.
SetRelativeScale3D
void SetRelativeScale3D(FVector NewScale3D);UFUNCTIONBlueprintCallableCategory=Transformation
Set the non-uniform scale of the component relative to its parent
K2_AddRelativeLocation
void K2_AddRelativeLocation(FVector DeltaLocation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Adds a delta to the translation of the component relative to its parent
AddRelativeLocation
void AddRelativeLocation(FVector DeltaLocation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
K2_AddRelativeRotation
void K2_AddRelativeRotation(FRotator DeltaRotation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Adds a delta the rotation of the component relative to its parent
AddRelativeRotation
void AddRelativeRotation(FRotator DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
void AddRelativeRotation(const FQuat& DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
K2_AddLocalOffset
void K2_AddLocalOffset(FVector DeltaLocation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Adds a delta to the location of the component in its local reference frame
AddLocalOffset
void AddLocalOffset(FVector DeltaLocation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
K2_AddLocalRotation
void K2_AddLocalRotation(FRotator DeltaRotation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Adds a delta to the rotation of the component in its local reference frame
AddLocalRotation
void AddLocalRotation(FRotator DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
void AddLocalRotation(const FQuat& DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
K2_AddLocalTransform
void K2_AddLocalTransform(const FTransform& DeltaTransform, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Adds a delta to the transform of the component in its local reference frame. Scale is unchanged.
AddLocalTransform
void AddLocalTransform(const FTransform& DeltaTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
K2_SetWorldLocation
void K2_SetWorldLocation(FVector NewLocation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Put this component at the specified location in world space. Updates relative location to achieve the final world location.
SetWorldLocation
void SetWorldLocation(FVector NewLocation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
K2_SetWorldRotation
void K2_SetWorldRotation(FRotator NewRotation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Put this component at the specified rotation in world space. Updates relative rotation to achieve the final world rotation.
SetWorldRotation
void SetWorldRotation(FRotator NewRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
void SetWorldRotation(const FQuat& NewRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
SetWorldScale3D
void SetWorldScale3D(FVector NewScale);UFUNCTIONBlueprintCallableCategory=Transformation
Set the relative scale of the component to put it at the supplied scale in world space.
K2_SetWorldTransform
void K2_SetWorldTransform(const FTransform& NewTransform, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Set the transform of the component in world space.
SetWorldTransform
void SetWorldTransform(const FTransform& NewTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
K2_AddWorldOffset
void K2_AddWorldOffset(FVector DeltaLocation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Adds a delta to the location of the component in world space.
AddWorldOffset
void AddWorldOffset(FVector DeltaLocation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
K2_AddWorldRotation
void K2_AddWorldRotation(FRotator DeltaRotation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Adds a delta to the rotation of the component in world space.
AddWorldRotation
void AddWorldRotation(FRotator DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
void AddWorldRotation(const FQuat& DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
K2_AddWorldTransform
void K2_AddWorldTransform(const FTransform& DeltaTransform, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Adds a delta to the transform of the component in world space. Ignores scale and sets it to (1,1,1).
AddWorldTransform
void AddWorldTransform(const FTransform& DeltaTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
K2_AddWorldTransformKeepScale
void K2_AddWorldTransformKeepScale(const FTransform& DeltaTransform, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Adds a delta to the transform of the component in world space. Scale is unchanged.
AddWorldTransformKeepScale
void AddWorldTransformKeepScale(const FTransform& DeltaTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
K2_GetComponentLocation
FVector K2_GetComponentLocation() const;UFUNCTIONBlueprintCallableCategory=Transformation
Return location of the component, in world space
K2_GetComponentRotation
FRotator K2_GetComponentRotation() const;UFUNCTIONBlueprintCallableCategory=Transformation
Returns rotation of the component, in world space.
K2_GetComponentScale
FVector K2_GetComponentScale() const;UFUNCTIONBlueprintCallableCategory=Transformation
Returns scale of the component, in world space.
K2_GetComponentToWorld
FTransform K2_GetComponentToWorld() const;UFUNCTIONBlueprintCallableCategory=Transformation
Get the current component-to-world transform for this component
GetForwardVector
FVector GetForwardVector() const;UFUNCTIONBlueprintCallableCategory=Transformation
Get the forward (X) unit direction vector from this component, in world space.
GetUpVector
FVector GetUpVector() const;UFUNCTIONBlueprintCallableCategory=Transformation
Get the up (Z) unit direction vector from this component, in world space.
GetRightVector
FVector GetRightVector() const;UFUNCTIONBlueprintCallableCategory=Transformation
Get the right (Y) unit direction vector from this component, in world space.
IsSimulatingPhysics
virtual bool IsSimulatingPhysics(FName BoneName = NAME_None) const;UFUNCTIONBlueprintCallableCategory=Physics
Returns whether the specified body is currently using physics simulation
IsAnySimulatingPhysics
virtual bool IsAnySimulatingPhysics() const;UFUNCTIONBlueprintCallableCategory=Physics
Returns whether the specified body is currently using physics simulation
GetAttachChildren
const TArray<TObjectPtr<USceneComponent>>& GetAttachChildren() const;
Get the SceneComponents that are attached to this component.
GetAttachParent
USceneComponent* GetAttachParent() const;UFUNCTIONBlueprintCallableCategory=Transformation
Get the SceneComponent we are attached to.
GetAttachSocketName
FName GetAttachSocketName() const;UFUNCTIONBlueprintCallableCategory=Transformation
Get the socket we are attached to.
GetParentComponents
void GetParentComponents(TArray<USceneComponent*>& Parents) const;UFUNCTIONBlueprintCallableCategory=Components
Gets all attachment parent components up to and including the root component
GetNumChildrenComponents
int32 GetNumChildrenComponents() const;UFUNCTIONBlueprintCallableCategory=Components
Gets the number of attached children components
GetChildComponent
USceneComponent* GetChildComponent(int32 ChildIndex) const;UFUNCTIONBlueprintCallableCategory=Components
Gets the attached child component at the specified location
GetChildrenComponents
void GetChildrenComponents(bool bIncludeAllDescendants, TArray<USceneComponent*>& Children) const;UFUNCTIONBlueprintCallableCategory=Components
Gets all components that are attached to this component, possibly recursively
SetupAttachment
void SetupAttachment(USceneComponent* InParent, FName InSocketName = NAME_None);
Initializes desired Attach Parent and SocketName to be attached to when the component is registered. Generally intended to be called from its Owning Actor's constructor and should be preferred over AttachToComponent…
AttachToComponent
virtual bool AttachToComponent(USceneComponent* InParent, const FAttachmentTransformRules& AttachmentRules, FName InSocketName = NAME_None);
Attach this component to another scene component, optionally at a named socket. It is valid to call this on components whether or not they have been Registered, however from constructor or when not registered it is…
K2_AttachToComponent
bool K2_AttachToComponent(USceneComponent* Parent, FName SocketName, EAttachmentRule LocationRule, EAttachmentRule RotationRule, EAttachmentRule ScaleRule, bool bWeldSimulatedBodies);UFUNCTIONBlueprintCallableCategory=Transformation
Attach this component to another scene component, optionally at a named socket. It is valid to call this on components whether or not they have been Registered.
K2_DetachFromComponent
void K2_DetachFromComponent(EDetachmentRule LocationRule = EDetachmentRule::KeepRelative, EDetachmentRule RotationRule = EDetachmentRule::KeepRelative, EDetachmentRule ScaleRule = EDetachmentRule::KeepRelative, bool bCallModify = true);UFUNCTIONBlueprintCallableCategory=Transformation
Detach this component from whatever it is attached to. Automatically unwelds components that are welded together (see AttachToComponent), though note that some effects of welding may not be undone.
DetachFromComponent
virtual void DetachFromComponent(const FDetachmentTransformRules& DetachmentRules);
Detach this component from whatever it is attached to. Automatically unwelds components that are welded together (See AttachToComponent), though note that some effects of welding may not be undone.
GetAllSocketNames
TArray<FName> GetAllSocketNames() const;UFUNCTIONBlueprintCallableCategory=Transformation
Gets the names of all the sockets on the component.
GetSocketTransform
virtual FTransform GetSocketTransform(FName InSocketName, ERelativeTransformSpace TransformSpace = RTS_World) const;UFUNCTIONBlueprintCallableCategory=Transformation
Get world-space socket transform.
GetSocketLocation
virtual FVector GetSocketLocation(FName InSocketName) const;UFUNCTIONBlueprintCallableCategory=Transformation
Get world-space socket or bone location.
GetSocketRotation
virtual FRotator GetSocketRotation(FName InSocketName) const;UFUNCTIONBlueprintCallableCategory=Transformation
Get world-space socket or bone FRotator rotation.
DoesSocketExist
virtual bool DoesSocketExist(FName InSocketName) const;UFUNCTIONBlueprintCallableCategory=Transformation
Return true if socket with the given name exists
HasAnySockets
virtual bool HasAnySockets() const;
Returns true if this component has any sockets
QuerySupportedSockets
virtual void QuerySupportedSockets(TArray<FComponentSocketDescription>& OutSockets) const;
Get a list of sockets this component contains
GetComponentVelocity
virtual FVector GetComponentVelocity() const;UFUNCTIONBlueprintCallableCategory=Transformation
Get velocity of the component: either ComponentVelocity, or the velocity of the physics body if simulating physics.
IsVisible
virtual bool IsVisible() const;UFUNCTIONBlueprintCallableCategory=Rendering
Returns true if this component is visible in the current context
OnVisibilityChanged
virtual void OnVisibilityChanged();protected
Overridable internal function to respond to changes in the visibility of the component.
OnHiddenInGameChanged
virtual void OnHiddenInGameChanged();protected
Overridable internal function to respond to changes in the hidden in game value of the component.
SetVisibility
void SetVisibility(bool bNewVisibility, bool bPropagateToChildren=false);UFUNCTIONBlueprintCallableCategory=Rendering
Set visibility of the component, if during game use this to turn on/off
ToggleVisibility
void ToggleVisibility(bool bPropagateToChildren = false);UFUNCTIONBlueprintCallableCategory=Rendering
Toggle visibility of the component
SetHiddenInGame
void SetHiddenInGame(bool NewHidden, bool bPropagateToChildren=false);UFUNCTIONBlueprintCallableCategory=Development
Changes the value of bHiddenInGame, if false this will disable Visibility during gameplay
GetLifetimeReplicatedProps
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
OnPreRegister
virtual void OnPreRegister() override;
OnRegister
virtual void OnRegister() override;
OnUnregister
virtual void OnUnregister() override;
EndPlay
virtual void EndPlay(EEndPlayReason::Type Reason) override;
ShouldCreateRenderState
virtual bool ShouldCreateRenderState() const override;
UpdateComponentToWorld
virtual void UpdateComponentToWorld(EUpdateTransformFlags UpdateTransformFlags = EUpdateTransformFlags::None, ETeleportType Teleport = ETeleportType::None) override final;
DestroyComponent
virtual void DestroyComponent(bool bPromoteChildren = false) override;
OnComponentDestroyed
virtual void OnComponentDestroyed(bool bDestroyingHierarchy) override;
ApplyWorldOffset
virtual void ApplyWorldOffset(const FVector& InOffset, bool bWorldShift) override;
GetComponentInstanceData
virtual TStructOnScope<FActorComponentInstanceData> GetComponentInstanceData() const override;
BeginDestroy
virtual void BeginDestroy() override;
IsPostLoadThreadSafe
virtual bool IsPostLoadThreadSafe() const override;
PreNetReceive
virtual void PreNetReceive() override;
PostNetReceive
virtual void PostNetReceive() override;
PostRepNotifies
virtual void PostRepNotifies() override;
Serialize
virtual void Serialize(FArchive& Ar) override;
InternalSetWorldLocationAndRotation
bool InternalSetWorldLocationAndRotation(FVector NewLocation, const FQuat& NewQuat, bool bNoPhysics = false, ETeleportType Teleport = ETeleportType::None);protected
Internal helper, for use from MoveComponent(). Special codepath since the normal setters call MoveComponent.
OnUpdateTransform
virtual void OnUpdateTransform(EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport = ETeleportType::None);protected
Native callback when this component is moved
CheckStaticMobilityAndWarn
bool CheckStaticMobilityAndWarn(const FText& ActionText) const;protected
Check if mobility is set to non-static. If it's static we trigger a PIE warning and return true
UpdateOverlapsImpl
virtual bool UpdateOverlapsImpl(const TOverlapArrayView* PendingOverlaps = nullptr, bool bDoNotifies = true, const TOverlapArrayView* OverlapsAtEndLocation = nullptr);protected
Internal helper for UpdateOverlaps
UpdateOverlaps
bool UpdateOverlaps(const TOverlapArrayView* PendingOverlaps = nullptr, bool bDoNotifies = true, const TOverlapArrayView* OverlapsAtEndLocation = nullptr);
Queries world and updates overlap tracking state for this component
MoveComponent
bool MoveComponent(const FVector& Delta, const FQuat& NewRotation, bool bSweep, FHitResult* Hit=NULL, EMoveComponentFlags MoveFlags = MOVECOMP_NoFlags, ETeleportType Teleport = ETeleportType::None);
bool MoveComponent(const FVector& Delta, const FRotator& NewRotation, bool bSweep, FHitResult* Hit=NULL, EMoveComponentFlags MoveFlags = MOVECOMP_NoFlags, ETeleportType Teleport = ETeleportType::None);
Tries to move the component by a movement vector (Delta) and sets rotation to NewRotation. Assumes that the component's current location is valid and that the component does fit in its current Location. Dispatches…
MoveComponentImpl
virtual bool MoveComponentImpl(const FVector& Delta, const FQuat& NewRotation, bool bSweep, FHitResult* Hit = NULL, EMoveComponentFlags MoveFlags = MOVECOMP_NoFlags, ETeleportType Teleport = ETeleportType::None);protected
Override this method for custom behavior for MoveComponent
IsDeferringMovementUpdates
bool IsDeferringMovementUpdates(const FScopedMovementUpdate& ScopedUpdate) const;protected
bool IsDeferringMovementUpdates() const;
Returns true if movement is currently within the scope of an FScopedMovementUpdate.
HasGroupedMovementUpdate
bool HasGroupedMovementUpdate(const FScopedMovementUpdate& ScopedUpdate) const;protected
ConditionalUpdateComponentToWorld
void ConditionalUpdateComponentToWorld();
Call UpdateComponentToWorld if bComponentToWorldUpdated is false.
HasGroupedMovementUpdates
bool HasGroupedMovementUpdates() const;
Returns true if this component is part of a grouped movement update that will apply later
OnAttachmentChanged
virtual void OnAttachmentChanged();
Called when AttachParent changes, to allow the scene to update its attachment state.
GetComponentLocation
FVector GetComponentLocation() const;
Return location of the component, in world space
GetComponentRotation
FRotator GetComponentRotation() const;
Return rotation of the component, in world space
GetComponentQuat
FQuat GetComponentQuat() const;
Return rotation quaternion of the component, in world space
GetComponentScale
FVector GetComponentScale() const;
Return scale of the component, in world space
SetComponentToWorld
void SetComponentToWorld(const FTransform& NewComponentToWorld);
Sets the cached component to world directly. This should be used very rarely.
GetComponentToWorld
const FTransform& GetComponentToWorld() const;
Get the current component-to-world transform for this component TODO: probably deprecate this in favor of GetComponentTransform
GetComponentTransform
const FTransform& GetComponentTransform() const;
Get the current component-to-world transform for this component
UpdateChildTransforms
void UpdateChildTransforms(EUpdateTransformFlags UpdateTransformFlags = EUpdateTransformFlags::None, ETeleportType Teleport = ETeleportType::None);
Update transforms of any components attached to this one.
CalcBounds
virtual FBoxSphereBounds CalcBounds(const FTransform& LocalToWorld) const;
Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size.
CalcLocalBounds
virtual FBoxSphereBounds CalcLocalBounds() const;
Calculate the local bounds of the component. Default behavior is calling CalcBounds with an identity transform.
CalcBoundingCylinder
virtual void CalcBoundingCylinder(float& CylinderRadius, float& CylinderHalfHeight) const;
Calculate the axis-aligned bounding cylinder of the component (radius in X-Y, half-height along Z axis). Default behavior is just a cylinder around the box of the cached BoxSphereBounds.
UpdateBounds
virtual void UpdateBounds();
Update the Bounds of the component.
ShouldCollideWhenPlacing
virtual bool ShouldCollideWhenPlacing() const;
If true, bounds should be used when placing component/actor in level. Does not affect spawning.
UpdatePhysicsVolume
virtual void UpdatePhysicsVolume(bool bTriggerNotifiers);
Updates the PhysicsVolume of this SceneComponent, if bShouldUpdatePhysicsVolume is true.
SetPhysicsVolume
void SetPhysicsVolume(APhysicsVolume * NewVolume, bool bTriggerNotifiers);
Replace current PhysicsVolume to input NewVolume
GetPhysicsVolume
APhysicsVolume* GetPhysicsVolume() const;UFUNCTIONBlueprintCallableCategory=PhysicsVolume
Get the PhysicsVolume overlapping this component.
GetCollisionResponseToChannels
virtual const FCollisionResponseContainer& GetCollisionResponseToChannels() const;
Return const reference to CollsionResponseContainer
IsVisibleInEditor
virtual bool IsVisibleInEditor() const;
Return true if visible in editor
ShouldRender
bool ShouldRender() const;
return true if it should render
CanEverRender
bool CanEverRender() const;
return true if it can ever render
ShouldComponentAddToScene
bool ShouldComponentAddToScene() const;
Looking at various values of the component, determines if this component should be added to the scene
CalcNewComponentToWorld
FTransform CalcNewComponentToWorld(const FTransform& NewRelativeTransform, const USceneComponent* Parent = nullptr, FName SocketName = NAME_None) const;protected
Calculate the new ComponentToWorld transform for this component. Parent is optional and can be used for computing ComponentToWorld based on arbitrary USceneComponent. If Parent is not passed in we use the component's…
CalcNewComponentToWorld_GeneralCase
FTransform CalcNewComponentToWorld_GeneralCase(const FTransform& NewRelativeTransform, const USceneComponent* Parent, FName SocketName) const;protected
Utility function to handle calculating transform with a parent
K2_SetRelativeLocationAndRotation
void K2_SetRelativeLocationAndRotation(FVector NewLocation, FRotator NewRotation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Set the location and rotation of the component relative to its parent
SetRelativeLocationAndRotation
void SetRelativeLocationAndRotation(FVector NewLocation, FRotator NewRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
void SetRelativeLocationAndRotation(FVector NewLocation, const FQuat& NewRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
SetAbsolute
void SetAbsolute(bool bNewAbsoluteLocation = false, bool bNewAbsoluteRotation = false, bool bNewAbsoluteScale = false);UFUNCTIONBlueprintCallableCategory=Transformation
Set which parts of the relative transform should be relative to parent, and which should be relative to world
K2_SetWorldLocationAndRotation
void K2_SetWorldLocationAndRotation(FVector NewLocation, FRotator NewRotation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);UFUNCTIONBlueprintCallableCategory=Transformation
Set the relative location and rotation of the component to put it at the supplied pose in world space.
SetWorldLocationAndRotation
void SetWorldLocationAndRotation(FVector NewLocation, FRotator NewRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
void SetWorldLocationAndRotation(FVector NewLocation, const FQuat& NewRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
Set the relative location and FQuat rotation of the component to put it at the supplied pose in world space.
SetWorldLocationAndRotationNoPhysics
void SetWorldLocationAndRotationNoPhysics(const FVector& NewLocation, const FRotator& NewRotation);
Special version of SetWorldLocationAndRotation that does not affect physics.
IsWorldGeometry
virtual bool IsWorldGeometry() const;
Is this component considered 'world' geometry, by default checks if this uses the WorldStatic collision channel
GetCollisionEnabled
virtual ECollisionEnabled::Type GetCollisionEnabled() const;
Returns the form of collision for this component
IsCollisionEnabled
bool IsCollisionEnabled() const;
Utility to see if there is any form of collision (query or physics) enabled on this component.
IsQueryCollisionEnabled
bool IsQueryCollisionEnabled() const;
Utility to see if there is any query collision enabled on this component.
IsPhysicsCollisionEnabled
bool IsPhysicsCollisionEnabled() const;
Utility to see if there is any physics collision enabled on this component.
GetCollisionResponseToChannel
virtual ECollisionResponse GetCollisionResponseToChannel(ECollisionChannel Channel) const;
Returns the response that this component has to a specific collision channel.
GetCollisionObjectType
virtual ECollisionChannel GetCollisionObjectType() const;
Returns the channel that this component belongs to when it moves.
GetCollisionResponseToComponent
ECollisionResponse GetCollisionResponseToComponent(USceneComponent* OtherComponent) const;
Compares the CollisionObjectType of each component against the Response of the other, to see what kind of response we should generate
SetMobility
virtual void SetMobility(EComponentMobility::Type NewMobility);UFUNCTIONBlueprintCallableCategory=Transformation
Set how often this component is allowed to move during runtime. Causes a component re-register if the component is already registered
GetAttachmentRoot
USceneComponent* GetAttachmentRoot() const;
Walks up the attachment chain from this SceneComponent and returns the SceneComponent at the top. If AttachParent is NULL, returns this.
GetAttachmentRootActor
AActor* GetAttachmentRootActor() const;
Walks up the attachment chain from this SceneComponent and returns the top-level actor it's attached to. Returns Owner if unattached.
GetActorPositionForRenderer
FVector GetActorPositionForRenderer() const;
Returns the ActorPosition for use by rendering. This comes from walking the attachment chain to the top-level actor.
GetAttachParentActor
AActor* GetAttachParentActor() const;
Gets the owner of the attach parent
IsAttachedTo
bool IsAttachedTo(const USceneComponent* TestComp) const;
Walks up the attachment chain to see if this component is attached to the supplied component. If TestComp == this, returns false.
GetSocketWorldLocationAndRotation
void GetSocketWorldLocationAndRotation(FName InSocketName, FVector& OutLocation, FRotator& OutRotation) const;
void GetSocketWorldLocationAndRotation(FName InSocketName, FVector& OutLocation, FQuat& OutRotation) const;
Find the world-space location and rotation of the given named socket. If the socket is not found, then it returns the component's location and rotation in world space.
CanAttachAsChild
virtual bool CanAttachAsChild(const USceneComponent* ChildComponent, FName SocketName) const;
Called to see if it's possible to attach another scene component as a child. Note: This can be called on template component as well!
GetPlacementExtent
virtual FBoxSphereBounds GetPlacementExtent() const;
Get the extent used when placing this component in the editor, used for 'pulling back' hit.
OnChildAttached
virtual void OnChildAttached(USceneComponent* ChildComponent);protected
Called after a child scene component is attached to this component. Note: Do not change the attachment state of the child during this call.
OnChildDetached
virtual void OnChildDetached(USceneComponent* ChildComponent);protected
Called after a child scene component is detached from this component. Note: Do not change the attachment state of the child during this call.
UpdateNavigationData
void UpdateNavigationData();protected
Called after changing transform, tries to update navigation octree for this component
PostUpdateNavigationData
void PostUpdateNavigationData();protected
Called after changing transform, tries to update navigation octree for owner
AreDynamicDataChangesAllowed
bool AreDynamicDataChangesAllowed(bool bIgnoreStationary = true) const;protected
Determine if dynamic data is allowed to be changed.
CanHaveStaticMobility
virtual const bool CanHaveStaticMobility() const;
Determines whether or not the component can have its mobility set to static
PropagateLightingScenarioChange
virtual void PropagateLightingScenarioChange();
Updates any visuals after the lighting has changed
IsPrecomputedLightingValid
virtual bool IsPrecomputedLightingValid() const;
True if our precomputed lighting is up to date
OnReceiveReplicatedState
virtual void OnReceiveReplicatedState(const FVector X, const FQuat R, const FVector V, const FVector W);
Called when client receive replication data, before replication is performed. Can be overridden in derived components to make use of replication data locally. Note that replication still applies when overriding this,…
GetRelativeLocation
FVector GetRelativeLocation() const;
Gets the literal value of RelativeLocation. Note, this may be an absolute location if this is a root component (not attached to anything) or when IsUsingAbsoluteLocation returns true.
GetRelativeLocation_DirectMutable
FVector& GetRelativeLocation_DirectMutable();
Gets a refence to RelativeLocation with the expectation that it will be modified. Note, this may be an absolute location if this is a root component (not attached to anything) or when IsUsingAbsoluteLocation returns…
SetRelativeLocation_Direct
void SetRelativeLocation_Direct(const FVector NewRelativeLocation);
Sets the value of RelativeLocation without causing other side effects to this instance.
GetRelativeRotation
FRotator GetRelativeRotation() const;
Gets the literal value of RelativeRotation. Note, this may be an absolute rotation if this is a root component (not attached to anything) or when GetAbsoluteRotation returns true.
GetRelativeRotation_DirectMutable
FRotator& GetRelativeRotation_DirectMutable();
Gets a refence to RelativeRotation with the expectation that it will be modified. Note, this may be an absolute rotation if this is a root component (not attached to anything) or when GetAbsoluteRotation returns true.
SetRelativeRotation_Direct
void SetRelativeRotation_Direct(const FRotator NewRelativeRotation);
Sets the value of RelativeRotation without causing other side effects to this instance.
GetRelativeScale3D
FVector GetRelativeScale3D() const;
Gets the literal value of RelativeScale3D. Note, this may be an absolute scale if this is a root component (not attached to anything) or when GetAbsoluteScale3D returns true.
GetRelativeScale3D_DirectMutable
FVector& GetRelativeScale3D_DirectMutable();
Gets a refence to RelativeRotation with the expectation that it will be modified. Note, this may be an absolute scale if this is a root component (not attached to anything) or when GetAbsoluteScale3D returns true.
SetRelativeScale3D_Direct
void SetRelativeScale3D_Direct(const FVector NewRelativeScale3D);
Sets the value of RelativeScale3D without causing other side effects to this instance.
SetRelativeTransform_Direct
void SetRelativeTransform_Direct(const FTransform& NewRelativeTransform);
Helper function to set the location, rotation, and scale without causing other side effects to this instance.
IsUsingAbsoluteLocation
bool IsUsingAbsoluteLocation() const;
Gets the literal value of bAbsoluteLocation.
SetUsingAbsoluteLocation
void SetUsingAbsoluteLocation(const bool bInAbsoluteLocation);
Sets the value of bAbsoluteLocation without causing other side effects to this instance.
IsUsingAbsoluteRotation
bool IsUsingAbsoluteRotation() const;
Gets the literal value of bAbsoluteRotation.
SetUsingAbsoluteRotation
void SetUsingAbsoluteRotation(const bool bInAbsoluteRotation);
Sets the value of bAbsoluteRotation without causing other side effects to this instance.
IsUsingAbsoluteScale
bool IsUsingAbsoluteScale() const;
Gets the literal value of bAbsoluteScale.
SetUsingAbsoluteScale
void SetUsingAbsoluteScale(const bool bInAbsoluteRotation);
Sets the value of bAbsoluteScale without causing other side effects to this instance.
GetVisibleFlag
bool GetVisibleFlag() const;
Gets the literal value of bVisible.
SetVisibleFlag
void SetVisibleFlag(const bool bInVisible);
Sets the value of bVisible without causing other side effects to this instance.
GetMobility
EComponentMobility::Type GetMobility() const;
Return the Mobility of this component.

Static functions 10

GetDefaultSceneRootVariableName
static FName GetDefaultSceneRootVariableName();
The name to use for the default scene root variable
IsGroupedComponentMovementEnabled
static bool IsGroupedComponentMovementEnabled();UFUNCTION
ConvertAttachLocation
static void ConvertAttachLocation(EAttachLocation::Type InAttachLocation, EAttachmentRule& InOutLocationRule, EAttachmentRule& InOutRotationRule, EAttachmentRule& InOutScaleRule);
Backwards compatibility: Used to convert old-style EAttachLocation to new-style EAttachmentRules
GetRelativeLocationPropertyName
static const FName GetRelativeLocationPropertyName();
Gets the property name for RelativeLocation.
GetRelativeRotationPropertyName
static const FName GetRelativeRotationPropertyName();
Gets the property name for RelativeRotation.
GetRelativeScale3DPropertyName
static const FName GetRelativeScale3DPropertyName();
Gets the property name for RelativeScale3D.
GetAbsoluteLocationPropertyName
static const FName GetAbsoluteLocationPropertyName();
Gets the property name for bAbsoluteLocation.
GetAbsoluteRotationPropertyName
static const FName GetAbsoluteRotationPropertyName();
Gets the property name for bAbsoluteRotation.
GetAbsoluteScalePropertyName
static const FName GetAbsoluteScalePropertyName();
Gets the property name for bAbsoluteScale. This exists so subclasses don't need to have direct access to the bAbsoluteScale property so it can be made private later.
GetVisiblePropertyName
static const FName GetVisiblePropertyName();
Gets the property name for bVisible. This exists so subclasses don't need to have direct access to the bVisible property so it can be made private later.

Functions

Free functions 13

GetAttachChildren
const TArray<TObjectPtr<USceneComponent>>& USceneComponent::GetAttachChildren() const;
USceneComponent inlines
GetAttachParent
USceneComponent* USceneComponent::GetAttachParent() const;
GetAttachSocketName
FName USceneComponent::GetAttachSocketName() const;
ConditionalUpdateComponentToWorld
void USceneComponent::ConditionalUpdateComponentToWorld();
MoveComponent
bool USceneComponent::MoveComponent(const FVector& Delta, const FQuat& NewRotation, bool bSweep, FHitResult* Hit, EMoveComponentFlags MoveFlags, ETeleportType Teleport);
SetRelativeLocation
void USceneComponent::SetRelativeLocation(FVector NewLocation, bool bSweep, FHitResult* OutSweepHitResult, ETeleportType Teleport);
SetRelativeRotation
void USceneComponent::SetRelativeRotation(const FQuat& NewRotation, bool bSweep, FHitResult* OutSweepHitResult, ETeleportType Teleport);
AddRelativeLocation
void USceneComponent::AddRelativeLocation(FVector DeltaLocation, bool bSweep, FHitResult* OutSweepHitResult, ETeleportType Teleport);
AddRelativeRotation
void USceneComponent::AddRelativeRotation(FRotator DeltaRotation, bool bSweep, FHitResult* OutSweepHitResult, ETeleportType Teleport);
GetCurrentScopedMovement
FScopedMovementUpdate* USceneComponent::GetCurrentScopedMovement() const;
IsDeferringMovementUpdates
bool USceneComponent::IsDeferringMovementUpdates() const;
HasGroupedMovementUpdates
bool USceneComponent::HasGroupedMovementUpdates() const;
GetShouldUpdatePhysicsVolume
bool USceneComponent::GetShouldUpdatePhysicsVolume() const;