You've already forked LuckyWorld
42 lines
1008 B
C++
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
|
|
}
|