Esc

Gltf_Camera

structextensionsince 0.36.1Source
  • macOS: Gltf_Camera works on macOS
  • Linux: Gltf_Camera works on Linux
  • Windows: Gltf_Camera works on Windows
  • Wasm: Gltf_Camera works on Wasm

Declaration

Gltf_Camera :: struct @json(rename_all=camelCase) {
    type: Gltf_Camera_Type; @json(rename_all=lowercase)    perspective: *Gltf_Perspective; @json(default,skip_serializing_if=null)    orthographic: *Gltf_Orthographic; @json(default,skip_serializing_if=null)    name: string; @json(default,skip_serializing_if=empty)    extensions: Json_Value; @json(default,skip_serializing_if=null)    extras: Json_Value; @json(default,skip_serializing_if=null)}

A camera, with the projection for its type filled in.

Example↗
asset, error := gltf_load("{\"asset\":{\"version\":\"2.0\"},\"cameras\":[{\"type\":\"perspective\",\"perspective\":{\"yfov\":0.8,\"znear\":0.1}}]}");
assert(error.kind == .NONE);
defer gltf_free(*asset);
camera := asset.document.cameras[0];
assert(camera.type == .PERSPECTIVE && camera.perspective != null);

See also