Skip to content
Snippets Groups Projects
Commit fc0def6e authored by Patrick Nossol's avatar Patrick Nossol
Browse files

setuo show device models as configurable var

parent 6f5796eb
Branches
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
......@@ -82,14 +82,7 @@ AMCPawn::AMCPawn(const FObjectInitializer& ObjectInitializer)
void AMCPawn::BeginPlay() {
Super::BeginPlay();
if (ShowDeviceModels) {
SensorSetup.HandL.ControllerComponent->SetShowDeviceModel(true);
SensorSetup.HandR.ControllerComponent->SetShowDeviceModel(true);
for (FSensor& Tracker : SensorSetup.Trackers) {
Tracker.ControllerComponent->SetShowDeviceModel(true);
Tracker.DebugMesh->SetVisibility(true);
}
}
SetShowDeviceModels(ShowDeviceModels);
}
......@@ -579,6 +572,16 @@ void AMCPawn::OffsetSensorData(EBodyPart part, FVector & Pos, FQuat & Rot, bool
}
void AMCPawn::SetShowDeviceModels(bool show) {
ShowDeviceModels = show;
SensorSetup.HandL.ControllerComponent->SetShowDeviceModel(show);
SensorSetup.HandR.ControllerComponent->SetShowDeviceModel(show);
for (FSensor& Tracker : SensorSetup.Trackers) {
Tracker.ControllerComponent->SetShowDeviceModel(show);
Tracker.DebugMesh->SetVisibility(show);
}
}
void AMCPawn::AddSensorDataToJson(TSharedPtr<FJsonObject> JsonObjectFull, const FSensor& Sensor) {
TSharedPtr<FJsonObject> JsonObject = MAKE_JSON;
......
......@@ -28,6 +28,7 @@ public:
bool UseKneeAsFoot;
UPROPERTY(EditAnywhere)
bool ShowDeviceModels = true;
UPROPERTY(BlueprintReadOnly)
......@@ -72,6 +73,8 @@ public:
void OffsetSensorData(EBodyPart part, FVector& Pos, FQuat& Rot, bool inverse = false);
void SetShowDeviceModels(bool show);
private:
void AddSensorDataToJson(TSharedPtr<FJsonObject> JsonObjectFull, const FSensor& Sensor);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment