14#ifndef HEIGHTFIELDTESSELATOR_H
15#define HEIGHTFIELDTESSELATOR_H
58class EXPCL_PANDA_GRUTIL HeightfieldTesselator :
public Namable {
60 INLINE
explicit HeightfieldTesselator(
const std::string &name);
61 INLINE ~HeightfieldTesselator();
80 bool _radii_calculated;
83 int *_triangle_totals;
96 INLINE
bool subdivide(
int scale,
int x,
int y);
97 void calculate_radii(
int scale);
98 void generate_square(
NodePath root,
int scale,
int x,
int y,
bool forceclose);
99 int count_triangles(
int scale,
int x,
int y);
100 int get_vertex(
int x,
int y);
101 void add_quad_to_strip(
int v1,
int v2,
int v3,
int v4);
102 void add_quad(
int v1,
int v2,
int v3,
int v4);
103 void fix_heightfield(
int size);
109 int _visibility_radius;
112 double _horizontal_scale;
113 double _vertical_scale;
The name of a file, such as a texture file or an Egg file.
Defines a series of disconnected triangles.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
This object provides a high-level interface for quickly writing a sequence of numeric values from a v...
PNMImage & heightfield()
Returns a reference to the heightfield (a PNMImage) contained inside the HeightfieldTesselator.
NodePath generate()
Generates a tree of nodes that represents the heightfield.
bool set_heightfield(const Filename &filename, PNMFileType *type=nullptr)
Loads the specified greyscale image file into the heightfield.
void set_vertical_scale(double v)
Sets the vertical scale.
void set_horizontal_scale(double h)
Sets the horizontal scale.
double get_elevation(double x, double y)
Fetches the elevation at (x,y), where the input coordinate is specified in pixels.
void set_max_triangles(int n)
Sets the max triangles per geom.
void set_visibility_radius(int r)
Sets the visibility radius.
void set_poly_count(int n)
Sets the polygon-count target.
void set_focal_point(int x, int y)
Sets the focal point.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
This is the base class of a family of classes that represent particular image file types that PNMImag...
The name of this class derives from the fact that we originally implemented it as a layer on top of t...
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.
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.
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.