b3dMeshMaxX

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

entity Int

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.

Example

Example.bam
; Align mesh right edge to X=10
Local mesh:Int = b3dCreateSphere(1, 0, 0, 16)
Local maxX:Double = b3dMeshMaxX(mesh)
b3dPositionEntity(mesh, 10.0 - maxX, 0, 0)  ; Right edge at X=10