FT - PilotComponent to drive so100

+ Base class for RobotPawn -> might be replaced by an Actor instead?
This commit is contained in:
Jb win
2025-04-30 21:28:42 +07:00
parent 470cac8f6a
commit c6f63317b6
9 changed files with 282 additions and 0 deletions

View File

@ -0,0 +1,41 @@
#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
}