Skip to content

Commit

Permalink
fix(lib): fourmolu --mode inplace src
Browse files Browse the repository at this point in the history
  • Loading branch information
sgillespie committed May 10, 2024
1 parent 7cedf60 commit 75898a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/Text/GLTF/Loader/Internal/Adapter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import Text.GLTF.Loader.Internal.BufferAccessor
import Text.GLTF.Loader.Internal.MonadAdapter

import qualified Codec.GlTF as GlTF
import qualified Codec.GlTF.Asset as Asset
import qualified Codec.GlTF.Animation as Animation
import qualified Codec.GlTF.Asset as Asset
import qualified Codec.GlTF.Image as Image
import qualified Codec.GlTF.Material as Material
import qualified Codec.GlTF.Mesh as Mesh
Expand Down Expand Up @@ -126,9 +126,9 @@ adaptAnimationChannel
adaptAnimationChannel samplers Animation.AnimationChannel{..} = do
gltf <- getGltf
buffers <- getBuffers
let Animation.AnimationSampler{ input, interpolation, output } =
let Animation.AnimationSampler{input, interpolation, output} =
samplers ! Animation.unAnimationSamplerIx sampler
Animation.AnimationChannelTarget{ node, path } = target
Animation.AnimationChannelTarget{node, path} = target
outputs = case path of
Animation.ROTATION -> Rotation $ animationSamplerRotationOutputs gltf buffers output
Animation.SCALE -> Scale $ animationSamplerScaleOutputs gltf buffers output
Expand All @@ -143,7 +143,8 @@ adaptAnimationChannel samplers Animation.AnimationChannel{..} = do
channelSamplerOutputs = outputs
}

adaptInterpolation :: Animation.AnimationSamplerInterpolation -> ChannelSamplerInterpolation
adaptInterpolation
:: Animation.AnimationSamplerInterpolation -> ChannelSamplerInterpolation
adaptInterpolation Animation.CUBICSPLINE = CubicSpline
adaptInterpolation Animation.LINEAR = Linear
adaptInterpolation Animation.STEP = Step
Expand Down
9 changes: 6 additions & 3 deletions src/Text/GLTF/Loader/Internal/BufferAccessor.hs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ loadImages GlTF{images = images} basePath = do
animationSamplerInputs :: GlTF -> Vector GltfBuffer -> AccessorIx -> Vector Float
animationSamplerInputs = readBufferWithGet (getScalar getFloat)

animationSamplerRotationOutputs :: GlTF -> Vector GltfBuffer -> AccessorIx -> Vector (Quaternion Float)
animationSamplerRotationOutputs
:: GlTF -> Vector GltfBuffer -> AccessorIx -> Vector (Quaternion Float)
animationSamplerRotationOutputs gltf buffers' accessorId =
fromMaybe (error "Invalid animation sampler output component type.") $ do
buffer@BufferAccessor{componentType = componentType} <-
Expand All @@ -106,10 +107,12 @@ animationSamplerRotationOutputs gltf buffers' accessorId =
FLOAT -> Just . readFromBuffer (Proxy @(Quaternion Float)) (getQuaternion getFloat) $ buffer
_ -> Nothing

animationSamplerScaleOutputs :: GlTF -> Vector GltfBuffer -> AccessorIx -> Vector (V3 Float)
animationSamplerScaleOutputs
:: GlTF -> Vector GltfBuffer -> AccessorIx -> Vector (V3 Float)
animationSamplerScaleOutputs = readBufferWithGet (getVec3 getFloat)

animationSamplerTranslationOutputs :: GlTF -> Vector GltfBuffer -> AccessorIx -> Vector (V3 Float)
animationSamplerTranslationOutputs
:: GlTF -> Vector GltfBuffer -> AccessorIx -> Vector (V3 Float)
animationSamplerTranslationOutputs = readBufferWithGet (getVec3 getFloat)

animationSamplerWeightsOutputs :: GlTF -> Vector GltfBuffer -> AccessorIx -> Vector Float
Expand Down

0 comments on commit 75898a8

Please sign in to comment.