Returns surface/material index of pick hit point from last pick operation (-1 if sphere/box pick or no hit).
Takes no parameters.
Returns surface index (Int) from g_lastPickResult.surfaceIndex, or -1 if not polygon pick.
3D Graphics
Parameters & Returns
Parameters
This function takes no parameters.
Returns
Int
Quick Summary
Returns surface/material index of pick hit point from last pick operation (-1 if sphere/box pick or no hit).
Takes no parameters.
Returns surface index (Int) from g_lastPickResult.surfaceIndex, or -1 if not polygon pick.
Technical Exegesis...
Returns surface/material index of pick hit point from last pick operation (-1 if sphere/box pick or no hit). Takes no parameters. Returns surface index (Int) from g_lastPickResult.surfaceIndex, or -1 if not polygon pick. Reads result from last b3dCameraPick, b3dEntityPick, or b3dLinePick call with pickMode=2 (polygon). Surface/material index in mesh.
This function retrieves hit surface.
Returns surface/material index of pick hit point from last pick operation (-1 if sphere/box pick or no hit). Takes no parameters. Returns surface index (Int) from g_lastPickResult.surfaceIndex, or -1 if not polygon pick. Reads result from last b3dCameraPick, b3dEntityPick, or b3dLinePick call with pickMode=2 (polygon). Surface/material index in mesh.
This function retrieves hit surface. Pick sequence: (1) Call b3dCameraPick/EntityPick/LinePick to perform ray-cast, (2) Call b3dPickedSurface to get surface/material index (only valid for polygon picks). Surface index: index into mesh surface/material list (for multi-material meshes), for pickMode=2 (polygon) identifies which surface/material was hit, for pickMode=0 (sphere) or pickMode=1 (box) returns -1 (no specific surface). Use cases: (1) Material-specific effects (different impact sounds/effects per material), (2) Surface properties (check if hit metal, wood, concrete), (3) Texture selection (choose decal texture based on surface type), (4) Damage calculation (different damage for armor vs flesh), (5) Physics response (different friction/bounce for materials). Common pattern: if b3dPickedEntity() > 0 and b3dPickedSurface() >= 0 then surfIdx=b3dPickedSurface(), select impact effect for surface type. Typical usage: use for polygon picks (pickMode=2) when material/surface identification needed, -1 for sphere/box picks. Surface data: maps to material properties (textures, colors, physical properties), used for multi-material meshes (different surfaces on same mesh). No hit or non-polygon: returns -1 if no entity picked, pickMode != 2, or sphere/box pick. Result storage: g_lastPickResult.surfaceIndex populated by polygon pick functions only. Performance: O(1) read (simple global variable access, instant). Related: b3dPickedTriangle retrieves triangle index, b3dPickedEntity checks if hit occurred, b3dEntityPickMode sets pick mode (0=sphere, 1=box, 2=polygon), b3dCameraPick/EntityPick/LinePick perform picking.