CarlaWheeledVehicle: door anim alpha is always initialized

This commit is contained in:
Daniel Santos-Olivan 2021-09-13 13:54:40 +02:00 committed by bernat
parent 0913a7b053
commit d294213818
1 changed files with 4 additions and 3 deletions

View File

@ -43,6 +43,10 @@ ACarlaWheeledVehicle::ACarlaWheeledVehicle(const FObjectInitializer& ObjectIniti
GetVehicleMovementComponent()->bReverseAsBrake = false; GetVehicleMovementComponent()->bReverseAsBrake = false;
BaseMovementComponent = CreateDefaultSubobject<UBaseCarlaMovementComponent>(TEXT("BaseMovementComponent")); BaseMovementComponent = CreateDefaultSubobject<UBaseCarlaMovementComponent>(TEXT("BaseMovementComponent"));
// We create a vector to store the update values for the animation
static uint8 MaxDoorNumber = (uint8) EVehicleDoor::All;
DoorAnimAlpha.Init(0.0, MaxDoorNumber);
} }
ACarlaWheeledVehicle::~ACarlaWheeledVehicle() {} ACarlaWheeledVehicle::~ACarlaWheeledVehicle() {}
@ -117,9 +121,6 @@ void ACarlaWheeledVehicle::BeginPlay()
Vehicle4W->WheelSetups = NewWheelSetups; Vehicle4W->WheelSetups = NewWheelSetups;
LastPhysicsControl = GetVehiclePhysicsControl(); LastPhysicsControl = GetVehiclePhysicsControl();
// We create a vector to store the update values for the animation
DoorAnimAlpha.Init(0.0, DoorAnimMaxAngle.Num());
} }
void ACarlaWheeledVehicle::AdjustVehicleBounds() void ACarlaWheeledVehicle::AdjustVehicleBounds()