Panda3D
 All Classes Functions Variables Enumerations
collisionFloorMesh.I
00001 //: collisionPlane.I
00002 // Created by:  drose (25Apr00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: CollisionPlane::Default Constructor
00018 //       Access: Protected
00019 //  Description: This is only for the convenience of CollisionPolygon.
00020 //               Normally, you should not attempt to create an
00021 //               uninitialized CollisionPlane.
00022 ////////////////////////////////////////////////////////////////////
00023 INLINE CollisionFloorMesh::
00024 CollisionFloorMesh() {
00025 }
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //     Function: CollisionFloorMesh::Copy Constructor
00029 //       Access: Public
00030 //  Description:
00031 ////////////////////////////////////////////////////////////////////
00032 INLINE CollisionFloorMesh::
00033 CollisionFloorMesh(const CollisionFloorMesh &copy) :
00034   CollisionSolid(copy)
00035 {
00036 }
00037 
00038 ////////////////////////////////////////////////////////////////////
00039 //     Function: CollisionFloorMesh::flush_level
00040 //       Access: Public, Static
00041 //  Description: Flushes the PStatCollectors used during traversal.
00042 ////////////////////////////////////////////////////////////////////
00043 INLINE void CollisionFloorMesh::
00044 flush_level() {
00045   _volume_pcollector.flush_level();
00046   _test_pcollector.flush_level();
00047 }
00048 
00049 ////////////////////////////////////////////////////////////////////
00050 //     Function: CollisionFloorMesh::add_vertex
00051 //       Access: Published
00052 //  Description: store away a vertex to index against
00053 ////////////////////////////////////////////////////////////////////
00054 INLINE void CollisionFloorMesh::
00055 add_vertex(const LPoint3 &vert) {
00056   _vertices.push_back(vert);
00057 }
00058 
00059 INLINE const unsigned int  CollisionFloorMesh::
00060 get_num_vertices() const {
00061   return _vertices.size();
00062 }
00063 
00064 INLINE const LPoint3 CollisionFloorMesh::
00065 get_vertex(unsigned int index) const {
00066   return _vertices[index];
00067 }
00068 
00069 INLINE const unsigned int  CollisionFloorMesh::
00070 get_num_triangles() const {
00071   return _triangles.size();
00072 }
00073 
00074 INLINE const LPoint3d CollisionFloorMesh::
00075 get_triangle(unsigned int index) const {
00076   CollisionFloorMesh::TriangleIndices tri = _triangles[index];
00077   return LPoint3d(tri.p1, tri.p2, tri.p3);
00078 }
00079 
 All Classes Functions Variables Enumerations