Files
LuckyWorld/Source/LuckyWorldV2/Private/Robot/PilotComponent/RobotPilotComponent.cpp
Jb win c6f63317b6 FT - PilotComponent to drive so100
+ Base class for RobotPawn -> might be replaced by an Actor instead?
2025-05-02 00:36:58 +07:00

42 lines
1008 B
C++

#include "Robot/PilotComponent/RobotPilotComponent.h"
#include "Actors/MujocoVolumeActor.h"
#include "Robot/RobotPawn.h"
URobotPilotComponent::URobotPilotComponent()
{
}
void URobotPilotComponent::BeginPlay()
{
Super::BeginPlay();
// Reference owning robot
RobotOwner = Cast<ARobotPawn>(GetOwner());
}
void URobotPilotComponent::TickComponent(float DeltaTime, enum ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
}
void URobotPilotComponent::InitPilotComponent()
{
if (RobotOwner.IsValid() && RobotOwner->PhysicSceneProxy.IsValid())
{
RobotOwner->PhysicSceneProxy->BindPostPhysicStepDelegate(this, &URobotPilotComponent::AnimateActuators);
}
}
void URobotPilotComponent::StartAnimation(const FRobotActuators& NewAnimationTarget)
{
AnimTargetRobotActuators = NewAnimationTarget;
}
void URobotPilotComponent::AnimateActuators(float SimulationTime)
{
// Override in each dedicated RobotPilotComponent
}