Panda3D
physxSoftBodyMeshDesc.I
1 // Filename: physxSoftBodyMeshDesc.I
2 // Created by: enn0x (12Sep10)
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: PhysxSoftBodyMeshDesc::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE PhysxSoftBodyMeshDesc::
22 PhysxSoftBodyMeshDesc() {
23 
24  _desc.flags = 0;
25  _desc.vertexStrideBytes = sizeof(NxVec3);
26  _desc.tetrahedronStrideBytes = 4*sizeof(NxU32);
27  _desc.vertices = NULL;
28  _desc.tetrahedra = NULL;
29 
30  _vertices = NULL;
31  _tetrahedra = NULL;
32 }
33 
34 ////////////////////////////////////////////////////////////////////
35 // Function: PhysxSoftBodyMeshDesc::Destructor
36 // Access: Public
37 // Description:
38 ////////////////////////////////////////////////////////////////////
39 INLINE PhysxSoftBodyMeshDesc::
40 ~PhysxSoftBodyMeshDesc() {
41 
42  if (_vertices) {
43  delete [] _vertices;
44  }
45 
46  if (_tetrahedra) {
47  delete [] _tetrahedra;
48  }
49 }
50 
51 ////////////////////////////////////////////////////////////////////
52 // Function: PhysxSoftBodyMeshDesc::is_valid
53 // Access: Published
54 // Description: Returns true if the descriptor is valid.
55 ////////////////////////////////////////////////////////////////////
56 INLINE bool PhysxSoftBodyMeshDesc::
57 is_valid() const {
58 
59  return _desc.isValid();
60 }
61 
62 ////////////////////////////////////////////////////////////////////
63 // Function: PhysxSoftBodyMeshDesc::get_desc
64 // Access: Public
65 // Description:
66 ////////////////////////////////////////////////////////////////////
67 INLINE const NxSoftBodyMeshDesc &PhysxSoftBodyMeshDesc::
68 get_desc() const {
69 
70  return _desc;
71 }
72 
bool is_valid() const
Returns true if the descriptor is valid.