aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Sunet <jeannekamikaze@gmail.com>2012-08-31 16:57:27 +0200
committerMarc Sunet <jeannekamikaze@gmail.com>2012-08-31 16:57:27 +0200
commit7c2de23abceaa394044e23d194ca8649a04a0ad9 (patch)
treec0eafab0d94e814159551b8e4ffc026124f497da
parente752f4a4ac90682e46d0889dfb946aa37fb9de7d (diff)
Fixed bounding boxes
-rw-r--r--Spear/Assets/Model.hsc16
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