Optimizations

This commit is contained in:
Daniel 2019-01-29 20:43:37 +01:00
parent 1334116a98
commit 881e957216
3 changed files with 5 additions and 3 deletions

View File

@ -317,6 +317,8 @@ This sensor, when attached to an actor, reports if there is obstacles ahead.
| `hit_radius` | float | 0.5 | Radius of the trace | | `hit_radius` | float | 0.5 | Radius of the trace |
| `only_dynamics` | bool | false | If true, the trace will only look for dynamic objects | | `only_dynamics` | bool | false | If true, the trace will only look for dynamic objects |
| `debug_linetrace` | bool | false | If true, the trace will be visible | | `debug_linetrace` | bool | false | If true, the trace will be visible |
| `sensor_tick` | float | 0.0 | Seconds between sensor captures (ticks) |
This sensor produces This sensor produces
[`carla.ObstacleDetectionSensorEvent`](python_api.md#carlaobstacledetectionsensoreventdata) [`carla.ObstacleDetectionSensorEvent`](python_api.md#carlaobstacledetectionsensoreventdata)

View File

@ -447,7 +447,7 @@ void UActorBlueprintFunctionLibrary::MakeObstacleDetectorDefinitions(
FActorDefinition &Definition) FActorDefinition &Definition)
{ {
Definition = MakeGenericSensorDefinition(TEXT("other"), TEXT("obstacle")); Definition = MakeGenericSensorDefinition(TEXT("other"), TEXT("obstacle"));
AddVariationsForSensor(Definition);
// Distance. // Distance.
FActorVariation distance; FActorVariation distance;
distance.Id = TEXT("distance"); distance.Id = TEXT("distance");

View File

@ -33,11 +33,11 @@ void AObstacleDetectionSensor::Set(const FActorDescription &Description)
Distance = UActorBlueprintFunctionLibrary::RetrieveActorAttributeToFloat( Distance = UActorBlueprintFunctionLibrary::RetrieveActorAttributeToFloat(
"distance", "distance",
Description.Variations, Description.Variations,
Distance) * 100; Distance) * 100.0f;
HitRadius = UActorBlueprintFunctionLibrary::RetrieveActorAttributeToFloat( HitRadius = UActorBlueprintFunctionLibrary::RetrieveActorAttributeToFloat(
"hit_radius", "hit_radius",
Description.Variations, Description.Variations,
HitRadius) * 100; HitRadius) * 100.0f;
bOnlyDynamics = UActorBlueprintFunctionLibrary::RetrieveActorAttributeToBool( bOnlyDynamics = UActorBlueprintFunctionLibrary::RetrieveActorAttributeToBool(
"only_dynamics", "only_dynamics",
Description.Variations, Description.Variations,