Files
LuckyWorld/Source/LuckyWorldV2/Private/Robot/PilotComponent/RobotPilotComponent.cpp

83 lines
1.7 KiB
C++
Raw Normal View History

#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());
InitPilotComponent();
}
void URobotPilotComponent::TickComponent(float DeltaTime, enum ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
}
void URobotPilotComponent::InitPilotComponent()
{
2025-05-02 00:21:59 +07:00
if (RobotOwner.Get() && RobotOwner->PhysicsSceneProxy.Get())
{
2025-05-02 00:21:59 +07:00
RobotOwner->PhysicsSceneProxy->BindPostPhysicStepDelegate(this, &URobotPilotComponent::PostPhysicStepUpdate);
}
}
void URobotPilotComponent::PostPhysicStepUpdate(const float SimulationTime)
{
// Overriden in each dedicated RobotPilotComponent
}
2025-05-03 01:45:06 +07:00
FTransform URobotPilotComponent::GetReachableTransform()
{
return FTransform::Identity;
}
2025-05-04 01:04:44 +07:00
bool URobotPilotComponent::GetIsReadyForTraining()
{
// Overriden in individual components
return false;
}
bool URobotPilotComponent::GetIsInRestState()
{
// Overriden in individual components
return true;
}
void URobotPilotComponent::SetRobotTarget(const FTransform& TargetTransformIn)
{
}
void URobotPilotComponent::SetRobotCurrentRewardZone(const FTransform& RewardTransformIn)
{
}
void URobotPilotComponent::ReceiveRemoteCommand(const FRemoteControlPayload& RemoteRobotPayload)
{
}
FJsonObject URobotPilotComponent::GetBufferedControlsData()
{
return FJsonObject();
}
FJsonObject URobotPilotComponent::GetBufferedJointsData()
{
return FJsonObject();
}
FTrainingEpisodeData URobotPilotComponent::GetTrainingEpisodeData()
{
return FTrainingEpisodeData();
}