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,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
|
||||
}
|
Reference in New Issue
Block a user