unreal.GoogleVRMotionControllerComponent

class unreal.GoogleVRMotionControllerComponent(outer=None, name='None')

Bases: unreal.SceneComponent

GoogleVRMotionControllerComponent is a customizable Daydream Motion Controller.

It uses the standard unreal MotionControllerComponent to control position and orientation, and adds the following features:

Controller Visualization: Renders a skinnable 3D model that responds to button presses on the controller, as well as a laser and reticle.

Pointer Input Integration: Integrates with GoogleVRPointerInputComponent so that the motion controller can easily be used to interact with Actors and widgets.

Controller Connection Status: The controller visual and pointer input will automatically be turned off when the controller is disconnected. If the component is activated while the controller is disconnected, then the controller visual and pointer input will be off initially. When the controller becomes connected, they will automatically turn on.

C++ Source:

  • Plugin: GoogleVRController

  • Module: GoogleVRController

  • File: GoogleVRMotionControllerComponent.h

Editor Properties: (see get_editor_property/set_editor_property)

  • absolute_location (bool): [Read-Write] If RelativeLocation should be considered relative to the world, rather than the parent

  • absolute_rotation (bool): [Read-Write] If RelativeRotation should be considered relative to the world, rather than the parent

  • absolute_scale (bool): [Read-Write] If RelativeScale3D should be considered relative to the world, rather than the parent

  • app_material (MaterialInterface): [Read-Write] Material used when pressing the app button.

  • asset_user_data (Array(AssetUserData)): [Read-Write] Array of user data stored with the component

  • auto_activate (bool): [Read-Write] Whether the component is activated at creation or must be explicitly activated.

  • battery_almost_full_texture (Texture2D): [Read-Write] Texture used for the battery almost full state.

  • battery_charging_texture (Texture2D): [Read-Write] Texture used for the battery charging state.

  • battery_critical_low_texture (Texture2D): [Read-Write] Texture used for the battery critcally low state.

  • battery_full_texture (Texture2D): [Read-Write] Texture used for the battery full state.

  • battery_low_texture (Texture2D): [Read-Write] Texture used for the battery low state.

  • battery_medium_texture (Texture2D): [Read-Write] Texture used for the battery medium state.

  • battery_texture_parameter_name (Name): [Read-Write] Texture parameter name for the battery material.

  • battery_unknown_texture (Texture2D): [Read-Write] Texture used for the battery unknown state.

  • can_ever_affect_navigation (bool): [Read-Write] Whether this component can potentially influence navigation

  • component_tags (Array(Name)): [Read-Write] Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.

  • controller_battery_mesh (StaticMesh): [Read-Write] Mesh used for controller battery state.

  • controller_mesh (StaticMesh): [Read-Write] Mesh used for controller.

  • controller_touch_point_material (MaterialInterface): [Read-Write] Material used for touch point when touching the touch pad.

  • controller_touch_point_mesh (StaticMesh): [Read-Write] Mesh used for controller touch point.

  • detail_mode (DetailMode): [Read-Write] If detail mode is >= system detail mode, primitive won’t be rendered.

  • editable_when_inherited (bool): [Read-Write] True if this component can be modified when it was inherited from a parent actor class

  • enter_radius_coeff (float): [Read-Write] The enter radius for the ray is the sprite size multiplied by this value. See IGoogleVRPointer.h for details.

  • exit_radius_coeff (float): [Read-Write] The exit radius for the ray is the sprite size multiplied by this value. See IGoogleVRPointer.h for details.

  • hidden_in_game (bool): [Read-Write] Whether to hide the primitive in game, if the primitive is Visible.

  • idle_material (MaterialInterface): [Read-Write] Material used when idle.

  • is_editor_only (bool): [Read-Write] If true, the component will be excluded from non-editor builds

  • is_locked_to_head (bool): [Read-Write] If true, the root of the pose is locked to the local position of the player’s head.

  • laser_visual_component_tag (Name): [Read-Write] The name of the LaserVisualComponent to use.

  • mobility (ComponentMobility): [Read-Write] How often this component is allowed to move, used to make various optimizations. Only safe to set in constructor.

  • on_component_activated (ActorComponentActivatedSignature): [Read-Write] Called when the component has been activated, with parameter indicating if it was from a reset

  • on_component_deactivated (ActorComponentDeactivateSignature): [Read-Write] Called when the component has been deactivated

  • parameter_collection (MaterialParameterCollection): [Read-Write] Parameter collection used to set the alpha of all components. Must include property named “GoogleVRMotionControllerAlpha”.

  • physics_volume_changed_delegate (PhysicsVolumeChanged): [Read-Write] Delegate that will be called when PhysicsVolume has been changed *

  • pointer_input_mode (GoogleVRPointerInputMode): [Read-Write] Determines the method used to detect what the pointer hits.

  • primary_component_tick (ActorComponentTickFunction): [Read-Write] Main tick function for the Component

  • relative_location (Vector): [Read-Write] Location of the component relative to its parent

  • relative_rotation (Rotator): [Read-Write] Rotation of the component relative to its parent

  • relative_scale3d (Vector): [Read-Write] Non-uniform scaling of the component relative to its parent. Note that scaling is always applied in local space (no shearing etc)

  • replicates (bool): [Read-Write] Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!

  • require_input_component (bool): [Read-Write] If true, then a GoogleVRInputComponent will automatically be created if one doesn’t already exist.

  • should_update_physics_volume (bool): [Read-Write] Whether or not the cached PhysicsVolume this component overlaps should be updated when the component is moved. see: GetPhysicsVolume()

  • system_material (MaterialInterface): [Read-Write] Material used when pressing the system button.

  • touchpad_material (MaterialInterface): [Read-Write] Material used when pressing the touchpad button.

  • translucent_sort_priority (int32): [Read-Write] TranslucentSortPriority to use when rendering. The reticle, the laser, and the controller mesh use TranslucentSortPriority. The controller touch point mesh uses TranslucentSortPriority+1, this makes sure that the touch point doesn’t z-fight with the controller mesh.

  • use_attach_parent_bound (bool): [Read-Write] If true, this component uses its parents bounds when attached. This can be a significant optimization with many components attached together.

  • visible (bool): [Read-Write] Whether to completely draw the primitive; if false, the primitive is not drawn, does not cast a shadow.

