Panda3D
physxHeightFieldDesc.h
1 // Filename: physxHeightFieldDesc.h
2 // Created by: enn0x (15Oct09)
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 #ifndef PHYSXHEIGHTFIELDDESC_H
16 #define PHYSXHEIGHTFIELDDESC_H
17 
18 #include "pandabase.h"
19 #include "pnmImage.h"
20 
21 #include "physx_includes.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : PhysxHeightFieldDesc
25 // Description : Descriptor class for height fields. The height
26 // field data is copied when a PhysxHeightField object
27 // is created from this descriptor. After the call
28 // the user may discard the original height data (e.g.
29 // release the PNGImage).
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDAPHYSX PhysxHeightFieldDesc {
32 
33 PUBLISHED:
34  INLINE PhysxHeightFieldDesc();
35  INLINE ~PhysxHeightFieldDesc();
36 
37  INLINE void set_to_default();
38  INLINE bool is_valid() const;
39 
40  INLINE void set_size(unsigned int num_rows, unsigned int num_columns);
41 
42  void set_image(const PNMImage &image, unsigned short materialIndex=0);
43  void set_thickness(float thickness);
44  void set_convex_edge_threshold(float threshold);
45 
46  void set_height(unsigned int row, unsigned int column, short height);
47  void set_tess_flag(unsigned int row, unsigned int column, unsigned short value);
48  void set_material_index(unsigned int row, unsigned int column,
49  unsigned short materialIndex0, unsigned short materialIndex1);
50 
51 public:
52  NxHeightFieldDesc _desc;
53 
54 private:
55  NxU32 *_samples;
56 
57  INLINE void unset_size();
58 };
59 
60 #include "physxHeightFieldDesc.I"
61 
62 #endif // PHYSXHEIGHTFIELDDESC_H
The name of this class derives from the fact that we originally implemented it as a layer on top of t...
Definition: pnmImage.h:68
Descriptor class for height fields.