FMX.Types3D.RayCastSphereIntersect

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function RayCastSphereIntersect(const RayPos, RayDir, SphereCenter: TPoint3D; const SphereRadius: Single; var IntersectionNear, IntersectionFar: TPoint3D): Integer;

C++

extern DELPHI_PACKAGE int __fastcall RayCastSphereIntersect(const System::Math::Vectors::TPoint3D &RayPos, const System::Math::Vectors::TPoint3D &RayDir, const System::Math::Vectors::TPoint3D &SphereCenter, const float SphereRadius, System::Math::Vectors::TPoint3D &IntersectionNear, System::Math::Vectors::TPoint3D &IntersectionFar);

Properties

Type Visibility Source Unit Parent
function public
FMX.Types3D.pas
FMX.Types3D.hpp
FMX.Types3D FMX.Types3D

Description

Returns how many times the given ray intersects the given sphere.

RayCastSphereIntersect returns an integer number representing how many times the ray given through its position and direction intersects the given sphere. If the ray does not intersect the sphere, RayCastSphereIntersect returns 0. Otherwise RayCastSphereIntersect may return 1 (the ray intersects the sphere in exactly one point) or 2 (the ray intersects the sphere in two points--enters and exits the surface of the sphere).

See Also