UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

26 lines (19 loc) 727 B
/** * * @param {vec3|Float32Array|number[]} out * @param {number} out_offset * @param {SMikkTSpaceContext} pContext * @param {number} index */ export function GetPosition(out, out_offset, pContext, index) { // inlined : IndexToData(&iF, &iI, index); const iI = index & 0x3; const iF = index >> 2; // figure out which vertex it is const vertex_index = pContext.geometry_buffer_index[iF * 3 + iI]; const position = pContext.geometry_buffer_vertex_position; const position_offset = vertex_index * 3; out[out_offset] = position[position_offset]; out[out_offset + 1] = position[position_offset + 1]; out[out_offset + 2] = position[position_offset + 2]; }