Returns the maximum X coordinate of a mesh's bounding box in local mesh space.
Takes entity (mesh entity handle).
Returns maximum X value, or 0.0 on error.
3D Graphics
Parameters & Returns
Parameters
entityInt
Returns
Double
Quick Summary
Returns the maximum X coordinate of a mesh's bounding box in local mesh space.
Takes entity (mesh entity handle).
Returns maximum X value, or 0.0 on error.
Technical Exegesis...
Returns the maximum X coordinate of a mesh's bounding box in local mesh space. Takes entity (mesh entity handle). Returns maximum 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 maximum X position. Returns unscaled mesh-space coordinate (does not account for entity scale/rotation). Silently returns 0.0 on errors.
Returns the maximum X coordinate of a mesh's bounding box in local mesh space. Takes entity (mesh entity handle). Returns maximum 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 maximum 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 right edge to position: entityX = targetX - b3dMeshMaxX), (3) Procedural placement (stack objects: nextX = prevX + b3dMeshMaxX(prev)), (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 max - 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
; Align mesh right edge to X=10Local mesh:Int = b3dCreateSphere(1, 0, 0, 16)
Local maxX:Double = b3dMeshMaxX(mesh)
b3dPositionEntity(mesh, 10.0 - maxX, 0, 0) ; Right edge at X=10