UPlaneDistanceFromHitMechanic

[UPlaneDistanceFromHitMechanic](API\Plugins\ModelingComponents\Mechanics\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.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

ModelingComponents

Header

/Engine/Plugins/Experimental/MeshModelingToolset/Source/ModelingComponents/Public/Mechanics/PlaneDistanceFromHitMechanic.h

Include

#include "Mechanics/PlaneDistanceFromHitMechanic.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)()
class UPlaneDistanceFromHitMechanic : public UInteractionMechanic

Remarks

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.

Variables

Name Description

Public variable

bool

 

bCurrentHitIsWorldHit

True if the current hit/height was determined via WorldHitQueryFunc result

Public variable

bool

 

bFallbackToLineAxisPoint

If true, then if we don't find any intersection point, just use nearest point on plane normal to ray

Public variable

float

 

CurrentHeight

Height at last hit point

Public variable

FFrame3d

 

CurrentHitPosFrameWorld

World frame at last hit point

Public variable

FHitResult

 

LastActiveWorldHit

Last active hit point

Protected variable

FFrame3d

 

PreviewHeightFrame

Protected variable

FDynamicMesh3

 

PreviewHeightTarget

Protected variable

FDynamicMeshAAB...

 

PreviewHeightTargetAABB

Public variable

TUniqueFunction...

 

WorldHitQueryFunc

If this function is set, we will check it for a ray intersection if the target mesh is not hit

Public variable

TUniqueFunction...

 

WorldPointSnapFunc

If this function is set, the hit point will be passed in to this function for snapping.

Functions

Name Description

Public function Const

const FFrame...

 

GetPlane()

Public function Virtual

void

 

Initialize

(
    FDynamicMesh3&& HitTargetMesh,
    const FFrame3d& PlaneFrameWorld,
    bool bMeshInWorldCoords
)

Set the hit target mesh and the plane frame.

Public function Virtual

void

 

UpdateCurrentDistance

(
    const FRay& WorldRay
)

Update the current distance/height based on the input world ray

Overridden from UInteractionMechanic

Name Description

Public function Virtual

void

 

Render

(
    IToolsContextRenderAPI* Render...
)

Allow the Mechanic to do any custom drawing (ie via PDI/RHI)

Public function Virtual

void

 

Setup

(
    UInteractiveTool* ParentTool
)

Called to initialize the InteractionMechanic

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss