Panda3D
physxHeightFieldDesc.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file physxHeightFieldDesc.h
10  * @author enn0x
11  * @date 2009-10-15
12  */
13 
14 #ifndef PHYSXHEIGHTFIELDDESC_H
15 #define PHYSXHEIGHTFIELDDESC_H
16 
17 #include "pandabase.h"
18 #include "pnmImage.h"
19 
20 #include "physx_includes.h"
21 
22 /**
23  * Descriptor class for height fields. The height field data is copied when a
24  * PhysxHeightField object is created from this descriptor. After the call
25  * the user may discard the original height data (e.g. release the PNGImage).
26  */
27 class EXPCL_PANDAPHYSX PhysxHeightFieldDesc {
28 
29 PUBLISHED:
30  INLINE PhysxHeightFieldDesc();
31  INLINE ~PhysxHeightFieldDesc();
32 
33  INLINE void set_to_default();
34  INLINE bool is_valid() const;
35 
36  INLINE void set_size(unsigned int num_rows, unsigned int num_columns);
37 
38  void set_image(const PNMImage &image, unsigned short materialIndex=0);
39  void set_thickness(float thickness);
40  void set_convex_edge_threshold(float threshold);
41 
42  void set_height(unsigned int row, unsigned int column, short height);
43  void set_tess_flag(unsigned int row, unsigned int column, unsigned short value);
44  void set_material_index(unsigned int row, unsigned int column,
45  unsigned short materialIndex0, unsigned short materialIndex1);
46 
47 public:
48  NxHeightFieldDesc _desc;
49 
50 private:
51  NxU32 *_samples;
52 
53  INLINE void unset_size();
54 };
55 
56 #include "physxHeightFieldDesc.I"
57 
58 #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:58
Descriptor class for height fields.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.