You've already forked LuckyWorld
FT - PilotComponent to drive so100
+ Base class for RobotPawn -> might be replaced by an Actor instead?
This commit is contained in:
@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
#include "CoreMinimal.h"
|
||||
#include "RobotPilotComponent.generated.h"
|
||||
|
||||
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();
|
||||
|
||||
private:
|
||||
// Only to easy access within the component
|
||||
TWeakObjectPtr<ARobotPawn> RobotOwner = nullptr;
|
||||
|
||||
// ----------------
|
||||
// ----- ANIM -----
|
||||
// ----------------
|
||||
public:
|
||||
virtual void StartAnimation(const FRobotActuators& NewAnimationTarget);
|
||||
|
||||
private:
|
||||
virtual void AnimateActuators(float SimulationTime); // Bound to the PhysicProxy post-update delegate
|
||||
float AnimationDuration = 0.f;
|
||||
float AnimationStartTime = 0.f;
|
||||
FRobotActuators CurrentRobotActuators; // This will be updated by the post-physic delegate
|
||||
FRobotActuators AnimStartRobotActuators;
|
||||
FRobotActuators AnimTargetRobotActuators;
|
||||
};
|
Reference in New Issue
Block a user