Panda3D

physxTriangleMeshDesc.I

00001 // Filename: physxTriangleMeshDesc.I
00002 // Created by:  enn0x (11Oct09)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: PhysxTriangleMeshDesc::Constructor
00018 //       Access: Public
00019 //  Description:
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE PhysxTriangleMeshDesc::
00022 PhysxTriangleMeshDesc() {
00023 
00024   _desc.flags = 0;
00025   _desc.pointStrideBytes = sizeof(NxVec3);
00026   _desc.triangleStrideBytes = 3*sizeof(NxU32);
00027   _desc.materialIndexStride = sizeof(NxMaterialIndex);
00028   _desc.points = NULL;
00029   _desc.triangles = NULL;
00030   _desc.materialIndices = NULL;
00031 
00032   _vertices = NULL;
00033   _triangles = NULL;
00034   _materials = NULL;
00035 }
00036 
00037 ////////////////////////////////////////////////////////////////////
00038 //     Function: PhysxTriangleMeshDesc::Destructor
00039 //       Access: Public
00040 //  Description:
00041 ////////////////////////////////////////////////////////////////////
00042 INLINE PhysxTriangleMeshDesc::
00043 ~PhysxTriangleMeshDesc() {
00044 
00045   if (_vertices) {
00046     delete [] _vertices;
00047   }
00048 
00049   if (_triangles) {
00050     delete [] _triangles;
00051   }
00052 
00053   if (_materials) {
00054     delete [] _materials;
00055   }
00056 }
00057 
00058 ////////////////////////////////////////////////////////////////////
00059 //     Function: PhysxTriangleMeshDesc::is_valid
00060 //       Access: Published
00061 //  Description: Returns true if the descriptor is valid.
00062 ////////////////////////////////////////////////////////////////////
00063 INLINE bool PhysxTriangleMeshDesc::
00064 is_valid() const {
00065 
00066   return _desc.isValid();
00067 }
00068 
 All Classes Functions Variables Enumerations