Fix more compile errors.

This commit is contained in:
Marcel Pi 2023-12-28 13:05:42 +01:00
parent 47eda70a93
commit 8ed715e633
3 changed files with 37 additions and 24 deletions

View File

@ -86,7 +86,8 @@ struct FShapeVisitor
const auto ArrowTipDist = Dist - ArrowSize;
const auto Thickness = 1e2f * Arrow.line.thickness;
World->PersistentLineBatcher->DrawLines(TArray<FBatchedLine>({
FBatchedLine BatchedLines[] =
{
FBatchedLine(
Begin,
End,
@ -121,7 +122,10 @@ struct FShapeVisitor
Color,
LifeTime,
Thickness,
DepthPriority)}));
DepthPriority)
};
World->PersistentLineBatcher->DrawLines(TArrayView<FBatchedLine>(BatchedLines, 5));
}
void operator()(const Shape::Box &Box) const

View File

@ -1640,33 +1640,38 @@ void UCustomTerrainPhysicsComponent::DrawOrientedBox(UWorld* World, const TArray
Point = LargeMapManager->GlobalToLocalLocation(Point);
}
}
LineBatcher->DrawLines({
FBatchedLine(Vertices[0], Vertices[1],
FBatchedLine BatchedLines[] =
{
FBatchedLine(Vertices[0], Vertices[1],
FLinearColor(0.0,0.0,1.0), LifeTime, Thickness, 0),
FBatchedLine(Vertices[0], Vertices[2],
FBatchedLine(Vertices[0], Vertices[2],
FLinearColor(0.0,0.0,1.0), LifeTime, Thickness, 0),
FBatchedLine(Vertices[2], Vertices[3],
FBatchedLine(Vertices[2], Vertices[3],
FLinearColor(0.0,0.0,1.0), LifeTime, Thickness, 0),
FBatchedLine(Vertices[3], Vertices[1],
FBatchedLine(Vertices[3], Vertices[1],
FLinearColor(0.0,0.0,1.0), LifeTime, Thickness, 0),
FBatchedLine(Vertices[4], Vertices[5],
FBatchedLine(Vertices[4], Vertices[5],
FLinearColor(0.0,0.0,1.0), LifeTime, Thickness, 0),
FBatchedLine(Vertices[4], Vertices[6],
FBatchedLine(Vertices[4], Vertices[6],
FLinearColor(0.0,0.0,1.0), LifeTime, Thickness, 0),
FBatchedLine(Vertices[6], Vertices[7],
FBatchedLine(Vertices[6], Vertices[7],
FLinearColor(0.0,0.0,1.0), LifeTime, Thickness, 0),
FBatchedLine(Vertices[7], Vertices[5],
FBatchedLine(Vertices[7], Vertices[5],
FLinearColor(0.0,0.0,1.0), LifeTime, Thickness, 0),
FBatchedLine(Vertices[0], Vertices[4],
FBatchedLine(Vertices[0], Vertices[4],
FLinearColor(0.0,0.0,1.0), LifeTime, Thickness, 0),
FBatchedLine(Vertices[1], Vertices[5],
FBatchedLine(Vertices[1], Vertices[5],
FLinearColor(0.0,0.0,1.0), LifeTime, Thickness, 0),
FBatchedLine(Vertices[2], Vertices[6],
FBatchedLine(Vertices[2], Vertices[6],
FLinearColor(0.0,0.0,1.0), LifeTime, Thickness, 0),
FBatchedLine(Vertices[3], Vertices[7],
FLinearColor(0.0,0.0,1.0), LifeTime, Thickness, 0)});
FBatchedLine(Vertices[3], Vertices[7],
FLinearColor(0.0,0.0,1.0), LifeTime, Thickness, 0)
};
LineBatcher->DrawLines(TArrayView<FBatchedLine>(BatchedLines, 12));
}
}
@ -1703,15 +1708,19 @@ void UCustomTerrainPhysicsComponent::DrawTiles(UWorld* World, const std::vector<
V2.Z = Height;
V3.Z = Height;
V4.Z = Height;
LineBatcher->DrawLines({
FBatchedLine(V1, V2,
FBatchedLine BatchedLines[] =
{
FBatchedLine(V1, V2,
Color, LifeTime, Thickness, 0),
FBatchedLine(V2, V4,
FBatchedLine(V2, V4,
Color, LifeTime, Thickness, 0),
FBatchedLine(V1, V3,
FBatchedLine(V1, V3,
Color, LifeTime, Thickness, 0),
FBatchedLine(V3, V4,
Color, LifeTime, Thickness, 0)});
FBatchedLine(V3, V4,
Color, LifeTime, Thickness, 0)
};
LineBatcher->DrawLines(TArrayView<FBatchedLine>(BatchedLines, 4));
// UE_LOG(LogCarla, Log, TEXT("Drawing Tile %ld with verts %s, %s, %s, %s"),
// TileId, *V1.ToString(), *V2.ToString(), *V3.ToString(), *V4.ToString());
}

View File

@ -577,10 +577,10 @@ AActor* UUSDImporterWidget::GenerateNewVehicleBlueprint(
{
UE_LOG(LogCarlaTools, Error, TEXT("Null CarlaVehicle"));
}
#endif
// Set the vehicle collision in the new physicsasset object
GEditor->GetEditorSubsystem<UStaticMeshEditorSubsystem>()->AddSimpleCollisions(
VehicleMeshes.Body, EScriptingCollisionShapeType::NDOP26);
#endif
CopyCollisionToPhysicsAsset(NewPhysicsAsset, VehicleMeshes.Body);
// assign the physics asset to the skeletal mesh
@ -638,7 +638,7 @@ void UUSDImporterWidget::CopyCollisionToPhysicsAsset(
UBodySetup* BodySetupPhysicsAsset =
PhysicsAssetToEdit->SkeletalBodySetups[
PhysicsAssetToEdit->FindBodyIndex(FName("Vehicle_Base"))];
UBodySetup* BodySetupStaticMesh = StaticMesh->BodySetup;
UBodySetup* BodySetupStaticMesh = StaticMesh->GetBodySetup();
BodySetupPhysicsAsset->AggGeom = BodySetupStaticMesh->AggGeom;
}