Checks if a world point is inside entity bounding volume.
Takes entity (entity handle), x/y/z (world coordinates to test).
Returns 1 if point inside entity bounds, 0 if outside.
3D Graphics
Parameters & Returns
Parameters
entityInt
xDouble
yDouble
zDouble
Returns
Int
Quick Summary
Checks if a world point is inside entity bounding volume.
Takes entity (entity handle), x/y/z (world coordinates to test).
Returns 1 if point inside entity bounds, 0 if outside.
Technical Exegesis...
Checks if a world point is inside entity bounding volume. Takes entity (entity handle from b3dLoadMesh/b3dCreateBox/etc), x/y/z (world coordinates to test as Double). Returns 1 if point inside entity's axis-aligned bounding box (AABB), 0 if point outside bounds.
Checks if a world point is inside entity bounding volume. Takes entity (entity handle from b3dLoadMesh/b3dCreateBox/etc), x/y/z (world coordinates to test as Double). Returns 1 if point inside entity's axis-aligned bounding box (AABB), 0 if point outside bounds.
Bounding box test: tests against entity AABB (axis-aligned bounding box, rectangular volume aligned with world axes, encompasses entity mesh), AABB derived from entity mesh (minimum and maximum x/y/z extents of all vertices), accounts for entity position but not rotation (AABB always axis-aligned, rotated entities have larger AABB to contain rotated mesh). Point-in-box test: checks if x/y/z within AABB min/max bounds (point.x >= min.x && point.x <= max.x, etc for all axes).
Use cases: (1) Trigger zones (check if player position inside trigger entity bounds), (2) Pick-up detection (check if item pickup point inside player reach), (3) Area queries (find entities containing specific point), (4) Spatial partitioning (query which grid cell contains point). Common patterns: trigger check (if b3dIsPointInEntity(trigger, playerX, playerY, playerZ) then activateTrigger), proximity check (if b3dIsPointInEntity(npc, objectX, objectY, objectZ) then npcNoticeObject).
AABB limitations: axis-aligned only (does not account for entity rotation precisely, rotated box has larger AABB than actual mesh, may produce false positives for rotated entities), not mesh-precise (bounding box approximation, point inside AABB may be outside actual mesh geometry for complex shapes). Precision: sufficient for many gameplay uses (trigger volumes, proximity checks, rough spatial queries), use raycasting for pixel-perfect collision (b3dEntityPick for precise mesh intersection).
Entity scale: AABB scales with entity (b3dScaleEntity affects AABB size, larger scale = larger bounds), entity position (b3dPositionEntity moves AABB, bounds relative to entity position). Performance: O(1) operation (simple min/max comparison, very fast, suitable for frequent checks), no mesh traversal (uses precomputed AABB, efficient).
Validation: returns 0 if entity invalid, returns 1 if point inside AABB, 0 if outside. Related: b3dEntityPick performs raycast pick (more precise than AABB test, tests against actual mesh geometry), b3dPositionEntity sets entity position (affects where AABB located in world), b3dScaleEntity sets entity scale (affects AABB size).