Remove some actors and components ticks and visibility

This commit is contained in:
nsubiron 2018-02-27 18:14:06 +01:00
parent 913628a53b
commit 6e1905bea7
4 changed files with 19 additions and 2 deletions

View File

@ -20,6 +20,15 @@ static FDataRouter &GetDataRouter(UWorld *World)
return GameMode->GetDataRouter();
}
UAgentComponent::UAgentComponent(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
bVisible = false;
bHiddenInGame = true;
bShouldUpdatePhysicsVolume = false;
PrimaryComponentTick.bCanEverTick = false;
}
void UAgentComponent::AcceptVisitor(IAgentComponentVisitor &Visitor) const
{
unimplemented();

View File

@ -22,6 +22,8 @@ class CARLA_API UAgentComponent : public USceneComponent
public:
UAgentComponent(const FObjectInitializer& ObjectInitializer);
uint32 GetId() const
{
return GetTypeHash(this);

View File

@ -9,6 +9,8 @@
ATrafficSignBase::ATrafficSignBase(const FObjectInitializer &ObjectInitializer)
: Super(ObjectInitializer) {
PrimaryActorTick.bCanEverTick = false;
RootComponent =
ObjectInitializer.CreateDefaultSubobject<USceneComponent>(this, TEXT("SceneRootComponent"));
RootComponent->SetMobility(EComponentMobility::Static);
@ -16,4 +18,5 @@ ATrafficSignBase::ATrafficSignBase(const FObjectInitializer &ObjectInitializer)
TrafficSignAgentComponent =
CreateDefaultSubobject<UTrafficSignAgentComponent>(TEXT("TrafficSignAgentComponent"));
TrafficSignAgentComponent->SetupAttachment(RootComponent);
TrafficSignAgentComponent->SetMobility(EComponentMobility::Static);
}

View File

@ -35,8 +35,11 @@ static AWheeledVehicleAIController *GetController(ACarlaWheeledVehicle *Vehicle)
// =============================================================================
// Sets default values
AVehicleSpawnerBase::AVehicleSpawnerBase(const FObjectInitializer& ObjectInitializer) :
Super(ObjectInitializer) {}
AVehicleSpawnerBase::AVehicleSpawnerBase(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
PrimaryActorTick.bCanEverTick = false;
}
void AVehicleSpawnerBase::BeginPlay()
{