MCPcopy Create free account
hub / github.com/melonjs/melonJS / parseUVIndex

Function parseUVIndex

packages/melonjs/src/loader/parsers/obj.js:106–111  ·  view source on GitHub ↗

* parse a face vertex component (e.g. "1/2/3" or "1//3" or "1") * and return the UV index, or NO_UV if not present * @param {string} part - face vertex string * @returns {number} UV index (0-based) or NO_UV * @ignore

(part, slashIdx)

Source from the content-addressed store, hash-verified

104 * @ignore
105 */
106 function parseUVIndex(part, slashIdx) {
107 if (slashIdx !== -1 && part[slashIdx + 1] !== SLASH_CHAR) {
108 return parseInt(part.substring(slashIdx + 1), 10) - OBJ_INDEX_OFFSET;
109 }
110 return NO_UV;
111 }
112
113 // mtllib reference (if present)
114 let mtllib = null;

Callers 1

parseOBJFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected