[{"name":"Gltf","comment":" Import 3d assets from glTF (Graphics Library Transmission Format) file format\n\n\n# Types\n\n@docs Asset, Error, Query, QueryResult\n\n\n# Wiring\n\n@docs Msg, Gltf, init, update\n\n\n# Load content\n\n@docs getBinary, getGltf, getBinaryWithQuery, getGltfWithQuery\n\n\n# Queries\n\n@docs defaultSceneQuery, sceneQuery, query\n\n\n# Content\n\n@docs animations, cameras, nodeTrees, scenes, skins, cameraByIndex, textureWithIndex\n\n","unions":[{"name":"Error","comment":" All possible failures\n","args":[],"cases":[["HttpError",["Http.Error"]],["TextureError",["WebGL.Texture.Error"]],["SceneNotFound",[]],["NodeNotFound",[]]]},{"name":"Gltf","comment":" Internal state. Your application model should contain one:\n\n    type alias Model =\n        { gltf : Gltf\n        }\n\n","args":[],"cases":[]},{"name":"Msg","comment":" Internal Msg type. Handle these in your [update](Gltf#update) function. Your application Msg type should contain:\n\n    type Msg\n        = GltfMsg Gltf.Msg\n\n","args":[],"cases":[]},{"name":"Query","comment":" Type returned by [queries](Gltf#queries).\n","args":[],"cases":[]},{"name":"QueryResult","comment":" Results from a [query](Gltf#queries) which can be used to retrieve [content](Gltf#content).\n","args":[],"cases":[]}],"aliases":[{"name":"Asset","comment":" Information about the file\n","args":[],"type":"{ version : String.String, copyright : Maybe.Maybe String.String, generator : Maybe.Maybe String.String }"}],"values":[{"name":"animations","comment":" Get all animations\n","type":"Gltf.QueryResult -> List.List Gltf.Animation.Animation"},{"name":"cameraByIndex","comment":" Get camera by index\n","type":"Gltf.Camera.Index -> Gltf.QueryResult -> Maybe.Maybe Gltf.Camera.Camera"},{"name":"cameras","comment":" Get all cameras\n","type":"Gltf.QueryResult -> List.List Gltf.Camera.Camera"},{"name":"defaultSceneQuery","comment":" Queries the glTF file for the default scene. If no default scene is defined this will query the first scene.\n","type":"Gltf.Query"},{"name":"getBinary","comment":" Get default scene from a file of type **.glb**\n\n**Note:** If file does not specify a default scene this returns the first in list\n\n","type":"String.String -> (Gltf.Msg -> msg) -> Platform.Cmd.Cmd msg"},{"name":"getBinaryWithQuery","comment":" Get content from a file of type **.glb** by supplying one of following queries:\n\n  - [Gltf.defaultSceneQuery](Gltf#defaultSceneQuery) (same as using [getBinary](Gltf#getBinary))\n  - [Gltf.sceneQuery](Gltf#sceneQuery)\n\n","type":"String.String -> Gltf.Query -> (Gltf.Msg -> msg) -> Platform.Cmd.Cmd msg"},{"name":"getGltf","comment":" Get default scene from a file of type **.gltf**\n\n**Note:** If file does not specify a default scene this returns the first in list\n\n","type":"String.String -> (Gltf.Msg -> msg) -> Platform.Cmd.Cmd msg"},{"name":"getGltfWithQuery","comment":" Get content from a file of type **.gltf** by supplying one of following queries:\n\n  - [Gltf.defaultSceneQuery](Gltf#defaultSceneQuery) (same as using [getGltf](Gltf#getGltf))\n  - [Gltf.sceneQuery](Gltf#sceneQuery)\n\n","type":"String.String -> Gltf.Query -> (Gltf.Msg -> msg) -> Platform.Cmd.Cmd msg"},{"name":"init","comment":" Initialize a [Gltf](Gltf#Gltf) and store it in your model:\n\n    init : Model\n    init =\n        { gltf = Gltf.init\n        }\n\n","type":"Gltf.Gltf"},{"name":"nodeTrees","comment":" Get node trees returned by [query](Gltf#queries)\n","type":"Gltf.QueryResult -> List.List (Tree.Tree Gltf.Node.Node)"},{"name":"query","comment":" Query an already loaded file\n","type":"Gltf.Query -> (Gltf.Msg -> msg) -> Gltf.QueryResult -> Platform.Cmd.Cmd msg"},{"name":"sceneQuery","comment":" Queries the glTF file for scene by index.\n","type":"Basics.Int -> Gltf.Query"},{"name":"scenes","comment":" Get information of all scenes\n","type":"Gltf.QueryResult -> List.List Gltf.Scene.Scene"},{"name":"skins","comment":" Get all skins\n","type":"Gltf.QueryResult -> List.List Gltf.Skin.Skin"},{"name":"textureWithIndex","comment":" Get texture by index.\n","type":"Gltf.QueryResult -> Gltf.Material.TextureIndex -> Maybe.Maybe WebGL.Texture.Texture"},{"name":"update","comment":" Internal update function. Call it in your update something like this:\n\n    GltfMsg msg_ ->\n        Gltf.update\n            { toMsg = GltfMsg\n            , onComplete = GltfOnComplete\n            }\n            msg_\n            model.gltf\n            |> Tuple.mapFirst (\\gltf -> { model | gltf = gltf })\n\nThe onComplete function will be called when the [query](Gltf#queries) is ready. Your application Msg type should handle these:\n\n    type Msg\n        = GltfMsg Gltf.Msg\n        | GltfOnComplete (Result Gltf.Error Gltf.QueryResult)\n\nIn the _onComplete_ handler you can use the [content](Gltf#content) functions to get a tree of nodes, animations, cameras etc.\n\n","type":"{ toMsg : Gltf.Msg -> msg, onComplete : Result.Result Gltf.Error Gltf.QueryResult -> msg } -> Gltf.Msg -> Gltf.Gltf -> ( Gltf.Gltf, Platform.Cmd.Cmd msg )"}],"binops":[]},{"name":"Gltf.Animation","comment":" glTF supports articulated and skinned animation via key frame [animations](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#animations) of [nodes'](Gltf-Node#Node) transforms.\n\n\n# Types\n\n@docs Animation, AnimatedBone, AnimatedProperty\n\n\n# Get transformation of nodes/bones in a specific point of time\n\n@docs animatedProperties, animatedBoneTransforms\n\n\n# Get name\n\n@docs name\n\n","unions":[{"name":"AnimatedBone","comment":" An animated bone used for skeletal/skinned animation\n","args":[],"cases":[["AnimatedBone",["{ skinIndex : Basics.Int, inverseBindMatrix : Math.Matrix4.Mat4, joint : Math.Matrix4.Mat4 }"]]]},{"name":"AnimatedProperty","comment":" The animated [Transforms](Gltf-Transform#Transform) of a [Node](Gltf-Node#Node) separated into TRS properties.\n\n**NOTE:** Scale and weights are not supported at this point.\n\n","args":[],"cases":[["AnimatedPositionProperty",["Gltf.NodeIndex.NodeIndex","Math.Vector3.Vec3"]],["AnimatedRotationProperty",["Gltf.NodeIndex.NodeIndex","Quaternion.Quaternion"]]]}],"aliases":[{"name":"Animation","comment":" A keyframe animation\n","args":[],"type":"Gltf.Animation.Animation.Animation"}],"values":[{"name":"animatedBoneTransforms","comment":" With the [Animations](Gltf-Animation#Animation) received from a [Gltf.QueryResult](Gltf#animations) and a [Skin](Gltf-Skin#Skin) this will give you [AnimatedBones](Gltf-Animation#AnimatedBone) that can be used to deform a mesh at a point in time.\n","type":"Basics.Float -> List.List Gltf.Animation.Animation -> Gltf.Skin.Skin -> List.List Gltf.Animation.AnimatedBone"},{"name":"animatedProperties","comment":" With the [Animations](Gltf-Animation#Animation) received from a [Gltf.QueryResult](Gltf#animations) this will give you [AnimatedProperties](Gltf-Animation#AnimatedProperty) to transform your nodes at a point in time.\n","type":"Basics.Float -> List.List Gltf.Animation.Animation -> List.List Gltf.Animation.AnimatedProperty"},{"name":"name","comment":" The user-defined name of the animation\n","type":"Gltf.Animation.Animation -> Maybe.Maybe String.String"}],"binops":[]},{"name":"Gltf.Camera","comment":" A camera’s projection as defined in the [glTF specification](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-camera).\n\n@docs Camera, Index, Projection, OrthographicCamera, PerspectiveCamera\n\n","unions":[{"name":"Index","comment":" Use this to get a [cameraByIndex](Gltf#cameraByIndex)\n","args":[],"cases":[["Index",["Basics.Int"]]]},{"name":"Projection","comment":" Specifies if the camera uses a perspective or orthographic projection.\n","args":[],"cases":[["Perspective",["Gltf.Camera.PerspectiveCamera"]],["Orthographic",["Gltf.Camera.OrthographicCamera"]]]}],"aliases":[{"name":"Camera","comment":" A camera’s with a [Perspective or Orthographic projection](Gltf-Camera#Projection)\n","args":[],"type":"{ name : Maybe.Maybe String.String, index : Gltf.Camera.Index, projection : Gltf.Camera.Projection }"},{"name":"OrthographicCamera","comment":" An orthographic camera containing properties to create an orthographic projection matrix.\n","args":[],"type":"{ xMag : Basics.Float, yMag : Basics.Float, zFar : Basics.Float, zNear : Basics.Float }"},{"name":"PerspectiveCamera","comment":" A perspective camera containing properties to create a perspective projection matrix.\n","args":[],"type":"{ yFov : Basics.Float, zNear : Basics.Float, aspectRatio : Maybe.Maybe Basics.Float, zFar : Maybe.Maybe Basics.Float }"}],"values":[],"binops":[]},{"name":"Gltf.Material","comment":" A material as defined in the [glTF specification](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-material).\n\n@docs Material, Index, TextureIndex, AlphaMode, BbrMetallicRoughness\n\n","unions":[{"name":"AlphaMode","comment":" AlphaMode of the material to convert to a [WebGL.Settings.Setting](https://package.elm-lang.org/packages/elm-explorations/webgl/latest/WebGL-Settings))\n","args":[],"cases":[["Opaque",[]],["Mask",["Basics.Float"]],["Blend",[]]]},{"name":"Index","comment":" The index of the material.\n","args":[],"cases":[["Index",["Basics.Int"]]]},{"name":"Material","comment":" A material assigned to a [Mesh](Gltf-Mesh#Mesh) contained in a [Node](Gltf-Node#Node). Use the properties/textures in the material to render it.\n","args":[],"cases":[["Material",["{ name : Maybe.Maybe String.String, index : Gltf.Material.Index, pbrMetallicRoughness : Gltf.Material.BbrMetallicRoughness, normalTexture : Maybe.Maybe Gltf.Material.TextureIndex, normalTextureScale : Basics.Float, occlusionTexture : Maybe.Maybe Gltf.Material.TextureIndex, occlusionTextureStrength : Basics.Float, emissiveTexture : Maybe.Maybe Gltf.Material.TextureIndex, emissiveFactor : Math.Vector3.Vec3, doubleSided : Basics.Bool, alphaMode : Gltf.Material.AlphaMode }"]]]}],"aliases":[{"name":"BbrMetallicRoughness","comment":" The [Material PBR Metallic Roughness](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-material-pbrmetallicroughness) of the material.\n","args":[],"type":"{ baseColorFactor : Math.Vector4.Vec4, baseColorTexture : Maybe.Maybe Gltf.Material.TextureIndex, metallicFactor : Basics.Float, roughnessFactor : Basics.Float, metallicRoughnessTexture : Maybe.Maybe Gltf.Material.TextureIndex }"},{"name":"TextureIndex","comment":" Use this to get a [textureWithIndex](Gltf#textureWithIndex)\n","args":[],"type":"Gltf.Query.TextureIndex.TextureIndex"}],"values":[],"binops":[]},{"name":"Gltf.Mesh","comment":" A mesh contains the geometry (vertices) and the material of a 3D object. One [Node](Gltf-Node#Node) can hold a multiple of meshes.\n\n**NOTE:** This package supplies meshes with a \"concrete\" type of attribute named [Vertex](Gltf-Mesh#Vertex). The thinking here is that your application will map these into your own type depending of needs. Storing meshes with this [Vertex](Gltf-Mesh#Vertex) type will mean storing a lot of redundant data and is not recommended if goal is optimization.\n\n@docs Mesh, Vertex, Joints\n\n","unions":[{"name":"Mesh","comment":" The types of meshes as you will find in [elm-explorations/webgl](https://package.elm-lang.org/packages/elm-explorations/webgl/latest/WebGL#Meshes)\n\n**NOTE:** only meshes with triangles are supported currently. Other [\"modes\"](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode) will come later.\n\n","args":[],"cases":[["Points",["Maybe.Maybe Gltf.Material.Material","List.List Gltf.Mesh.Vertex"]],["Lines",["Maybe.Maybe Gltf.Material.Material","List.List ( Gltf.Mesh.Vertex, Gltf.Mesh.Vertex )"]],["LineLoop",["Maybe.Maybe Gltf.Material.Material","List.List Gltf.Mesh.Vertex"]],["LineStrip",["Maybe.Maybe Gltf.Material.Material","List.List Gltf.Mesh.Vertex"]],["TriangleStrip",["Maybe.Maybe Gltf.Material.Material","List.List Gltf.Mesh.Vertex"]],["TriangleFan",["Maybe.Maybe Gltf.Material.Material","List.List Gltf.Mesh.Vertex"]],["TriangularMesh",["Maybe.Maybe Gltf.Material.Material","List.List ( Gltf.Mesh.Vertex, Gltf.Mesh.Vertex, Gltf.Mesh.Vertex )"]],["IndexedTriangularMesh",["Maybe.Maybe Gltf.Material.Material","( List.List Gltf.Mesh.Vertex, List.List ( Basics.Int, Basics.Int, Basics.Int ) )"]]]}],"aliases":[{"name":"Joints","comment":" The indices of the joints in the [skeleton](Gltf-Skin#Skeleton) the vertex is effected by.\n","args":[],"type":"{ j1 : Basics.Int, j2 : Basics.Int, j3 : Basics.Int, j4 : Basics.Int }"},{"name":"Vertex","comment":" The \"attributes\" of the Mesh. Map these into the attribute your shader(s) use.\n","args":[],"type":"{ position : Math.Vector3.Vec3, normal : Maybe.Maybe Math.Vector3.Vec3, tangent : Maybe.Maybe Math.Vector4.Vec4, color : Maybe.Maybe Math.Vector4.Vec4, weights : Maybe.Maybe Math.Vector4.Vec4, joints : Maybe.Maybe Gltf.Mesh.Joints, texCoords : Maybe.Maybe Math.Vector2.Vec2 }"}],"values":[],"binops":[]},{"name":"Gltf.Node","comment":" A Node is a container in a [Tree](https://package.elm-lang.org/packages/zwilias/elm-rosetree/latest/Tree#Tree) of nodes that makes up a \"scene\". A Node can just define a [Transform](Gltf-Transform#Transform) (meaning its children will appear in a different position) or a transform together with one or multiple [Meshes](Gltf-Mesh#Mesh) or a [Camera](Gltf-Camera#Camera). A single Node and its children can be controlled by an [Animation](Gltf-Animation#Animation)\n\n\n# Types\n\n@docs Node, Properties\n\n","unions":[{"name":"Node","comment":" The types of [Nodes](Gltf#nodeTrees) returned as a [Tree](https://package.elm-lang.org/packages/zwilias/elm-rosetree/latest/Tree#Tree) by a [query](Gltf#queries)\n","args":[],"cases":[["EmptyNode",["Gltf.Node.Properties"]],["CameraNode",["Gltf.Camera.Index","Gltf.Node.Properties"]],["MeshNode",["List.List Gltf.Mesh.Mesh","Gltf.Node.Properties"]],["SkinnedMeshNode",["List.List Gltf.Mesh.Mesh","Gltf.Skin.Index","Gltf.Node.Properties"]]]},{"name":"Properties","comment":" The [Transform](Gltf-Transform#Transform) of the Node along with name and index.\n","args":[],"cases":[["Properties",["{ nodeIndex : Gltf.NodeIndex.NodeIndex, nodeName : Maybe.Maybe String.String, transform : Gltf.Transform.Transform }"]]]}],"aliases":[],"values":[],"binops":[]},{"name":"Gltf.NodeIndex","comment":" The identifier for a Node\n\n@docs NodeIndex\n\n","unions":[{"name":"NodeIndex","comment":" The identifier for a [Node](Gltf-Node#Node) used to get its [Animations](Gltf-Animation#Animation) etc.\n","args":[],"cases":[["NodeIndex",["Basics.Int"]]]}],"aliases":[],"values":[],"binops":[]},{"name":"Gltf.Scene","comment":" A summary of a scene returned by [Gltf.scenes](Gltf#scenes).\n\n@docs Scene, Index\n\n","unions":[{"name":"Index","comment":" The identifier for a Skin\n","args":[],"cases":[["Index",["Basics.Int"]]]}],"aliases":[{"name":"Scene","comment":" A scene summary\n","args":[],"type":"{ name : Maybe.Maybe String.String, index : Gltf.Scene.Index, default : Basics.Bool }"}],"values":[],"binops":[]},{"name":"Gltf.Skin","comment":" The [Meshes](Gltf-Mesh#Mesh) of a _SkinnedMeshNode_ can be deformed/animated using a Skin.\n\n@docs Index, Skin, Skeleton\n\n","unions":[{"name":"Index","comment":" The identifier for a Skin\n","args":[],"cases":[["Index",["Basics.Int"]]]},{"name":"Skin","comment":" Joints and matrices defining a skin.\n","args":[],"cases":[["Skin",["{ inverseBindMatrices : List.List Math.Matrix4.Mat4, joints : List.List Gltf.NodeIndex.NodeIndex, index : Gltf.Skin.Index, skeleton : Gltf.Skin.Skeleton }"]]]}],"aliases":[{"name":"Skeleton","comment":" Internal\n","args":[],"type":"Gltf.Query.Skeleton.Skeleton"}],"values":[],"binops":[]},{"name":"Gltf.Transform","comment":" The [Nodes](Gltf-Node#Node) in glTF define their local [transformations](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#transformations) as either as a [matrix](https://package.elm-lang.org/packages/elm-explorations/linear-algebra/latest/Math-Matrix4#Mat4) or a combination of [translation](https://package.elm-lang.org/packages/elm-explorations/linear-algebra/latest/Math-Vector3#Vec3), [rotation](https://package.elm-lang.org/packages/nphollon/geo3d/latest/Quaternion#Quaternion), and [scale](https://package.elm-lang.org/packages/elm-explorations/linear-algebra/latest/Math-Vector3#Vec3) (also known as TRS properties).\n\n@docs Transform\n\n","unions":[{"name":"Transform","comment":" The local transform of a [Node](Gltf-Node#Node).\n","args":[],"cases":[["TRS",["{ translation : Maybe.Maybe Math.Vector3.Vec3, rotation : Maybe.Maybe Quaternion.Quaternion, scale : Maybe.Maybe Math.Vector3.Vec3 }"]],["Matrix",["Math.Matrix4.Mat4"]]]}],"aliases":[],"values":[],"binops":[]}]