Panda3D
 All Classes Functions Variables Enumerations
collisionFloorMesh.I
1 //: collisionPlane.I
2 // Created by: drose (25Apr00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: CollisionPlane::Default Constructor
18 // Access: Protected
19 // Description: This is only for the convenience of CollisionPolygon.
20 // Normally, you should not attempt to create an
21 // uninitialized CollisionPlane.
22 ////////////////////////////////////////////////////////////////////
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: CollisionFloorMesh::Copy Constructor
29 // Access: Public
30 // Description:
31 ////////////////////////////////////////////////////////////////////
34  CollisionSolid(copy)
35 {
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: CollisionFloorMesh::flush_level
40 // Access: Public, Static
41 // Description: Flushes the PStatCollectors used during traversal.
42 ////////////////////////////////////////////////////////////////////
43 INLINE void CollisionFloorMesh::
45  _volume_pcollector.flush_level();
46  _test_pcollector.flush_level();
47 }
48 
49 ////////////////////////////////////////////////////////////////////
50 // Function: CollisionFloorMesh::add_vertex
51 // Access: Published
52 // Description: store away a vertex to index against
53 ////////////////////////////////////////////////////////////////////
54 INLINE void CollisionFloorMesh::
55 add_vertex(const LPoint3 &vert) {
56  _vertices.push_back(vert);
57 }
58 
59 INLINE unsigned int CollisionFloorMesh::
60 get_num_vertices() const {
61  return _vertices.size();
62 }
63 
64 INLINE const LPoint3 &CollisionFloorMesh::
65 get_vertex(unsigned int index) const {
66  return _vertices[index];
67 }
68 
69 INLINE unsigned int CollisionFloorMesh::
70 get_num_triangles() const {
71  return _triangles.size();
72 }
73 
74 INLINE LPoint3i CollisionFloorMesh::
75 get_triangle(unsigned int index) const {
76  CollisionFloorMesh::TriangleIndices tri = _triangles[index];
77  return LPoint3i(tri.p1, tri.p2, tri.p3);
78 }
The abstract base class for all things that can collide with other things in the world, and all the things they can collide with (except geometry).
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
CollisionFloorMesh()
This is only for the convenience of CollisionPolygon.
static void flush_level()
Flushes the PStatCollectors used during traversal.
void add_vertex(const LPoint3 &vert)
store away a vertex to index against
This object represents a solid made entirely of triangles, which will only be tested again z axis ali...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:914