Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UKismetMathLibrary
Description
Returns a random vector with length of 1, within the specified cone, with uniform random distribution. The shape of the cone can be modified according to the yaw and pitch angles.
| Name | RandomUnitVectorInEllipticalConeInDegreesFromStream |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/Kismet/KismetMathLibrary.h |
| Include Path | #include "Kismet/KismetMathLibrary.h" |
UFUNCTION (BlueprintPure, Category="Math|Random",
Meta=(Keywords="RandomVector", ScriptMethod="RandomUnitVectorInEllipticalConeInDegrees", ScriptMethodMutable))
static FVector RandomUnitVectorInEllipticalConeInDegreesFromStream
(
const FRandomStream & Stream,
const FVector & ConeDir,
float MaxYawInDegrees,
float MaxPitchInDegrees
)
Parameters
| Name | Remarks |
|---|---|
| MaxYawInDegrees | The yaw angle of the cone (from ConeDir to horizontal edge), in degrees. |
| MaxPitchInDegrees | The pitch angle of the cone (from ConeDir to vertical edge), in degrees. |
| Stream | The random stream from which to obtain the vector. |