property app_material

[Read-Write] Material used when pressing the app button.

Type

(MaterialInterface)

property battery_almost_full_texture

[Read-Write] Texture used for the battery almost full state.

Type

(Texture2D)

property battery_charging_texture

[Read-Write] Texture used for the battery charging state.

Type

(Texture2D)

property battery_critical_low_texture

[Read-Write] Texture used for the battery critcally low state.

Type

(Texture2D)

property battery_full_texture

[Read-Write] Texture used for the battery full state.

Type

(Texture2D)

property battery_low_texture

[Read-Write] Texture used for the battery low state.

Type

(Texture2D)

property battery_medium_texture

[Read-Write] Texture used for the battery medium state.

Type

(Texture2D)

property battery_texture_parameter_name

[Read-Write] Texture parameter name for the battery material.

Type

(Name)

property battery_unknown_texture

[Read-Write] Texture used for the battery unknown state.

Type

(Texture2D)

property controller_battery_mesh

[Read-Write] Mesh used for controller battery state.

Type

(StaticMesh)

property controller_mesh

[Read-Write] Mesh used for controller.

Type

(StaticMesh)

property controller_touch_point_material

[Read-Write] Material used for touch point when touching the touch pad.

Type

(MaterialInterface)

property controller_touch_point_mesh

[Read-Write] Mesh used for controller touch point.

Type

(StaticMesh)

property enter_radius_coeff

[Read-Write] The enter radius for the ray is the sprite size multiplied by this value. See IGoogleVRPointer.h for details.

Type

(float)

property exit_radius_coeff

[Read-Write] The exit radius for the ray is the sprite size multiplied by this value. See IGoogleVRPointer.h for details.

Type

(float)

get_controller_mesh()StaticMeshComponent

Get the StaticMeshComponent used to represent the controller. Can be used if you desire to modify the controller at runtime

Returns

controller static mesh component.

Return type

StaticMeshComponent

get_current_pointer_distance()float

Get the Current Pointer Distance. Can be used for debugging your scene

Returns

the distance used.

Return type

float

get_laser_material()MaterialInstanceDynamic

Get the MaterialInstanceDynamic used to represent the laser material. Can be used if you desire to modify the laser at runtime (i.e. change laser color when pointing at object).

Returns

laser dynamic material instance.

Return type

MaterialInstanceDynamic

get_motion_controller()MotionControllerComponent

Get the MotionControllerComponent. This is the MotionControllerComponent being used to position the Controller visuals. Can be used if you desire to attach any additional components As part of your visualization of the controller.

Returns

motion controller component

Return type

MotionControllerComponent

property idle_material

[Read-Write] Material used when idle.

Type

(MaterialInterface)

property is_locked_to_head

[Read-Write] If true, the root of the pose is locked to the local position of the player’s head.

Type

(bool)

property laser_visual_component_tag

[Read-Write] The name of the LaserVisualComponent to use.

Type

(Name)

property parameter_collection

[Read-Write] Parameter collection used to set the alpha of all components. Must include property named “GoogleVRMotionControllerAlpha”.

Type

(MaterialParameterCollection)

property pointer_input_mode

[Read-Write] Determines the method used to detect what the pointer hits.

Type

(GoogleVRPointerInputMode)

property require_input_component

[Read-Write] If true, then a GoogleVRInputComponent will automatically be created if one doesn’t already exist.

Type

(bool)

set_pointer_distance(distance)None

Set the distance of the pointer. This will update the distance of the laser and the reticle based upon the min and max distances.

Parameters

distance (float) – new distance

property system_material

[Read-Write] Material used when pressing the system button.

Type

(MaterialInterface)

property touchpad_material

[Read-Write] Material used when pressing the touchpad button.

Type

(MaterialInterface)

property translucent_sort_priority

[Read-Write] TranslucentSortPriority to use when rendering. The reticle, the laser, and the controller mesh use TranslucentSortPriority. The controller touch point mesh uses TranslucentSortPriority+1, this makes sure that the touch point doesn’t z-fight with the controller mesh.

Type

(int32)