Panda3D

physxSoftBodyMeshDesc.I

00001 // Filename: physxSoftBodyMeshDesc.I
00002 // Created by:  enn0x (12Sep10)
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: PhysxSoftBodyMeshDesc::Constructor
00018 //       Access: Public
00019 //  Description:
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE PhysxSoftBodyMeshDesc::
00022 PhysxSoftBodyMeshDesc() {
00023 
00024   _desc.flags = 0;
00025   _desc.vertexStrideBytes = sizeof(NxVec3);
00026   _desc.tetrahedronStrideBytes = 4*sizeof(NxU32);
00027   _desc.vertices = NULL;
00028   _desc.tetrahedra = NULL;
00029 
00030   _vertices = NULL;
00031   _tetrahedra = NULL;
00032 }
00033 
00034 ////////////////////////////////////////////////////////////////////
00035 //     Function: PhysxSoftBodyMeshDesc::Destructor
00036 //       Access: Public
00037 //  Description:
00038 ////////////////////////////////////////////////////////////////////
00039 INLINE PhysxSoftBodyMeshDesc::
00040 ~PhysxSoftBodyMeshDesc() {
00041 
00042   if (_vertices) {
00043     delete [] _vertices;
00044   }
00045 
00046   if (_tetrahedra) {
00047     delete [] _tetrahedra;
00048   }
00049 }
00050 
00051 ////////////////////////////////////////////////////////////////////
00052 //     Function: PhysxSoftBodyMeshDesc::is_valid
00053 //       Access: Published
00054 //  Description: Returns true if the descriptor is valid.
00055 ////////////////////////////////////////////////////////////////////
00056 INLINE bool PhysxSoftBodyMeshDesc::
00057 is_valid() const {
00058 
00059   return _desc.isValid();
00060 }
00061 
00062 ////////////////////////////////////////////////////////////////////
00063 //     Function: PhysxSoftBodyMeshDesc::get_desc
00064 //       Access: Public
00065 //  Description:
00066 ////////////////////////////////////////////////////////////////////
00067 INLINE const NxSoftBodyMeshDesc &PhysxSoftBodyMeshDesc::
00068 get_desc() const {
00069 
00070   return _desc;
00071 }
00072 
 All Classes Functions Variables Enumerations