Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
AABB3D: simple space area management API

Data Structures

struct  AABB3D
 Axis-Aligned Bounding Box (AABB) algorithm. More...

Typedefs

typedef double AABB_VALUE
 type of a AABB component

Functions

AABB3D createAABB3D (AABB_VALUE xMin, AABB_VALUE yMin, AABB_VALUE zMin, AABB_VALUE xMax, AABB_VALUE yMax, AABB_VALUE zMax)
 create a 3D AABB
bool doAABB3DsIntersect (AABB3D box1, AABB3D box2)
 check if two 3D AABBs intersect
bool isPointInsideAABB3D (AABB3D box, AABB_VALUE x, AABB_VALUE y, AABB_VALUE z)
 check if a point is inside a 3D AABB

Detailed Description


Data Structure Documentation

◆ AABB3D

struct AABB3D

Axis-Aligned Bounding Box (AABB) algorithm.

Definition at line 48 of file n_aabb.h.

Collaboration diagram for AABB3D:
Data Fields
AABB_VALUE xMax second edge x coordinate
AABB_VALUE xMin first edge x coordinate
AABB_VALUE yMax second edge y coordinate
AABB_VALUE yMin first edge y coordinate
AABB_VALUE zMax second edge z coordinate
AABB_VALUE zMin first edge z coordinate

Typedef Documentation

◆ AABB_VALUE

typedef double AABB_VALUE

type of a AABB component

Definition at line 45 of file n_aabb.h.

Function Documentation

◆ createAABB3D()

AABB3D createAABB3D ( AABB_VALUE xMin,
AABB_VALUE yMin,
AABB_VALUE zMin,
AABB_VALUE xMax,
AABB_VALUE yMax,
AABB_VALUE zMax )

create a 3D AABB

create a 3D AABB

Parameters
xMinminimum x value for the box
yMinminimum y value for the box
zMinminimum z value for the box
xMaxmaximum x value for the box
yMaxmaximum y value for the box
zMaxmaximum z value for the box
Returns
a new AABB3D box

Definition at line 43 of file n_aabb.c.

References AABB3D::xMax, AABB3D::xMin, AABB3D::yMax, AABB3D::yMin, AABB3D::zMax, and AABB3D::zMin.

◆ doAABB3DsIntersect()

bool doAABB3DsIntersect ( AABB3D box1,
AABB3D box2 )

check if two 3D AABBs intersect

Parameters
box1the first box
box2the second box
Returns
0 or 1

Definition at line 74 of file n_aabb.c.

References AABB3D::xMax, AABB3D::xMin, AABB3D::yMax, AABB3D::yMin, AABB3D::zMax, and AABB3D::zMin.

◆ isPointInsideAABB3D()

bool isPointInsideAABB3D ( AABB3D box,
AABB_VALUE x,
AABB_VALUE y,
AABB_VALUE z )

check if a point is inside a 3D AABB

Parameters
boxthe box to use
xx coordinate of the point to test
yy coordinate of the point to test
zz coordinate of the point to test
Returns
0 or 1

Definition at line 62 of file n_aabb.c.

References AABB3D::xMax, AABB3D::xMin, AABB3D::yMax, AABB3D::yMin, AABB3D::zMax, and AABB3D::zMin.