Unit a3dge.Collisions

Description

Implements routines used to check collisions.

These routines are for internal use. It's unlikely you'll need to use them in your games.

Some of these functions references to AABB (Axis-Aligned Bounding Box). This is an special bounding box that is aligned to the coordinate axis. To know more visit this wikipedia article.

Overview

Classes, Interfaces, Objects and Records

Name Description
Record TBox Define an Axis-Aligned Bounding Box (AABB).

Functions and Procedures

function Box0: TBox; inline;
function Box ( const aLeft, aRight, aBottom, aTop, aBack, aFront: Single ): TBox; inline;
procedure RenderAABB (const aAABB: TBox);
procedure RenderBoundingSphere (const aCenter: TVector3D; const aRadius: Real);
function IsPointInsideAABB (const aPoint: TVector3D; const aAABB: TBox): Boolean; inline;
function IsSphereInsideAABB ( const aCenter: TVector3D; const aRadius: Real; const aAABB: TBox ): Boolean; inline;
function IsPointNearAABB ( const aPoint: TVector3D; const aAABB: TBox; aDistance: Real; const aDistanceIsSquared: Boolean=False ): Boolean;
function SphereCollision ( const aPos1: TVector3D; const aRad1: Real; const aPos2: TVector3D; const aRad2: Real ): Boolean; inline;
function AABBCollision ( const aPos1: TVector3D; const aAABB1: TBox; const aPos2: TVector3D; const aAABB2: TBox ): Boolean; inline;
function AABBSphereCollision ( const aBoxPos: TVector3D; const aAABB: TBox; const aSpherePos: TVector3D; const aRadius: Real ): Boolean; inline;

Description

Functions and Procedures

function Box0: TBox; inline;

Return a box with all values in zero.

function Box ( const aLeft, aRight, aBottom, aTop, aBack, aFront: Single ): TBox; inline;

Build a box with the given values.

procedure RenderAABB (const aAABB: TBox);

Draw a wired bounding box.

See also
RenderBoundingSphere
Draw a wired sphere.
procedure RenderBoundingSphere (const aCenter: TVector3D; const aRadius: Real);

Draw a wired sphere.

See also
RenderAABB
Draw a wired bounding box.
function IsPointInsideAABB (const aPoint: TVector3D; const aAABB: TBox): Boolean; inline;

Check if point is inside the given AABB.

See also
IsPointNearAABB
Check if point is at a distance from the given box.
IsSphereInsideAABB
Check if given sphere is inside the given AABB.
function IsSphereInsideAABB ( const aCenter: TVector3D; const aRadius: Real; const aAABB: TBox ): Boolean; inline;

Check if given sphere is inside the given AABB.

See also
IsPointNearAABB
Check if point is at a distance from the given box.
IsPointInsideAABB
Check if point is inside the given AABB.
AABBSphereCollision
Check collision between an AABB and a sphere.
function IsPointNearAABB ( const aPoint: TVector3D; const aAABB: TBox; aDistance: Real; const aDistanceIsSquared: Boolean=False ): Boolean;

Check if point is at a distance from the given box.

See also
IsPointInsideAABB
Check if point is inside the given AABB.
IsSphereInsideAABB
Check if given sphere is inside the given AABB.
function SphereCollision ( const aPos1: TVector3D; const aRad1: Real; const aPos2: TVector3D; const aRad2: Real ): Boolean; inline;

Check collision between two spheres.

See also
AABBCollision
Check collision between two AABBs.
AABBSphereCollision
Check collision between an AABB and a sphere.
function AABBCollision ( const aPos1: TVector3D; const aAABB1: TBox; const aPos2: TVector3D; const aAABB2: TBox ): Boolean; inline;

Check collision between two AABBs.

See also
SphereCollision
Check collision between two spheres.
AABBSphereCollision
Check collision between an AABB and a sphere.
function AABBSphereCollision ( const aBoxPos: TVector3D; const aAABB: TBox; const aSpherePos: TVector3D; const aRadius: Real ): Boolean; inline;

Check collision between an AABB and a sphere.

See also
AABBCollision
Check collision between two AABBs.
SphereCollision
Check collision between two spheres.

Generated by PasDoc 0.15.0. Generated on 2025-07-31 11:41:01.