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

38 lines
900 B
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()
{
if (RobotOwner.Get() && RobotOwner->PhysicSceneProxy.Get())
{
RobotOwner->PhysicSceneProxy->BindPostPhysicStepDelegate(this, &URobotPilotComponent::PostPhysicStepUpdate);
}
}
void URobotPilotComponent::PostPhysicStepUpdate(const float SimulationTime)
{
// Overriden in each dedicated RobotPilotComponent
}