Skip to content
Mitchell McCaffrey edited this page Jul 5, 2016 · 3 revisions

#Trace Interaction

##Tutorials

##Examples provided

1a. Basic Trace Interaction - This demonstrates basic object interaction with the trace interface. The blocks will colour themselves depending on the interaction method and the arrow will point in the direction of the hit.

1b. Basic 3D Menu - This 3D menu demonstrates two components. Firstly a trace menu table which easily allows you to create either a list menu or a grid menu. Secondly three buttons which demonstrate binding functionality to each button respective events as well as bubbling modes.

1c. Basic Internet Browser - This widget demonstrates using UE4's built in web browser combined with the trace menu system to create a (semi)functioning web browser. It also demonstrate the trace keyboard component which allows you to have a 3D keyboard for VR. EXPERIMENTAL

1d. Basic Teleport Volume - This blueprint demonstrates a simple box on which the player can teleport on to.

1e. Basic Teleport Node - This demonstrates a basic node on which the player can teleport to. It allows you to define a custom teleport location by simply clicking on the actor in the level then grabbing and moving the teleport to location vector to where ever you need it.

1f. Advanced Teleport Area - An modifiable spline that automatically triangulates and creates a custom mesh for the user to teleport on to. To use simply select the actor and right click on the spline then add a spline point. The blueprint will handle rest for you.

##Enums

InteractionTraceTypes - contains the trace types

##Function Libraries

TraceWidgetFunctionLibrary - Contains common functions for trace widgets

Functions:

  • FindWidgetUnderPosition - Finds all widgets under a position in the widgets local coordinate space. At this stage it only supports Canvas Panel Elements as a root widget. Returns the widgets as well as the widgets grouped by their z-index's.
  • GetTopmostWidget - Returns the topmost widget according to their z-index's, currently only supports canvas panel slots.
  • ParentWidgetSpaceToChildSpace - Converts a 2D position in the parent's space and makes it relative to the child widget.
  • WorldSpaceToWidgetSpace - Converts a 3D world space coordinate into a 2D Widget space coordinate.
  • GetCanvasChildren - Finds all the children of a canvas panel widget, can optionally compute the children recursively.

##Interfaces

TraceInteractionInterface - Contains the functions a interactable object can implement, used with blueprint actors.

Functions:

  • TraceEnter - Triggered when a trace first hits an object.
  • TraceLeave - Triggered when a trace leaves an object.
  • TraceOver - Triggered whenever a trace hits any new component of the object.
  • TraceOut - Triggered when a trace leaves a component.
  • TraceMove - Triggered whenever a hit is moved on an object. (Note this function is pass-by-reference and hence cannot make changes to a implementing blueprint).
  • TraceDown - Triggered whenever an input has been held down.
  • TraceUp - Triggered whenever an input has been released.

TraceMenuInteractionInterface - Contains the functions for interacting with a menu widget from a blueprint.

Functions:

  • TraceMove - Called whenever the trace is moved across the widget.
  • TraceDown - Called whenever an input has been pressed down on the widget.
  • TraceUp - Called whenever an input has been pressed up on the widget.
  • TraceEnter - Called whenever a trace enters the widget.
  • TraceLeave - Called whenever a trace leaves the widget.
  • SetSize - Used to updating the size variable of the widget (needed for functions that require the widget size in world space).
  • GetWidgetByName - Can be implemented to get a widget by name, this gets rid of the need to cast to a specific widget.

TraceMenuClickableInterface - Contains the functions for a clickable trace widget.

Functions:

  • Hovered - Called whenever a clickable widget is hovered.
  • Unhovered - Called whenever a cliackable widget is un-hovered
  • Pressed - Called whenever a cliackable widget has been pressed
  • Released - Called whenever a cliackable widget has been released
  • Moved - Called whenever a cliackable widget has had a trace move on top of it.
  • DoesHoverBubble - Returns whether the widget bubbles its hover state.
  • DoesPressBubble - Returns whether the widget bubbles its press state.
  • bIsHovered - Returns whether the widget is currently hovered.

##Structures

TraceTableItemStruct - Contains all the variables to define a TraceTableItem.

Variables:

  • Padding - The padding around the table item.
  • Text - The text to display on the table item.
  • Height - The height of the table item.
  • OverrideStyle - Whether to override the default style for the table item.
  • Style - The override style if override style is true.
  • ActivatedStyle - The activated style if override style is true.
  • OverrideFont - Whether to override the default font.
  • Font - The font if override font is true.

WidgetArray - Used for creating an array of widget arrays (2D widget array) to handle widget buckets.

Variables:

  • Widgets - The widgets in this widget array
Clone this wiki locally