Navigation
API > API/Plugins > API/Plugins/ModelingComponents > API/Plugins/ModelingComponents/Snapping
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- USceneSnappingManager
- UModelingSceneSnappingManager
References
| Module | ModelingComponents |
| Header | /Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/Snapping/ModelingSceneSnappingManager.h |
| Include | #include "Snapping/ModelingSceneSnappingManager.h" |
Syntax
UCLASS&40;&41;
class UModelingSceneSnappingManager : public USceneSnappingManager
Remarks
UModelingSceneSnappingManager is an implementation of snapping suitable for use in Modeling Tools/Gizmos (and potentially other places).
Currently Supports:
- snap to position/rotation grid
- snap to mesh vertex position
- snap to mesh edge position
Snapping to mesh vertex/edge positions currently works for Volume (BrushComponent), StaticMeshComponent, and DynamicMeshComponent.
Currently the StaticMesh vertex/edge snapping is dependent on the Physics system, and may fail or return nonsense results in some cases, due to the physics complex-collision mesh deviating from the source-model mesh.
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bQueueModifiedDynamicMeshUpdates | PauseSceneGeometryUpdates / UnPauseSceneGeometryUpdates support. | |
| TMap< UPrimitiveComponent *, AActor * > | ComponentToActorMap | This map allows us to identify the Components belonging to Actors. | |
| TMap< UPrimitiveComponent *, TWeakObjectPtr< UDynamicMeshComponent > > | DynamicMeshComponents | ||
| FDelegateHandle | OnComponentTransformChangedHandle | ||
| FDelegateHandle | OnObjectModifiedHandler | ||
| TObjectPtr< UInteractiveToolsContext > | ParentContext | ||
| TSet< UDynamicMeshComponent * > | PendingModifiedDynamicMeshes | ||
| const IToolsContextQueriesAPI * | QueriesAPI | ||
| TSharedPtr< UE::Geometry::FSceneGeometrySpatialCache > | SpatialCache | Cache for objects in the level |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | BuildSpatialCacheForWorld
(
UWorld* World, |
Explicitly populate the spatial-cache tracking set with specific Actors/Components (alternative to OnActorAdded route) | |
| bool | ExecuteSceneSnapQueryPosition
(
const FSceneSnapQueryRequest& Request, |
||
| bool | ExecuteSceneSnapQueryRotation
(
const FSceneSnapQueryRequest& Request, |
||
| void | HandleDynamicMeshModifiedDelegate
(
UDynamicMeshComponent* Component |
||
| void | HandleGlobalComponentTransformChangedDelegate
(
USceneComponent* Component |
||
| void | HandleGlobalObjectModifiedDelegate
(
UObject* Object |
||
| void | Initialize
(
TObjectPtr< UInteractiveToolsContext > ToolsContext |
||
| bool | IsComponentTypeSupported
(
const UPrimitiveComponent* Component |
API for managing the set of Actors/Components that the snapping system knows about. | |
| void | OnActorAdded
(
AActor* Actor, |
Enable spatial-cache tracking for the Components of the Actor that pass the PrimitiveFilter | |
| void | OnActorRemoved
(
AActor* Actor |
Disable spatial-cache tracking for any Components of the Actor | |
| void | OnComponentAdded
(
UPrimitiveComponent* Component |
Enable spatial-cache tracking for the Component | |
| void | OnComponentModified
(
UActorComponent* Component |
Notify the internal spatial-cache tracking system that the Component has been modified (ie cache needs to be rebiult) | |
| void | OnComponentRemoved
(
UPrimitiveComponent* Component |
Disable spatial-cache tracking for the Component | |
| void | APIs for configuring the SceneSnappingManager behavior | ||
| void | Shutdown () |
||
| void | UnPauseSceneGeometryUpdates
(
bool bImmediateRebuilds |
Re-enable live updates that were prevented by PauseSceneGeometryUpdates(), and execute any pending updates that were requested while in the pause state. |
Overridden from USceneSnappingManager
| Type | Name | Description | |
|---|---|---|---|
| bool | ExecuteSceneHitQuery
(
const FSceneHitQueryRequest& Request, |
USceneSnappingManager API Try to find a Hit Point in the scene that satisfies the HitQuery Request. | |
| bool | ExecuteSceneSnapQuery
(
const FSceneSnapQueryRequest& Request, |
Try to find Snap Targets in the scene that satisfy the Snap Query. |