Navigation
API > API/Plugins > API/Plugins/GeometryScriptingCore > API/Plugins/GeometryScriptingCore/GeometryScript > API/Plugins/GeometryScriptingCore/GeometryScript/UGeometryScriptL-_31
References
| Module | GeometryScriptingCore |
| Header | /Engine/Plugins/Experimental/GeometryScripting/Source/GeometryScriptingCore/Public/GeometryScript/ShapeFunctions.h |
| Include | #include "GeometryScript/ShapeFunctions.h" |
| Source | /Engine/Plugins/Experimental/GeometryScripting/Source/GeometryScriptingCore/Private/ShapeFunctions.cpp |
static bool GetRaySphereIntersection
&40;
FRay Ray,
FVector SphereCenter,
double SphereRadius,
double & Distance1,
double & Distance2
&41;
Remarks
Check if the Ray intersects a Sphere defined by the SphereCenter and SphereRadius. This function returns two intersection distances (ray parameters). If the ray grazes the sphere, both distances will be the same, and if it misses, they will be MAX_FLOAT. Use the function GetRayPoint to convert the distances to points on the ray/sphere. true if ray intersects sphere
Parameters
| Name | Description |
|---|---|
| Distance1 | Distance along ray (Ray Parameter) to first/closer intersection point with sphere |
| Distance2 | Distance along ray (Ray Parameter) to second/further intersection point with sphere |