Esc

gltf_next_floats

procedureextensionsince 0.36.1Source
  • macOS: gltf_next_floats works on macOS
  • Linux: gltf_next_floats works on Linux
  • Windows: gltf_next_floats works on Windows
  • Wasm: gltf_next_floats works on Wasm

Read the next vector or matrix (column-major); use cursor.components lanes. End gives false. .

Signature

gltf_next_floats :: (
    cursor: *Gltf_Cursor
) -> ([16] float32, bool, Gltf_Error)
Example↗
asset, error := gltf_load("{\"asset\":{\"version\":\"2.0\"},\"scene\":0,\"scenes\":[{\"nodes\":[0]}],\"nodes\":[{\"mesh\":0}],\"meshes\":[{\"primitives\":[{\"attributes\":{\"POSITION\":0},\"indices\":1}]}],\"buffers\":[{\"byteLength\":42,\"uri\":\"data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAABAAIA\"}],\"bufferViews\":[{\"buffer\":0,\"byteLength\":36,\"target\":34962},{\"buffer\":0,\"byteOffset\":36,\"byteLength\":6,\"target\":34963}],\"accessors\":[{\"bufferView\":0,\"componentType\":5126,\"count\":3,\"type\":\"VEC3\",\"min\":[0,0,0],\"max\":[1,1,0]},{\"bufferView\":1,\"componentType\":5123,\"count\":3,\"type\":\"SCALAR\"}]}");
assert(error.kind == .NONE);
defer gltf_free(*asset);
cursor, _ := gltf_accessor(*asset, 0);
first, more, step := gltf_next_floats(*cursor);
assert(more && step.kind == .NONE);
assert(first[0] == 0 && first[1] == 0 && first[2] == 0); // `cursor.components` lanes are used

See also