Update Pawn authored by David Gilbert's avatar David Gilbert
[[_TOC_]]
# Structure
**ARWTHVRPawn**
The underlying baseclass for our pawn is defined in the `ARWTHVRPawn` C++ class. It inherits from `APawn` and adds some basic required functionality. This class mainly fulfills the following properties/functionalities:
- Create and set up hierarchy for:
- Head Camera: `UReplicatedCameraComponent`
- CollisionHandlingMovement: `UCollisionHandlingMovement`
- RightHand: `UReplicatedMotionControllerComponent`
- LeftHand: `UReplicatedMotionControllerComponent`
- Tick:
- Set Camera offset and update the right hand for desktop simulation
- Evaluate LiveLink
- Initialize Inputs:
- Setup own InputComponent
- Setup Motion Controller Sources
- Call SetupPlayerInput of all components which implement the `UInputExtensionInterface`
- Add all IMCs defined in `InputMappingContexts`, which is empty for this class
- Setup and execute attachment process for Cave/Cluster functionality, if running via nDisplay
As this class does not actually initialize any default values and references, we added two convenience BP classes which add more and more default functionality. Depending on how much you need to modify them, inherit your own pawn from the respective pawn.
**BP_RWTHVRPawn_Base**
This blueprint only adds sane defaults required for basic input binding and livelink functionality:
- InputMappingContexts:
- IMC_General
- IMC_MovementRightHand
- IMC_Cluster
- LiveLink:
- Head Subject Representation: Unknown-DTrack-Body-00
- Left Subject Representation: Unknown-DTrack-Body-01
- Right Subject Representation: DTrack-FlystickBody-00
**BP_RWTHVRPawn_Default**
This blueprint further adds meshes for head and hands and some basic movement and interaction components. It is meant as an example pawn that can be used as-is in basic cases. Usually you would either subclass this or copy it if you need to modify its structure.
It further adds:
- Meshes for head, left and right hand as well as DeviceVisualizations
- Interaction components:
- IntenSelect
- DirectInteractionComponentLeft/Right
- Turn- and ContinuousMovementComponents for navigation
- ClientTransformReplication for client authority needed for VR
A simple **reduced** class diagram can be seen here:
![Pawn.drawio.svg](uploads/1c82e2553216d62d32e988bc3111db49/Pawn.drawio.svg)
# Movement
All movement components are C++ derived blueprint components, which can be added to the `RWTHVRPawn`. The blueprints itself can be found in `Components/Movement`. In the movement folder are two InputMappingContexts(IMCs) for either the left or right hand (which can be switched by (un-)ticking ``Move with Right Hand``). If you want to change the button mappings, you can adjust the respective IMC (best make a copy of them into your project first).
All movement components are C++ derived blueprint components, which can be added to the `ARWTHVRPawn`. The blueprints itself can be found in `Components/Movement`. In the movement folder are two InputMappingContexts(IMCs) for either the left or right hand (which can be switched by (un-)ticking ``Move with Right Hand``). If you want to change the button mappings, you can adjust the respective IMC (best make a copy of them into your project first).
## Collision Handling Movement
This component is added to the pawn by default. It adds a configurable movement to your pawn implementation. It can be configured via the `NavigationMode`, which behaves as follows:
......
......