Panda3D
physxTriangleMeshDesc.I
1 // Filename: physxTriangleMeshDesc.I
2 // Created by: enn0x (11Oct09)
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: PhysxTriangleMeshDesc::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE PhysxTriangleMeshDesc::
22 PhysxTriangleMeshDesc() {
23 
24  _desc.flags = 0;
25  _desc.pointStrideBytes = sizeof(NxVec3);
26  _desc.triangleStrideBytes = 3*sizeof(NxU32);
27  _desc.materialIndexStride = sizeof(NxMaterialIndex);
28  _desc.points = NULL;
29  _desc.triangles = NULL;
30  _desc.materialIndices = NULL;
31 
32  _vertices = NULL;
33  _triangles = NULL;
34  _materials = NULL;
35 }
36 
37 ////////////////////////////////////////////////////////////////////
38 // Function: PhysxTriangleMeshDesc::Destructor
39 // Access: Public
40 // Description:
41 ////////////////////////////////////////////////////////////////////
42 INLINE PhysxTriangleMeshDesc::
43 ~PhysxTriangleMeshDesc() {
44 
45  if (_vertices) {
46  delete [] _vertices;
47  }
48 
49  if (_triangles) {
50  delete [] _triangles;
51  }
52 
53  if (_materials) {
54  delete [] _materials;
55  }
56 }
57 
58 ////////////////////////////////////////////////////////////////////
59 // Function: PhysxTriangleMeshDesc::is_valid
60 // Access: Published
61 // Description: Returns true if the descriptor is valid.
62 ////////////////////////////////////////////////////////////////////
63 INLINE bool PhysxTriangleMeshDesc::
64 is_valid() const {
65 
66  return _desc.isValid();
67 }
68 
bool is_valid() const
Returns true if the descriptor is valid.