Fixed unnecessary whitespaces
This commit is contained in:
parent
d3696d6b1e
commit
4e540a15a3
|
@ -11,21 +11,21 @@ public class CarlaExporter : ModuleRules
|
||||||
public CarlaExporter(ReadOnlyTargetRules Target) : base(Target)
|
public CarlaExporter(ReadOnlyTargetRules Target) : base(Target)
|
||||||
{
|
{
|
||||||
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||||
|
|
||||||
PublicIncludePaths.AddRange(
|
PublicIncludePaths.AddRange(
|
||||||
new string[] {
|
new string[] {
|
||||||
// ... add public include paths required here ...
|
// ... add public include paths required here ...
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
PrivateIncludePaths.AddRange(
|
PrivateIncludePaths.AddRange(
|
||||||
new string[] {
|
new string[] {
|
||||||
// ... add other private include paths required here ...
|
// ... add other private include paths required here ...
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
PublicDependencyModuleNames.AddRange(
|
PublicDependencyModuleNames.AddRange(
|
||||||
new string[]
|
new string[]
|
||||||
{
|
{
|
||||||
|
@ -33,8 +33,8 @@ public class CarlaExporter : ModuleRules
|
||||||
// ... add other public dependencies that you statically link with here ...
|
// ... add other public dependencies that you statically link with here ...
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
PrivateDependencyModuleNames.AddRange(
|
PrivateDependencyModuleNames.AddRange(
|
||||||
new string[]
|
new string[]
|
||||||
{
|
{
|
||||||
|
@ -48,11 +48,11 @@ public class CarlaExporter : ModuleRules
|
||||||
"SlateCore",
|
"SlateCore",
|
||||||
"Physx",
|
"Physx",
|
||||||
"EditorStyle"
|
"EditorStyle"
|
||||||
// ... add private dependencies that you statically link with here ...
|
// ... add private dependencies that you statically link with here ...
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
DynamicallyLoadedModuleNames.AddRange(
|
DynamicallyLoadedModuleNames.AddRange(
|
||||||
new string[]
|
new string[]
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,29 +30,29 @@ static const FName CarlaExporterTabName("CarlaExporter");
|
||||||
void FCarlaExporterModule::StartupModule()
|
void FCarlaExporterModule::StartupModule()
|
||||||
{
|
{
|
||||||
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
|
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
|
||||||
|
|
||||||
FCarlaExporterCommands::Register();
|
FCarlaExporterCommands::Register();
|
||||||
|
|
||||||
PluginCommands = MakeShareable(new FUICommandList);
|
PluginCommands = MakeShareable(new FUICommandList);
|
||||||
|
|
||||||
PluginCommands->MapAction(
|
PluginCommands->MapAction(
|
||||||
FCarlaExporterCommands::Get().PluginActionExportAll,
|
FCarlaExporterCommands::Get().PluginActionExportAll,
|
||||||
FExecuteAction::CreateRaw(this, &FCarlaExporterModule::PluginButtonClicked),
|
FExecuteAction::CreateRaw(this, &FCarlaExporterModule::PluginButtonClicked),
|
||||||
FCanExecuteAction());
|
FCanExecuteAction());
|
||||||
|
|
||||||
FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
|
FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
|
||||||
|
|
||||||
{
|
{
|
||||||
TSharedPtr<FExtender> MenuExtender = MakeShareable(new FExtender());
|
TSharedPtr<FExtender> MenuExtender = MakeShareable(new FExtender());
|
||||||
MenuExtender->AddMenuExtension("FileActors", EExtensionHook::After, PluginCommands, FMenuExtensionDelegate::CreateRaw(this, &FCarlaExporterModule::AddMenuExtension));
|
MenuExtender->AddMenuExtension("FileActors", EExtensionHook::After, PluginCommands, FMenuExtensionDelegate::CreateRaw(this, &FCarlaExporterModule::AddMenuExtension));
|
||||||
|
|
||||||
LevelEditorModule.GetMenuExtensibilityManager()->AddExtender(MenuExtender);
|
LevelEditorModule.GetMenuExtensibilityManager()->AddExtender(MenuExtender);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
TSharedPtr<FExtender> ToolbarExtender = MakeShareable(new FExtender);
|
TSharedPtr<FExtender> ToolbarExtender = MakeShareable(new FExtender);
|
||||||
ToolbarExtender->AddToolBarExtension("Settings", EExtensionHook::After, PluginCommands, FToolBarExtensionDelegate::CreateRaw(this, &FCarlaExporterModule::AddToolbarExtension));
|
ToolbarExtender->AddToolBarExtension("Settings", EExtensionHook::After, PluginCommands, FToolBarExtensionDelegate::CreateRaw(this, &FCarlaExporterModule::AddToolbarExtension));
|
||||||
|
|
||||||
LevelEditorModule.GetToolBarExtensibilityManager()->AddExtender(ToolbarExtender);
|
LevelEditorModule.GetToolBarExtensibilityManager()->AddExtender(ToolbarExtender);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ void FCarlaExporterModule::PluginButtonClicked()
|
||||||
// define the rounds
|
// define the rounds
|
||||||
int rounds;
|
int rounds;
|
||||||
rounds = 5;
|
rounds = 5;
|
||||||
|
|
||||||
int offset = 1;
|
int offset = 1;
|
||||||
std::string type;
|
std::string type;
|
||||||
for (int round = 0; round < rounds; ++round)
|
for (int round = 0; round < rounds; ++round)
|
||||||
|
@ -102,7 +102,7 @@ void FCarlaExporterModule::PluginButtonClicked()
|
||||||
{
|
{
|
||||||
AActor* TempActor = Cast<AActor>(SelectedObject);
|
AActor* TempActor = Cast<AActor>(SelectedObject);
|
||||||
if (!TempActor) continue;
|
if (!TempActor) continue;
|
||||||
|
|
||||||
// check the TAG (NoExport)
|
// check the TAG (NoExport)
|
||||||
if (TempActor->ActorHasTag(FName("NoExport"))) continue;
|
if (TempActor->ActorHasTag(FName("NoExport"))) continue;
|
||||||
|
|
||||||
|
@ -129,13 +129,13 @@ void FCarlaExporterModule::PluginButtonClicked()
|
||||||
// check to export in this round or not
|
// check to export in this round or not
|
||||||
if (rounds > 1)
|
if (rounds > 1)
|
||||||
{
|
{
|
||||||
if (type == "block" && round != 0)
|
if (type == "block" && round != 0)
|
||||||
continue;
|
continue;
|
||||||
else if (type == "road" && round != 1)
|
else if (type == "road" && round != 1)
|
||||||
continue;
|
continue;
|
||||||
else if (type == "grass" && round != 2)
|
else if (type == "grass" && round != 2)
|
||||||
continue;
|
continue;
|
||||||
else if (type == "sidewalk" && round != 3)
|
else if (type == "sidewalk" && round != 3)
|
||||||
continue;
|
continue;
|
||||||
else if (type == "crosswalk" && round != 4)
|
else if (type == "crosswalk" && round != 4)
|
||||||
continue;
|
continue;
|
||||||
|
@ -172,13 +172,13 @@ void FCarlaExporterModule::PluginButtonClicked()
|
||||||
const PxVec3* convexVerts = mesh->getVertices();
|
const PxVec3* convexVerts = mesh->getVertices();
|
||||||
const PxU16* indexBuffer = (PxU16 *) mesh->getTriangles();
|
const PxU16* indexBuffer = (PxU16 *) mesh->getTriangles();
|
||||||
|
|
||||||
// write all vertex
|
// write all vertex
|
||||||
for(PxU32 j=0;j<nbVerts;j++)
|
for(PxU32 j=0;j<nbVerts;j++)
|
||||||
{
|
{
|
||||||
const PxVec3 &v = convexVerts[j];
|
const PxVec3 &v = convexVerts[j];
|
||||||
FVector vec(v.x, v.y, v.z);
|
FVector vec(v.x, v.y, v.z);
|
||||||
FVector vec3 = InstanceTransform.TransformVector(vec);
|
FVector vec3 = InstanceTransform.TransformVector(vec);
|
||||||
FVector world(vec3.X, vec3.Y, vec3.Z);
|
FVector world(vec3.X, vec3.Y, vec3.Z);
|
||||||
|
|
||||||
f << "v " << std::fixed << (InstanceLocation.X + world.X) * 0.01f << " " << (InstanceLocation.Z + world.Z) * 0.01f << " " << (InstanceLocation.Y + world.Y) * 0.01f << "\n";
|
f << "v " << std::fixed << (InstanceLocation.X + world.X) * 0.01f << " " << (InstanceLocation.Z + world.Z) * 0.01f << " " << (InstanceLocation.Y + world.Y) * 0.01f << "\n";
|
||||||
}
|
}
|
||||||
|
@ -217,13 +217,13 @@ void FCarlaExporterModule::PluginButtonClicked()
|
||||||
const PxVec3* convexVerts = mesh->getVertices();
|
const PxVec3* convexVerts = mesh->getVertices();
|
||||||
const PxU16* indexBuffer = (PxU16 *) mesh->getTriangles();
|
const PxU16* indexBuffer = (PxU16 *) mesh->getTriangles();
|
||||||
|
|
||||||
// write all vertex
|
// write all vertex
|
||||||
for(PxU32 j=0;j<nbVerts;j++)
|
for(PxU32 j=0;j<nbVerts;j++)
|
||||||
{
|
{
|
||||||
const PxVec3 &v = convexVerts[j];
|
const PxVec3 &v = convexVerts[j];
|
||||||
FVector vec(v.x, v.y, v.z);
|
FVector vec(v.x, v.y, v.z);
|
||||||
FVector vec3 = CompTransform.TransformVector(vec);
|
FVector vec3 = CompTransform.TransformVector(vec);
|
||||||
FVector world(CompLocation.X + vec3.X, CompLocation.Y + vec3.Y, CompLocation.Z + vec3.Z);
|
FVector world(CompLocation.X + vec3.X, CompLocation.Y + vec3.Y, CompLocation.Z + vec3.Z);
|
||||||
|
|
||||||
f << "v " << std::fixed << world.X * 0.01f << " " << world.Z * 0.01f << " " << world.Y * 0.01f << "\n";
|
f << "v " << std::fixed << world.X * 0.01f << " " << world.Z * 0.01f << " " << world.Y * 0.01f << "\n";
|
||||||
}
|
}
|
||||||
|
@ -256,5 +256,5 @@ void FCarlaExporterModule::AddToolbarExtension(FToolBarBuilder& Builder)
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef LOCTEXT_NAMESPACE
|
#undef LOCTEXT_NAMESPACE
|
||||||
|
|
||||||
IMPLEMENT_MODULE(FCarlaExporterModule, CarlaExporter)
|
IMPLEMENT_MODULE(FCarlaExporterModule, CarlaExporter)
|
||||||
|
|
|
@ -20,10 +20,10 @@ public:
|
||||||
/** IModuleInterface implementation */
|
/** IModuleInterface implementation */
|
||||||
virtual void StartupModule() override;
|
virtual void StartupModule() override;
|
||||||
virtual void ShutdownModule() override;
|
virtual void ShutdownModule() override;
|
||||||
|
|
||||||
/** This function will be bound to Command. */
|
/** This function will be bound to Command. */
|
||||||
void PluginButtonClicked();
|
void PluginButtonClicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void AddToolbarExtension(FToolBarBuilder& Builder);
|
void AddToolbarExtension(FToolBarBuilder& Builder);
|
||||||
|
|
|
@ -16,9 +16,9 @@ public:
|
||||||
|
|
||||||
FCarlaExporterCommands()
|
FCarlaExporterCommands()
|
||||||
: TCommands<FCarlaExporterCommands>(
|
: TCommands<FCarlaExporterCommands>(
|
||||||
TEXT("CarlaExporter"),
|
TEXT("CarlaExporter"),
|
||||||
NSLOCTEXT("Contexts", "CarlaExporter", "CarlaExporter Plugin"),
|
NSLOCTEXT("Contexts", "CarlaExporter", "CarlaExporter Plugin"),
|
||||||
NAME_None,
|
NAME_None,
|
||||||
FEditorStyle::GetStyleSetName())
|
FEditorStyle::GetStyleSetName())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue