15 #ifndef GEOMIPTERRAIN_H
16 #define GEOMIPTERRAIN_H
18 #include "pandabase.h"
21 #include "pandaNode.h"
22 #include "pointerTo.h"
43 INLINE ~GeoMipTerrain();
47 INLINE
bool set_heightfield(
const PNMImage &image);
49 INLINE
bool set_color_map(
const Filename &filename,
51 INLINE
bool set_color_map(
const PNMImage &image);
52 INLINE
bool set_color_map(
const Texture *image);
53 INLINE
bool set_color_map(
const string &path);
54 INLINE
bool has_color_map()
const;
55 INLINE
void clear_color_map();
56 void calc_ambient_occlusion(PN_stdfloat radius = 32, PN_stdfloat contrast = 2.0f, PN_stdfloat brightness = 0.75f);
57 double get_elevation(
double x,
double y);
59 INLINE
LVector3 get_normal(
unsigned short mx,
unsigned short my,
61 INLINE
void set_bruteforce(
bool bf);
62 INLINE
bool get_bruteforce();
66 enum AutoFlattenMode {
77 INLINE
void set_auto_flatten(
int mode);
83 INLINE
void set_focal_point(
const LPoint2d &fp);
84 INLINE
void set_focal_point(
const LPoint2f &fp);
85 INLINE
void set_focal_point(
const LPoint3d &fp);
86 INLINE
void set_focal_point(
const LPoint3f &fp);
87 INLINE
void set_focal_point(
double x,
double y);
88 INLINE
void set_focal_point(
NodePath fnp);
89 INLINE
NodePath get_focal_point()
const;
92 INLINE
void set_block_size(
unsigned short newbs);
93 INLINE
unsigned short get_block_size();
94 INLINE
unsigned short get_max_level();
95 INLINE
void set_min_level(
unsigned short minlevel);
96 INLINE
unsigned short get_min_level();
97 INLINE
bool is_dirty();
98 INLINE
void set_factor(PN_stdfloat factor);
99 INLINE
void set_near_far(
double input_near,
double input_far);
100 INLINE
void set_near(
double input_near);
101 INLINE
void set_far(
double input_far);
102 INLINE
const NodePath get_block_node_path(
unsigned short mx,
104 INLINE
LVecBase2 get_block_from_pos(
double x,
double y);
105 INLINE
void set_border_stitching(
bool stitching);
106 INLINE
bool get_border_stitching();
107 INLINE
double get_far();
108 INLINE
double get_near();
109 INLINE
int get_flatten_mode();
117 PT(
GeomNode) generate_block(
unsigned short mx,
unsigned short my,
unsigned short level);
118 bool update_block(
unsigned short mx,
unsigned short my,
119 signed short level = -1,
bool forced =
false);
122 bool root_flattened();
124 INLINE
bool is_power_of_two(
unsigned int i);
125 INLINE
float f_part(
float i);
126 INLINE
double f_part(
double i);
127 INLINE
int sfav(
int n,
int powlevel,
int mypowlevel);
128 INLINE
double get_pixel_value(
int x,
int y);
129 INLINE
double get_pixel_value(
unsigned short mx,
unsigned short my,
int x,
int y);
130 INLINE
unsigned short lod_decide(
unsigned short mx,
unsigned short my);
131 unsigned short get_neighbor_level(
unsigned short mx,
unsigned short my,
short dmx,
short dmy);
135 bool _root_flattened;
146 unsigned short _block_size;
147 unsigned short _max_level;
150 bool _focal_is_temporary;
151 unsigned short _min_level;
163 register_type(_type_handle,
"GeoMipTerrain",
164 TypedObject::get_class_type());
167 return get_class_type();
176 #include "geoMipTerrain.I"
static void init_type()
This function is declared non-inline to work around a compiler bug in g++ 2.96.
The name of this class derives from the fact that we originally implemented it as a layer on top of t...
GeoMipTerrain, meaning Panda3D GeoMipMapping, can convert a heightfield image into a 3D terrain...
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
This is the base class of a family of classes that represent particular image file types that PNMImag...
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
This is a two-component point in space.
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
This is our own Panda specialization on the default STL vector.
The name of a file, such as a texture file or an Egg file.
This is the base class for all two-component vectors and points.
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
This is a two-component point in space.
TypeHandle is the identifier used to differentiate C++ class types.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
A node that holds Geom objects, renderable pieces of geometry.