2
0
David Rose 22 жил өмнө
parent
commit
fe4d0a70ac

+ 4 - 0
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);

+ 1 - 0
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.

+ 4 - 3
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]);
 }