Skip to content

Commit

Permalink
Scene adapter spec tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrehayden1 committed Feb 24, 2024
1 parent f1c7544 commit b53b7e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions test/Text/GLTF/Loader/Internal/AdapterSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ loaderGltf = Gltf
gltfMeshes = [loaderMesh],
gltfNodes = [loaderNode],
gltfSamplers = [loaderSampler],
gltfScenes = [loaderScene],
gltfTextures = [loaderTexture]
}

Expand Down Expand Up @@ -334,6 +335,12 @@ loaderSampler = Sampler
samplerWrapT = Repeat
}

loaderScene :: Scene
loaderScene = Scene
{ sceneName = Just "Scene",
sceneNodes = [0]
}

loaderTexture :: Texture
loaderTexture = Texture
{ textureName = Just "Texture",
Expand Down
11 changes: 10 additions & 1 deletion test/Text/GLTF/Loader/Test/MkGltf.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import qualified Codec.GlTF.Mesh as Mesh
import qualified Codec.GlTF.PbrMetallicRoughness as PbrMetallicRoughness
import qualified Codec.GlTF.Node as Node
import qualified Codec.GlTF.Sampler as Sampler
import qualified Codec.GlTF.Scene as Scene
import qualified Codec.GlTF.Texture as Texture
import qualified Codec.GlTF.TextureInfo as TextureInfo
import qualified Codec.GlTF.URI as URI
Expand Down Expand Up @@ -62,7 +63,7 @@ mkCodecGltf = GlTF.GlTF
meshes = Just [mkCodecMesh],
nodes = Just [mkCodecNode],
samplers = Just [mkCodecSampler],
scenes = Nothing,
scenes = Just [mkCodecScene],
skins = Nothing,
textures = Just [mkCodecTexture],
extensions = Nothing,
Expand Down Expand Up @@ -447,6 +448,14 @@ mkCodecSampler = Sampler.Sampler
wrapT = Sampler.REPEAT
}

mkCodecScene :: Scene.Scene
mkCodecScene = Scene.Scene
{ name = Just "Scene",
nodes = Just [Node.NodeIx 0],
extensions = Nothing,
extras = Nothing
}

mkCodecTexture :: Texture.Texture
mkCodecTexture = Texture.Texture
{ sampler = Just (Sampler.SamplerIx 0),
Expand Down

0 comments on commit b53b7e5

Please sign in to comment.