top of page

VR Avatar Animation Instance

VR Avatar animation instance class which can be used as parent class of animation blueprint of the player avatar.

Class name:

Include:

Type:

Lines of code:

UVR_AvatarAnimationInstance

#include "VR/VR_Player/VR_AvatarAnimationInstance.h"

Animation Instance

497

​General Information

Description

VR Avatar Animation Instance class is a child of the animation instance class. Animation blueprints can be inherited from it. This class must be used for VR Avatar animation(See VR Player Class) and should be applied to PlayerMesh component in VR Player inherited blueprint(Otherwise it will crash).


Variables

  • TDeltaTimeX - This is float value of DeltaTimeX.

  • Player - This is an actor class ponter which points on owning VR Player class actor

  • PlayerMesh - This is a Skeletal Mesh Component pointer which points at VR Player's skeletal mesh.

  • bIsVR - This is a bool variable and it is not currently in use.

  • HightPrecentage - This is float variable which stores player's height(from 0 to 1).

  • MeshTransform - This is a transform varible which stors skeletal mesh transform.

  • FloorPosition - This is a transform variable which stores floor position from the collsion component (See VR Player).

  • RightHandTransform - This is a transform variable which stores right controller transform.

  • LeftHandTransform - This is a vector variable which stores left controller transform.

  • RightHandStratchVector - This is a vector variable which stores right hand transform stratch vector.

  • LeftHandStratchVector - This is a vector variable which stores left hand transform stratch vector.

  • HandTransformOffset - This is a transform variable which stores hand transform offset according to the skeleton(UE/SteamVR).

  • HeadTransform - This is a transform variable which stores camera transform.

  • RelativeHeadLocationOffset - This is a vector variable which stores camera offset.

  • RelativeHeadRotationOffset - This is a rotatorvariable which stores camera offset.

  • RightHandFingerCurls - This is FFingerCurls stuct which stores right hand curls.

  • LeftHandFingerCurls - This is FFingerCurls stuct which stores left hand curls.

  • PlayerSpeed - This is a float variable which stores player's speed.

  • PlayerDirection - This is a float variable which stores player's direction (from -180 to 180).

  • LeftFootJoint - This is a vector variable which stores left foot joint for IK

  • RightFootJoint - This is a vector variable which stores right foot joint for IK

  • LeftHitLocation - This is a vector variable which stores left foor hit location for IK.

  • LeftAlignedRotation - This is a rotator variable for left foor IK.

  • LeftStepToGroundDistance - This is float variable which stores the distance to ground for left foot.

  • RightHitLocation - This is a vector variable which stores right foor hit location for IK.

  • RightAlignedRotation - This is a rotator variable for right foor IK.

  • RightStepToGroundDistance - This is float variable which stores the distance to ground for right foot.


(Other variables are dublicated from VR Hand Animation Instance class for each hand. See VR Hand Animation Instance)


Animation Blueprint Example

Algorithm overview

Examaple hand animation blueprint contains 6 main sections: Hands, Pelvis, Head, Legs, Shoulders, Arms.

  • Hands section - This section has 2 state machines for each hand(dublicated from VR Hand Animation Instance class).

  • Pelvis section - This section does the pelvis rotation according to Players height.

  • Head section - This section does the head rotation.

  • Legs section - This section does the legs IK.

  • Shoulders section - This section does the shoulder stretch.

  • Arms section - This section does the arms position and rotation.


Examaple hand animation blueprint contains 6 main sections: Hands, Pelvis, Head, Legs, Shoulders, Arms.
Examaple VR Avatart Animation Blueprint

Skeleton Foot Setup

Avatar skeleton require additional footsteps socket to work. The socket must be attached to the pelvis bone at foot level and must have a name "Legs_Z"(This socket is necessary, otherwise foot IK will not work).


Blueprint API Reference

Public Attributes

 

		float TDeltaTimeX;
 

		AActor* Player;
 

		USkeletalMeshComponent* PlayerMesh;
 

		bool bIsVR;

 

		float HightPrecentage;
 

		FTransform MeshTransform;
 

		FVector FloorPosition;
 

		FTransform RightHandTransform;
 

		FTransform LeftHandTransform;
 

		FVector RightHandStratchVector;
 

		FVector LeftHandStratchVector;
 

		FTransform HandTransformOffset;
 

		FTransform HeadTransform;
 

		FVector RelativeHeadLocationOffset;
 

		FRotator RelativeHeadRotationOffset;
 

		FFingerCurls RightHandFingerCurls;
 

		FFingerCurls LeftHandFingerCurls;
 

		float PlayerSpeed;
 

		float PlayerDirection;
 

		FVector LeftFootJoint;
 

		FVector RightFootJoint;
 

		FVector LeftHitLocation;
 

		FRotator LeftAlignedRotation;
 

		float LeftStepToGroundDistance;
 

		FVector RightHitLocation;
 

		FRotator RightAlignedRotation;
 

		float RightStepToGroundDistance;
 

	FVector GetShoulderStratchVector(FVector HandTransform);
 

		float LeftGripThumb;
 

		float LeftGripIndex;
 

		float LeftGripMiddle;
 

		float LeftGripRing;
 

		float LeftGripPinky;
 

		float LeftIndexPushInst;
 

		float LeftHammerPushInst;
 

		float LeftHandOrientationZ;
 

		bool bLeftHasWeapon;
 

		bool bLeftA_Pressed;
 

		bool bLeftB_Pressed;
 

		bool bLeftTrackpad_Touch;
 

		bool bLeftWantsToGrab;
 

		EAnimationType LeftHandAnimType;
 

		EPickUpAnimations LeftHandPickUpAnimation;
 

		bool bLeftHandIsGrabbed;
 

		UAnimSequence* LeftHandGrabAnimation;
 

		UAnimSequence* LeftHandTriggerPressedAnimation;
 

		UAnimSequence* LeftHandAPressedAnimation;
 

		UAnimSequence* LeftHandBPressedAnimation;
 

		float RightGripThumb;
 

		float RightGripIndex;
 

		float RightGripMiddle;
 

		float RightGripRing;
 

		float RightGripPinky;
 

		float RightIndexPushInst;
 

		float RightHammerPushInst;
 

		float RightHandOrientationZ;
 

		bool bRightHasWeapon;
 

		bool bRightA_Pressed;
 

		bool bRightB_Pressed;
 

		bool bRightTrackpad_Touch;
 

		bool bRightWantsToGrab;
 

		EAnimationType RightHandAnimType;
 

		EPickUpAnimations RightHandPickUpAnimation;
 

		bool bRightHandIsGrabbed;
 

		UAnimSequence* RightHandGrabAnimation;
 

		UAnimSequence* RightHandTriggerPressedAnimation;
 

		UAnimSequence* RightHandAPressedAnimation;
 

		UAnimSequence* RightHandBPressedAnimation;
 

bottom of page