add CST_tube

This commit is contained in:
David Rose 2003-10-01 19:12:05 +00:00
parent b9b7bb5964
commit fe4d0a70ac
3 changed files with 9 additions and 3 deletions

View File

@ -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);

View File

@ -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.

View File

@ -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]);
}