summaryrefslogtreecommitdiff
path: root/src/Graphics/WaveFront/Parse/OBJ.hs
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-06-11 02:58:54 -0400
committerJoe Crayne <joe@jerkface.net>2019-06-11 02:58:54 -0400
commit33ac9c597f708c0f0d2232c25e1fbbf7840b9610 (patch)
treef257f8d041818ccdfd54347964ffa5c3d9dfda60 /src/Graphics/WaveFront/Parse/OBJ.hs
parent6fbc401f5cbb89e9c8b6be48f746e911848aed36 (diff)
Sundqvist parser: support vp token.
Diffstat (limited to 'src/Graphics/WaveFront/Parse/OBJ.hs')
-rw-r--r--src/Graphics/WaveFront/Parse/OBJ.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Graphics/WaveFront/Parse/OBJ.hs b/src/Graphics/WaveFront/Parse/OBJ.hs
index 2c3919e..df4b52e 100644
--- a/src/Graphics/WaveFront/Parse/OBJ.hs
+++ b/src/Graphics/WaveFront/Parse/OBJ.hs
@@ -83,6 +83,7 @@ token = (Atto.string "f" *> face) <|>
83 -- TODO: How to deal with common prefix (v, vn, vt) (backtrack?) (doesn't seem to be a problem) 83 -- TODO: How to deal with common prefix (v, vn, vt) (backtrack?) (doesn't seem to be a problem)
84 (Atto.string "vn" *> normal) <|> 84 (Atto.string "vn" *> normal) <|>
85 (Atto.string "vt" *> texcoord) <|> 85 (Atto.string "vt" *> texcoord) <|>
86 (Atto.string "vp" *> paramcoord) <|>
86 (Atto.string "v" *> vertex) <|> 87 (Atto.string "v" *> vertex) <|>
87 (Atto.string "o" *> object) <|> 88 (Atto.string "o" *> object) <|>
88 (Atto.string "g" *> group) <|> 89 (Atto.string "g" *> group) <|>
@@ -137,10 +138,13 @@ normal :: (Fractional f) => Atto.Parser (OBJToken f Text i m)
137normal = OBJNormal <$> point3D 138normal = OBJNormal <$> point3D
138 139
139 140
140-- | Two coordinates, separated by whitespace 141-- | One to three coordinates, separated by whitespace
141texcoord :: (Fractional f) => Atto.Parser (OBJToken f Text i m) 142texcoord :: (Fractional f) => Atto.Parser (OBJToken f Text i m)
142texcoord = OBJTexCoord <$> pointTo3 1 0.0 143texcoord = OBJTexCoord <$> pointTo3 1 0.0
143 144
145-- | One to three coordinates, separated by whitespace
146paramcoord :: (Fractional f) => Atto.Parser (OBJToken f Text i m)
147paramcoord = OBJParamCoord <$> pointTo3 1 0.0
144 148
145-- | Three coordinates, separated by whitespace 149-- | Three coordinates, separated by whitespace
146vertex :: (Fractional f) => Atto.Parser (OBJToken f s i m) 150vertex :: (Fractional f) => Atto.Parser (OBJToken f s i m)