Returns the minimum X coordinate of a mesh's bounding box in local mesh space.
Takes entity (mesh entity handle).
Returns minimum X value, or 0.0 on error.
3D Graphics
Parameters & Returns
Parameters
entityInt
Returns
Double
Quick Summary
Returns the minimum X coordinate of a mesh's bounding box in local mesh space.
Takes entity (mesh entity handle).
Returns minimum X value, or 0.0 on error.
Technical Exegesis...
Returns the minimum X coordinate of a mesh's bounding box in local mesh space. Takes entity (mesh entity handle). Returns minimum X value (Double), or 0.0 on error. Validates entity exists and type is ENTITY_MESH. Validates mesh has vertex data (not empty). Iterates all vertices in mesh to find minimum X position. Returns unscaled mesh-space coordinate (does not account for entity scale/rotation). Silently returns 0.0 on errors.
Returns the minimum X coordinate of a mesh's bounding box in local mesh space. Takes entity (mesh entity handle). Returns minimum X value (Double), or 0.0 on error. Validates entity exists and type is ENTITY_MESH. Validates mesh has vertex data (not empty). Iterates all vertices in mesh to find minimum X position. Returns unscaled mesh-space coordinate (does not account for entity scale/rotation). Silently returns 0.0 on errors.
This function queries mesh bounding box extent for collision detection, alignment, or procedural placement. Returns local-space coordinates before transforms applied - multiply by entity scale to get world-space extent. Useful for: (1) Calculating bounding boxes (get MinX/MaxX/MinY/MaxY/MinZ/MaxZ for full bounds), (2) Mesh alignment (align left edge to position: entityX = targetX - b3dMeshMinX), (3) Procedural placement (stack objects: nextX = prevX + b3dMeshMaxX(prev) - b3dMeshMinX(next)), (4) Collision volume sizing (width = MaxX - MinX). Coordinate system: right-handed, X-axis points right. For scaled bounds, multiply by b3dEntityScaleX (global scale). For rotated bounds, transformation required (not axis-aligned). Complements b3dMeshWidth (width = MaxX - MinX), b3dMeshHeight, b3dMeshDepth. Use b3dFitMesh to scale mesh to fit target dimensions. Returns actual vertex position min - for primitives like sphere/cube, typically -radius or -size/2. For loaded meshes, depends on modeling coordinates. Common values: cube (-1.0), sphere (-1.0), custom meshes (arbitrary). Performance: O(n) iteration over vertices - cache result if querying repeatedly. Does not trigger GPU operations.
Example
Example.bam
; Get mesh bounds in local spaceLocal mesh:Int = b3dCreateCube(1, 0, 0)
b3dScaleEntity(mesh, 2.0, 1.0, 1.0)
Local minX:Double = b3dMeshMinX(mesh) ; Returns -1.0 (unscaled)
Local maxX:Double = b3dMeshMaxX(mesh) ; Returns 1.0 (unscaled)
Local width:Double = maxX - minX ; Returns 2.0; To get scaled world-space widthLocal worldWidth:Double = width * b3dEntityScaleX(mesh) ; Returns 4.0