Class URayCastObserver
- class URayCastObserver : public UBoxObserver
-
An observer that casts rays and collects observations about the first object hit.
Public Functions
- virtual FBoxSpace GetObservationSpace() const
-
Get the BoxSpace bounding the outputs of this sensor.
Note
This function should be implemented by any derived classes
- Returns:
-
The ObservationSpace bounding the outputs of this sensor.
- TArray<FVector> GenerateRayEndpoints(int32 InNumRays, float InRayDegrees, FVector InBaseEnd, FVector InStart, FTransform InBaseTransform, FVector InEndOffset)
-
Generate the endpoints of the rays to be cast.
- Parameters:
-
-
InNumRays – [in] The number of rays to generate.
-
InRayDegrees – [in] The angle between the first and last ray.
-
InBaseEnd – [in] The base endpoint of the rays.
-
InStart – [in] The start point of the rays.
-
InBaseTransform – [in] A transform to apply to the generated endpoints.
-
- Returns:
-
An array of endpoints for the rays.
- void AppendEmptyTags(FBoxPoint &OutObservations)
-
Add Empty Tags to the ray for ease of adding in one hot encodings.
- Parameters:
-
OutObservations – [out] The observations to append the results to.
- void HandleRayMiss(FBoxPoint &OutObservations, FVector &InStart, FVector &InEnd)
-
Helper function for appending the data based on a ray trace that hit nothing.
- Parameters:
-
-
OutObservations – [out] The observations to append the results to.
-
InStart – [in] The start point of the ray.
-
InEnd – [in] The end point of the ray.
-
- void HandleRayHit(FHitResult &InHitResult, FBoxPoint &OutObservations, FVector &InStart)
-
Handle a SuccesfulRayTrace.
- Parameters:
-
-
InHitResult – [in] The result of the ray trace.
-
OutObservations – [out] The observations to append the results to.
-
InStart – [in] The start point of the ray.
-
- virtual void CollectObservations(FBoxPoint &OutObservations) override
-
Collect observations about the environment state.
- Parameters:
-
OutObservations – [out] A BoxPoint that will be updated with the outputs of this sensor.
Public Members
- float RayLength = 4096.f
-
The baseline length of each ray.
Will be adjusted by the Scale component of RayTransform
- TArray<FName> TrackedTags
-
Actor Tags that are checked on raycast collision.
Included in Observations as 1-hot vector.
- FTransform RayStartTransform
-
A transform that is applied to the generated ray trajectories before firing them.