FMX.Types3D.RayCastCuboidIntersect
Delphi
function RayCastCuboidIntersect(const RayPos, RayDir, CuboidCenter: TPoint3D; const Width, Height, Depth: Single; var IntersectionNear, IntersectionFar: TPoint3D): Integer;
C++
extern DELPHI_PACKAGE int __fastcall RayCastCuboidIntersect(const System::Math::Vectors::TPoint3D &RayPos, const System::Math::Vectors::TPoint3D &RayDir, const System::Math::Vectors::TPoint3D &CuboidCenter, const float Width, const float Height, const float Depth, 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 cuboid 3D shape.
RayCastCuboidIntersect returns an integer number representing how many times the ray given through its position and direction intersects the given cuboid shape. If the ray does not intersect the cuboid, RayCastCuboidIntersect returns 0. Otherwise RayCastCuboidIntersect may return 1 (the ray intersects the cuboid in exactly one point) or 2 (the ray intersects the cuboid in two points--enters and exits the surface of the cuboid 3D shape).