Files
LuckyWorld/Source/LuckyWorldV2/Public/Robot/PilotComponent/RobotPilotComponent.h
JB Briant bf58329dc4 FT - Primitive WebSocket Actuators Control
+ Optionally allow remote control of the robot
+ Direct set of actuators, this should pass by the layer controler for proper interpolation
2025-05-06 19:13:41 +07:00

54 lines
1.3 KiB
C++

#pragma once
#include "CoreMinimal.h"
#include "RobotPilotComponent.generated.h"
struct FRemoteControlPayload;
USTRUCT(BlueprintType)
struct FRobotActuators
{
GENERATED_BODY()
// Do we need a prent struct?
// What will be in common?
};
class ARobotPawn;
UCLASS(Blueprintable)
class LUCKYWORLDV2_API URobotPilotComponent : public UActorComponent
{
GENERATED_BODY()
public:
URobotPilotComponent();
virtual void BeginPlay() override;
virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
virtual void InitPilotComponent();
virtual void PostPhysicStepUpdate(const float SimulationTime);
virtual FTransform GetReachableTransform();
virtual bool GetIsReadyForTraining();
virtual bool GetIsInRestState();
UFUNCTION(BlueprintCallable)
virtual void SetRobotTarget(const FTransform& TargetTransformIn);
virtual void SetRobotCurrentRewardZone(const FTransform& RewardTransformIn);
UFUNCTION()
virtual void ReceiveRemoteCommand(const FRemoteControlPayload& RemoteRobotPayload);
protected: // Child class need access
// Only to easy access within the component
TObjectPtr<ARobotPawn> RobotOwner = nullptr;
// ----------------
// ----- ANIM -----
// ----------------
protected: // Child class need access
float AnimationStartTime = 0.f;
float AnimationDuration = 0.f;
};