Panda3D
 All Classes Functions Variables Enumerations
physxHeightFieldDesc.h
00001 // Filename: physxHeightFieldDesc.h
00002 // Created by:  enn0x (15Oct09)
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 PHYSXHEIGHTFIELDDESC_H
00016 #define PHYSXHEIGHTFIELDDESC_H
00017 
00018 #include "pandabase.h"
00019 #include "pnmImage.h"
00020 
00021 #include "physx_includes.h"
00022 
00023 ////////////////////////////////////////////////////////////////////
00024 //       Class : PhysxHeightFieldDesc
00025 // Description : Descriptor class for height fields. The height
00026 //               field data is copied when a PhysxHeightField object
00027 //               is created from this descriptor. After the call 
00028 //               the user may discard the original height data (e.g.
00029 //               release the PNGImage).
00030 ////////////////////////////////////////////////////////////////////
00031 class EXPCL_PANDAPHYSX PhysxHeightFieldDesc {
00032 
00033 PUBLISHED:
00034   INLINE PhysxHeightFieldDesc();
00035   INLINE ~PhysxHeightFieldDesc();
00036 
00037   INLINE void set_to_default();
00038   INLINE bool is_valid() const;
00039 
00040   INLINE void set_size(unsigned int num_rows, unsigned int num_columns);
00041 
00042   void set_image(const PNMImage &image, unsigned short materialIndex=0);
00043   void set_thickness(float thickness);
00044   void set_convex_edge_threshold(float threshold);
00045 
00046   void set_height(unsigned int row, unsigned int column, short height);
00047   void set_tess_flag(unsigned int row, unsigned int column, unsigned short value);
00048   void set_material_index(unsigned int row, unsigned int column,
00049     unsigned short materialIndex0, unsigned short materialIndex1);
00050 
00051 public:
00052   NxHeightFieldDesc _desc;
00053 
00054 private:
00055   NxU32 *_samples;
00056 
00057   INLINE void unset_size();
00058 };
00059 
00060 #include "physxHeightFieldDesc.I"
00061 
00062 #endif // PHYSXHEIGHTFIELDDESC_H
 All Classes Functions Variables Enumerations