Navigation
API > API/Plugins > API/Plugins/ModelingComponents
UPlaneDistanceFromHitMechanic implements an interaction where a Height/Distance from a plane is defined by intersecting a ray with a target mesh, and then using that hit point to define the distance. Optionally the hit point can be snapped (eg to a world grid), and also the ray can hit other objects to define the height.
| Name | UPlaneDistanceFromHitMechanic |
| Type | class |
| Header File | /Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/Mechanics/PlaneDistanceFromHitMechanic.h |
| Include Path | #include "Mechanics/PlaneDistanceFromHitMechanic.h" |
Syntax
UCLASS (MinimalAPI)
class UPlaneDistanceFromHitMechanic : public UInteractionMechanic
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UInteractionMechanic → UPlaneDistanceFromHitMechanic
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FFrame3d | UE::Geometry::FFrame3d | Mechanics/PlaneDistanceFromHitMechanic.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bCurrentHitIsWorldHit | bool | True if the current hit/height was determined via WorldHitQueryFunc result | Mechanics/PlaneDistanceFromHitMechanic.h | |
| bFallbackToLineAxisPoint | bool | If true, then if we don't find any intersection point, just use nearest point on plane normal to ray | Mechanics/PlaneDistanceFromHitMechanic.h | |
| CurrentHeight | float | Height at last hit point | Mechanics/PlaneDistanceFromHitMechanic.h | |
| CurrentHitPosFrameWorld | UE::Geometry::FFrame3d | World frame at last hit point | Mechanics/PlaneDistanceFromHitMechanic.h | |
| LastActiveWorldHit | FHitResult | Last active hit point | Mechanics/PlaneDistanceFromHitMechanic.h | |
| WorldHitQueryFunc | TUniqueFunction< bool(const FRay &, FHitResult &)> | If this function is set, we will check it for a ray intersection if the target mesh is not hit | Mechanics/PlaneDistanceFromHitMechanic.h | |
| WorldPointSnapFunc | TUniqueFunction< bool(const FVector3d &, FVector3d &)> | If this function is set, the hit point will be passed in to this function for snapping. | Mechanics/PlaneDistanceFromHitMechanic.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const FFrame3d & GetPlane() |
Mechanics/PlaneDistanceFromHitMechanic.h | ||
virtual void Initialize
(
UE::Geometry::FDynamicMesh3&& HitTargetMesh, |
Set the hit target mesh and the plane frame. | Mechanics/PlaneDistanceFromHitMechanic.h | |
virtual void Initialize
(
UE::Geometry::FDynamicMesh3&& HitTargetMesh, |
Set the hit target mesh and the plane frame. | Mechanics/PlaneDistanceFromHitMechanic.h | |
virtual void UpdateCurrentDistance
(
const FRay& WorldRay |
Update the current distance/height based on the input world ray | Mechanics/PlaneDistanceFromHitMechanic.h |
Overridden from UInteractionMechanic
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Render
(
IToolsContextRenderAPI* RenderAPI |
Mechanics/PlaneDistanceFromHitMechanic.h | ||
virtual void Setup
(
UInteractiveTool* ParentTool |
Mechanics/PlaneDistanceFromHitMechanic.h |