UGoogleVRMotionControllerComponent

GoogleVRMotionControllerComponent is a customizable Daydream Motion Controller.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

GoogleVRController

Header

/Engine/Plugins/Runtime/GoogleVR/GoogleVRController/Source/GoogleVRController/Classes/GoogleVRMotionControllerComponent.h

Include

#include "GoogleVRMotionControllerComponent.h"

Syntax

UCLASS(ClassGroup=(GoogleVRController), Meta=(BlueprintSpawnableComponent))
class UGoogleVRMotionControllerComponent :
    public USceneComponent,
    public IGoogleVRPointer

Remarks

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.

Variables

Name Description

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UMaterialInterf...

 

AppMaterial

Material used when pressing the app button.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UTexture2D *...

 

BatteryAlmostFullTexture

Texture used for the battery almost full state.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UTexture2D *...

 

BatteryChargingTexture

Texture used for the battery charging state.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UTexture2D *...

 

BatteryCriticalLowTexture

Texture used for the battery critcally low state.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UTexture2D *...

 

BatteryFullTexture

Texture used for the battery full state.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UTexture2D *...

 

BatteryLowTexture

Texture used for the battery low state.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UTexture2D *...

 

BatteryMediumTexture

Texture used for the battery medium state.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

FName

 

BatteryTextureParameterName

Texture parameter name for the battery material.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UTexture2D *...

 

BatteryUnknownTexture

Texture used for the battery unknown state.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UStaticMesh ...

 

ControllerBatteryMesh

Mesh used for controller battery state.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UStaticMesh ...

 

ControllerMesh

Mesh used for controller.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UMaterialInterf...

 

ControllerTouchPointMaterial

Material used for touch point when touching the touch pad.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UStaticMesh ...

 

ControllerTouchPointMesh

Mesh used for controller touch point.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

float

 

EnterRadiusCoeff

The enter radius for the ray is the sprite size multiplied by this value.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

float

 

ExitRadiusCoeff

The exit radius for the ray is the sprite size multiplied by this value.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UMaterialInterf...

 

IdleMaterial

Material used when idle.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

bool

 

IsLockedToHead

If true, the root of the pose is locked to the local position of the player's head.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

FName

 

LaserVisualComponentTag

The name of the LaserVisualComponent to use.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UMaterialParame...

 

ParameterCollection

Parameter collection used to set the alpha of all components.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

EGoogleVRPointe...

 

PointerInputMode

Determines the method used to detect what the pointer hits.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

bool

 

RequireInputComponent

If true, then a GoogleVRInputComponent will automatically be created if one doesn't already exist.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UMaterialInterf...

 

SystemMaterial

Material used when pressing the system button.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

UMaterialInterf...

 

TouchpadMaterial

Material used when pressing the touchpad button.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

int

 

TranslucentSortPriority

TranslucentSortPriority to use when rendering.

Constructors

Functions

Name Description

Public function Const UFunction BlueprintCallable, Category, Meta

UStaticMeshC...

 

GetControllerMesh()

Get the StaticMeshComponent used to represent the controller.

Public function Const UFunction BlueprintCallable, Category, Meta

float

 

GetCurrentPointerDistance()

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

Public function Const UFunction BlueprintCallable, Category, Meta

UMaterialIns...

 

GetLaserMaterial()

Get the MaterialInstanceDynamic used to represent the laser material.

Public function Const UFunction BlueprintCallable, Category, Meta

UMotionContr...

 

GetMotionController()

Get the MotionControllerComponent.

Public function UFunction BlueprintCallable, Category, Meta

void

 

SetPointerDistance

(
    float Distance
)

Set the distance of the pointer.

Overridden from UActorComponent

Name Description

Public function Virtual

void

 

Activate

(
    bool bReset
)

If the controller is connected, this will enable the controller visual and pointer input.

Public function Virtual

void

 

BeginPlay()

BeginsPlay for the component.

Public function Virtual

void

 

Deactivate()

Disables the controller visual and pointer input.

Public function Virtual

void

 

OnRegister()

ActorComponent Overrides

Public function Virtual

void

 

TickComponent

(
    float DeltaTime,
    ELevelTick TickType,
    FActorComponentTickFunction* T...
)

Function called every frame on this ActorComponent.

Overridden from IGoogleVRPointer

Name Description

Public function Virtual Const

float

 

GetDefaultReticleDistance()

Returns the default distance to render the reticle when no collision is detected.

Public function Virtual Const

FVector

 

GetDirection()

Returns the normalized direction of the ray in world space.

Public function Virtual Const

float

 

GetMaxPointerDistance()

Returns the max distance this ray will be rendered at from the camera.

Public function Virtual Const

FVector

 

GetOrigin()

Returns the origin of the ray in world space.

Public function Virtual Const

EGoogleVRPoi...

 

GetPointerInputMode()

Return the method used to detect what the pointer hits.

Public function Virtual Const

void

 

GetRadius

(
    float& OutEnterRadius,
    float& OutExitRadius
)

Return the radius of the ray.

Public function Virtual Const

bool

 

IsPointerActive()

Returns true if the pointer is active.

Public function Virtual

void

 

OnPointerEnter

(
    const FHitResult& HitResult,
    bool IsHitInteractive
)

IGoogleVRPointer Implementation

Public function Virtual

void

 

OnPointerExit

(
    const FHitResult& HitResult
)

Called when the pointer stops hitting an actor.

Public function Virtual

void

 

OnPointerHover

(
    const FHitResult& HitResult,
    bool IsHitInteractive
)

Called every frame the pointer is pointing at an actor.

Constants

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback