b3dMeshMaxY

Returns the maximum Y coordinate of a mesh's bounding box in local mesh space. Takes entity (mesh entity handle). Returns maximum Y value, or 0.0 on error.

3D Graphics

Parameters & Returns

Parameters

entity Int

Returns

Double

Quick Summary

Returns the maximum Y coordinate of a mesh's bounding box in local mesh space. Takes entity (mesh entity handle). Returns maximum Y value, or 0.0 on error.

Technical Exegesis...

Returns the maximum Y coordinate of a mesh's bounding box in local mesh space. Takes entity (mesh entity handle). Returns maximum Y 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 Y position. Returns unscaled mesh-space coordinate (does not account for entity scale/rotation). Silently returns 0.0 on errors.

Example

Example.bam
; Stack objects vertically
Local bottom:Int = b3dCreateCube(1, 0, 0)
b3dPositionEntity(bottom, 0, 0, 0)

Local top:Int = b3dCreateSphere(1, 0, 0, 16)
Local bottomMaxY:Double = b3dMeshMaxY(bottom)
Local topMinY:Double = b3dMeshMinY(top)
b3dPositionEntity(top, 0, bottomMaxY - topMinY, 0)  ; Stack on top