diff --git a/panda/src/egg/eggGroup.cxx b/panda/src/egg/eggGroup.cxx index 85181ad837..ce17517048 100644 --- a/panda/src/egg/eggGroup.cxx +++ b/panda/src/egg/eggGroup.cxx @@ -687,6 +687,8 @@ string_cs_type(const string &string) { return CST_inverse_sphere; } else if (cmp_nocase_uh(string, "geode") == 0) { return CST_geode; + } else if (cmp_nocase_uh(string, "tube") == 0) { + return CST_tube; } else { return CST_none; } @@ -1059,6 +1061,8 @@ ostream &operator << (ostream &out, EggGroup::CollisionSolidType t) { return out << "InverseSphere"; case EggGroup::CST_geode: return out << "Geode"; + case EggGroup::CST_tube: + return out << "Tube"; } nassertr(false, out); diff --git a/panda/src/egg/eggGroup.h b/panda/src/egg/eggGroup.h index 9a77ef8763..f8e959f0e6 100644 --- a/panda/src/egg/eggGroup.h +++ b/panda/src/egg/eggGroup.h @@ -80,6 +80,7 @@ public: CST_sphere = 0x00040000, CST_inverse_sphere = 0x00050000, CST_geode = 0x00060000, + CST_tube = 0x00070000, }; enum CollideFlags { // The bits here must correspond to those in Flags, below. diff --git a/panda/src/egg/eggVertex.I b/panda/src/egg/eggVertex.I index b79b4c9a72..cbe2d90530 100644 --- a/panda/src/egg/eggVertex.I +++ b/panda/src/egg/eggVertex.I @@ -138,13 +138,14 @@ get_pos2() const { //////////////////////////////////////////////////////////////////// // Function: EggVertex::get_pos3 // Access: Public -// Description: Only valid if get_num_dimensions() returns 3. +// Description: Valid if get_num_dimensions() returns 3 or 4. // Returns the position as a three-dimensional value. //////////////////////////////////////////////////////////////////// INLINE Vertexd EggVertex:: get_pos3() const { - nassertr(_num_dimensions == 3, LPoint3d(0.0, 0.0, 0.0)); - return Vertexd(_pos[0], _pos[1], _pos[2]); + nassertr(_num_dimensions == 3 || _num_dimensions == 4, + LPoint3d(0.0, 0.0, 0.0)); + return Vertexd(_pos[0] / _pos[3], _pos[1] / _pos[3], _pos[2] / _pos[3]); }