unreal.ViewportWorldInteraction

class unreal.ViewportWorldInteraction(outer: Object | None = None, name: Name | str = 'None')

Bases: EditorWorldExtension

Viewport World Interaction

C++ Source:

  • Module: ViewportInteraction

  • File: ViewportWorldInteraction.h

add_actor_to_exclude_from_hit_tests(actor_to_exclude_from_hit_tests) None

Adds an actor to the list of actors to never allow an interactor to hit in the scene. No selection. No hover. There’s no need to remove actors from this list. They’ll expire from it automatically when destroyed.

Parameters:

actor_to_exclude_from_hit_tests (Actor) – The actor that should be forever excluded from hit tests

add_interactor(interactor) None

Adds interactor to the worldinteraction

Parameters:

interactor (ViewportInteractor) –

get_head_transform() Transform

Gets the transform of the viewport / user’s HMD in world space

Return type:

Transform

get_interactors() Array[ViewportInteractor]

Gets all the interactors

Return type:

Array[ViewportInteractor]

get_room_space_head_transform() Transform

Gets the transform of the viewport / user’s HMD in room space

Return type:

Transform

get_room_transform() Transform
Gets the world space transform of the calibrated VR room origin. When using a seated VR device, this will feel like the

camera’s world transform (before any HMD positional or rotation adjustments are applied.)

Return type:

Transform

get_transform_gizmo_actor() BaseTransformGizmo

Gets the transform gizmo actor, or returns null if we currently don’t have one

Return type:

BaseTransformGizmo

get_world_scale_factor() float

Gets the world scale factor, which can be multiplied by a scale vector to convert to room space

Return type:

float

remove_interactor(interactor) None

Removes interactor from the worldinteraction and removes the interactor from its paired interactor if any

Parameters:

interactor (ViewportInteractor) –

set_head_transform(new_head_transform) None
Sets a new transform for the room so that the HMD is aligned to the new transform.

The Head is kept level to the ground and only rotated on the yaw

Parameters:

new_head_transform (Transform) –

set_room_transform_for_next_frame(new_room_transform) None

Set Room Transform for Next Frame

Parameters:

new_room_transform (Transform) –

set_world_to_meters_scale(new_world_to_meters_scale, compensate_room_world_scale=False) None

Sets GNewWorldToMetersScale

Parameters:
  • new_world_to_meters_scale (float) –

  • compensate_room_world_scale (bool) –