diff options
-rw-r--r-- | Spear/Assets/Model.hsc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Spear/Assets/Model.hsc b/Spear/Assets/Model.hsc index f1adfd7..6c4cfe5 100644 --- a/Spear/Assets/Model.hsc +++ b/Spear/Assets/Model.hsc | |||
@@ -463,12 +463,16 @@ modelBoxes model = | |||
463 | peekBoxes ptr n cur off l | 463 | peekBoxes ptr n cur off l |
464 | | cur == n = l | 464 | | cur == n = l |
465 | | otherwise = do | 465 | | otherwise = do |
466 | f0 <- peekByteOff ptr off | 466 | xmin <- peekByteOff ptr off |
467 | f1 <- peekByteOff ptr $ off + sizeFloat | 467 | ymin <- peekByteOff ptr $ off + sizeFloat |
468 | f2 <- peekByteOff ptr $ off + 2*sizeFloat | 468 | zmin <- peekByteOff ptr $ off + 2*sizeFloat |
469 | f3 <- peekByteOff ptr $ off + 3*sizeFloat | 469 | xmax <- peekByteOff ptr $ off + 3*sizeFloat |
470 | peekBoxes ptr n (cur+1) (off + 4*sizeFloat) $ | 470 | ymax <- peekByteOff ptr $ off + 4*sizeFloat |
471 | fmap ((f3:) . (f2:) . (f1:) . (f0:)) l | 471 | zmax <- peekByteOff ptr $ off + 5*sizeFloat |
472 | let pmin = Vec3 xmin ymin zmin | ||
473 | pmax = Vec3 xmax ymax zmax | ||
474 | box = Box pmin pmax | ||
475 | peekBoxes ptr n (cur+1) (off + 6*sizeFloat) $ fmap (box:) l | ||
472 | fmap (V.fromList . reverse) getBoxes | 476 | fmap (V.fromList . reverse) getBoxes |
473 | 477 | ||
474 | 478 | ||