Parameters & Returns
Parameters
Returns
Quick Summary
Red channel (0..255) of a mesh face's base colour.
Technical Exegesis...
Returns the red component (0..255) of the given face's material base colour, taken from the model's baked colour palette (.bb3d v4). Pair with b2dMeshFaceG and b2dMeshFaceB to colour a face when a model has no texture - draw it as a solid b2dDrawQuadDepth after b2dSetColor(r, g, b). Returns 255 (white) for faces with no colour, or for older meshes baked before the palette existed. Face colours are constant, so query them once at load.
Example
Local r:Int = b2dMeshFaceR(mesh, f)
Local g:Int = b2dMeshFaceG(mesh, f)
Local b:Int = b2dMeshFaceB(mesh, f)
b2dSetColor(r, g, b)