RoveSoSimulator
Loading...
Searching...
No Matches
RoverInterface.h
1#pragma once
2
3#include "HAL/Platform.h"
4#include "Math/MathFwd.h"
6
7UENUM(BlueprintType)
8/* An enum which is used to select which interface to instantiate for the given RoverVehiclePawn instance.
9 *
10 * This is needed because otherwise interfaces could either not be selected, defeating the point, or you
11 * would need to implement a bunch of factories and convert the interfaces into UObjects to allow Unreal
12 * to directly instantiate them.
13 */
14enum class ERoverInterfaceSubclasses : uint8
15{
16 Talos2025
17};
18
19/**
20 * @brief Interface which represents the logic expected to change depending on rover version.
21 *
22 * This was seperated from the main RoverVehiclePawn logic so multiple versions of rover could function in-sim at the same time.
23 * Implementations should:
24 * - Be entirely stateless and must gather and process the needed data for the requested operation themselves.
25 * - Be friended to RoverVehiclePawn to allow access to protected pointer references.
26 * - Have at minimum one manual drive and one RoveComm drive control modes
27 */
29{
30public:
31 virtual ~IRoverInterface() = default;
32 virtual constexpr const uint8 GetNumControlStates() = 0;
33 // Is this control mode a 'DirectDrive' mode (i.e. Throttles are controlled directly via some input device)
34 virtual constexpr const bool IsDirectDriveControlMode(uint8 state) = 0;
35 // Is this control mode a 'RotationDrive' mode (i.e. RotationDelta downticking occurs for this mode)
36 virtual constexpr const bool IsRotationDriveControlMode(uint8 state) = 0;
37 // Is this control mode a 'RoveCommDrive' mode (i.e. Input for this mode comes via RoveComm)
38 virtual constexpr const bool IsRoveCommDriveControlMode(uint8 state) = 0;
39 // Is this control mode a 'RoverDrive' mode (i.e. Moves/controls the rover as opposed to attachments/other systems)
40 virtual constexpr const bool IsRoverDriveControlMode(uint8 state) = 0;
41 // Is this camera mode an 'orbit' camera? (i.e. The camera rotates around a target on a springarm)
42 virtual constexpr const bool IsOrbitCameraMode(uint8 state) = 0;
43 // Is this camera mode a 'locked' camera? (i.e. The camera cannot move or rotate at all)
44 virtual constexpr const bool IsLockedCameraMode(uint8 state) = 0;
45 // Is this camera mode a 'fixed' camera (i.e. The camera can rotate on at least one of its axes but not move)
46 virtual constexpr const bool IsFixedCameraMode(uint8 state) = 0;
47 // Is this camera mode a 'free' camera (i.e. The camera can move and rotate fully independently of the rover)
48 virtual constexpr const bool IsFreeCameraMode(uint8 state) = 0;
49 // Is this camera mode 'rotatable' (i.e. either orbit, fixed, or free)
50 virtual constexpr const bool IsRotatableCameraMode(uint8 state) = 0;
51 virtual constexpr const FVector GetColorForControlState(uint8 state) = 0;
52
53 virtual void InitalizeStates(ARoverVehiclePawn* rover) = 0;
54 virtual void HandleAttachmentState(ARoverVehiclePawn* rover) = 0;
55 virtual void HandleCameraState(ARoverVehiclePawn* rover) = 0;
56 virtual void CameraCycleCallback(ARoverVehiclePawn* rover, const bool forwards) = 0;
57 virtual void HandleControlState(ARoverVehiclePawn* rover) = 0;
58 virtual void ControlModeCycleCallback(ARoverVehiclePawn* rover, const bool forwards) = 0;
59 virtual const bool ControlModeSetCallback(ARoverVehiclePawn* rover, short num) = 0;
60
61 virtual void LeftThrottleCallback(ARoverVehiclePawn* rover, const float value) = 0;
62 virtual void RightThrottleCallback(ARoverVehiclePawn* rover, const float value) = 0;
63 virtual void TranslationCallback(ARoverVehiclePawn* rover, const float value) = 0;
64 virtual void RotationCallback(ARoverVehiclePawn* rover, const float value) = 0;
65 virtual void ZoomCallback(ARoverVehiclePawn* rover, const float value) = 0;
66};
Custom WheeledVehiclePawn subclass which integrates many required pieces of logic for the rover's fun...
Definition RoverVehiclePawn.h:33
Interface which represents the logic expected to change depending on rover version.
Definition RoverInterface.h:29