Panda3D
physxTriangleMeshDesc.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file physxTriangleMeshDesc.I
10  * @author enn0x
11  * @date 2009-10-11
12  */
13 
14 /**
15  *
16  */
17 INLINE PhysxTriangleMeshDesc::
18 PhysxTriangleMeshDesc() {
19 
20  _desc.flags = 0;
21  _desc.pointStrideBytes = sizeof(NxVec3);
22  _desc.triangleStrideBytes = 3*sizeof(NxU32);
23  _desc.materialIndexStride = sizeof(NxMaterialIndex);
24  _desc.points = nullptr;
25  _desc.triangles = nullptr;
26  _desc.materialIndices = nullptr;
27 
28  _vertices = nullptr;
29  _triangles = nullptr;
30  _materials = nullptr;
31 }
32 
33 /**
34  *
35  */
36 INLINE PhysxTriangleMeshDesc::
37 ~PhysxTriangleMeshDesc() {
38 
39  if (_vertices) {
40  delete [] _vertices;
41  }
42 
43  if (_triangles) {
44  delete [] _triangles;
45  }
46 
47  if (_materials) {
48  delete [] _materials;
49  }
50 }
51 
52 /**
53  * Returns true if the descriptor is valid.
54  */
55 INLINE bool PhysxTriangleMeshDesc::
56 is_valid() const {
57 
58  return _desc.isValid();
59 }
bool is_valid() const
Returns true if the descriptor is valid.