Panda3D
 All Classes Functions Variables Enumerations
bulletTriangleMeshShape.I
1 // Filename: bulletTriangleMeshShape.I
2 // Created by: enn0x (09Feb10)
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 // Function: BulletTriangleMeshShape::Copy Constructor
17 // Access: Published
18 // Description:
19 ////////////////////////////////////////////////////////////////////
22  _bvh_shape(copy._bvh_shape),
23  _gimpact_shape(copy._gimpact_shape),
24  _mesh(copy._mesh) {
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: BulletTriangleMeshShape::Copy Assignment Operator
29 // Access: Published
30 // Description:
31 ////////////////////////////////////////////////////////////////////
32 INLINE void BulletTriangleMeshShape::
33 operator = (const BulletTriangleMeshShape &copy) {
34 
35  _bvh_shape = copy._bvh_shape;
36  _gimpact_shape = copy._gimpact_shape;
37  _mesh = copy._mesh;
38 }
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function: BulletTriangleMeshShape::Destructor
42 // Access: Published
43 // Description:
44 ////////////////////////////////////////////////////////////////////
45 INLINE BulletTriangleMeshShape::
46 ~BulletTriangleMeshShape() {
47 
48  if (_bvh_shape) {
49  delete _bvh_shape;
50  }
51 
52  if (_gimpact_shape) {
53  delete _gimpact_shape;
54  }
55 }
56 
57 ////////////////////////////////////////////////////////////////////
58 // Function: BulletTriangleMeshShape::is_static
59 // Access: Published
60 // Description:
61 ////////////////////////////////////////////////////////////////////
62 INLINE bool BulletTriangleMeshShape::
63 is_static() const {
64 
65  return (_bvh_shape != NULL);
66 }
67 
68 ////////////////////////////////////////////////////////////////////
69 // Function: BulletTriangleMeshShape::is_dynamic
70 // Access: Published
71 // Description:
72 ////////////////////////////////////////////////////////////////////
73 INLINE bool BulletTriangleMeshShape::
74 is_dynamic() const {
75 
76  return (_gimpact_shape != NULL);
77 }
78 
BulletTriangleMeshShape(BulletTriangleMesh *mesh, bool dynamic, bool compress=true, bool bvh=true)
The parameters 'compress' and 'bvh' are only used if 'dynamic' is set to FALSE.