Panda3D

physxTriangleMeshDesc.h

00001 // Filename: physxTriangleMeshDesc.h
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 #ifndef PHYSXTRIANGLEMESHDESC_H
00016 #define PHYSXTRIANGLEMESHDESC_H
00017 
00018 #include "pandabase.h"
00019 #include "nodePath.h"
00020 #include "luse.h"
00021 
00022 #include "physx_includes.h"
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //       Class : PhysxTriangleMeshDesc
00026 // Description :
00027 ////////////////////////////////////////////////////////////////////
00028 class EXPCL_PANDAPHYSX PhysxTriangleMeshDesc {
00029 
00030 PUBLISHED:
00031   INLINE PhysxTriangleMeshDesc();
00032   INLINE ~PhysxTriangleMeshDesc();
00033 
00034   INLINE bool is_valid() const;
00035 
00036   void set_num_vertices(unsigned int n);
00037   void set_vertex(unsigned int idx, const LPoint3f &vert);
00038 
00039   void set_num_triangles(unsigned int n, bool use_material_indices=false);
00040   void set_triangle(unsigned int idx,
00041                     unsigned int i1, unsigned int i2, unsigned int i3,
00042                     unsigned int material_index=1);
00043 
00044   void set_from_node_path(const NodePath &np);
00045 
00046 public:
00047   const NxTriangleMeshDesc &get_desc() const;
00048 
00049 private:
00050   NxVec3 *_vertices;
00051   NxU32 *_triangles;
00052   NxMaterialIndex *_materials;
00053   NxTriangleMeshDesc _desc;
00054 };
00055 
00056 #include "physxTriangleMeshDesc.I"
00057 
00058 #endif // PHYSXTRIANGLEMESHDESC_H
 All Classes Functions Variables Enumerations