From 1c638ea9babd7424664d7b262e6356375ebf4671 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 13 Nov 2003 19:21:25 +0000 Subject: [PATCH] show collision polygons that were loaded from pre-4.7 bam files --- panda/src/collide/collisionSolid.cxx | 18 ++++++++++++++---- panda/src/collide/collisionSolid.h | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/panda/src/collide/collisionSolid.cxx b/panda/src/collide/collisionSolid.cxx index e08e5f8927..b7b5c4d29f 100644 --- a/panda/src/collide/collisionSolid.cxx +++ b/panda/src/collide/collisionSolid.cxx @@ -277,11 +277,21 @@ write_datagram(BamWriter *, Datagram &me) { // place //////////////////////////////////////////////////////////////////// void CollisionSolid:: -fillin(DatagramIterator &scan, BamReader*) { - _flags = scan.get_uint8(); - if ((_flags & F_effective_normal) != 0) { - _effective_normal.read_datagram(scan); +fillin(DatagramIterator &scan, BamReader *manager) { + if (manager->get_file_minor_ver() < 7) { + bool tangible = scan.get_bool(); + if (!tangible) { + _flags &= ~F_tangible; + } + } else { + _flags = scan.get_uint8(); + if ((_flags & F_effective_normal) != 0) { + _effective_normal.read_datagram(scan); + } } + + // The viz is always stale after reading from a bam file. + _flags |= F_viz_geom_stale; } diff --git a/panda/src/collide/collisionSolid.h b/panda/src/collide/collisionSolid.h index 8e3d7b0718..0e4b951e16 100644 --- a/panda/src/collide/collisionSolid.h +++ b/panda/src/collide/collisionSolid.h @@ -103,6 +103,8 @@ protected: private: LVector3f _effective_normal; + // Be careful reordering these bits, since they are written to a bam + // file. enum Flags { F_tangible = 0x01, F_effective_normal = 0x02,