b3dMeshMinZ

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

3D Graphics

Parameters & Returns

Parameters

entity Int

Returns

Double

Quick Summary

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

Technical Exegesis...

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

Example

Example.bam
; Get mesh depth
Local mesh:Int = b3dCreateTorus(1, 0, 0, 16, 8, 1.5, 0.4)
Local minZ:Double = b3dMeshMinZ(mesh)
Local maxZ:Double = b3dMeshMaxZ(mesh)
Local depth:Double = maxZ - minZ
Print("Mesh depth: " + ToString(depth))