18 #include "pandabase.h"
19 #include "typedReferenceCount.h"
21 #include "geomVertexData.h"
22 #include "speedtree_api.h"
47 virtual void load_data()=0;
49 INLINE
bool is_valid()
const;
51 INLINE
const Filename &get_normal_map()
const;
52 INLINE
const Filename &get_splat_map()
const;
54 INLINE
int get_num_splat_layers()
const;
55 INLINE
const Filename &get_splat_layer(
int n)
const;
56 INLINE PN_stdfloat get_splat_layer_tiling(
int n)
const;
57 INLINE
LColor get_splat_layer_color(
int n)
const;
59 INLINE
const GeomVertexFormat *get_vertex_format();
61 INLINE PN_stdfloat get_min_height()
const;
62 INLINE PN_stdfloat get_max_height()
const;
64 virtual PN_stdfloat get_height(PN_stdfloat x, PN_stdfloat y)
const=0;
65 virtual PN_stdfloat get_smooth_height(PN_stdfloat x, PN_stdfloat y, PN_stdfloat radius)
const;
66 virtual PN_stdfloat get_slope(PN_stdfloat x, PN_stdfloat y)
const;
68 bool placement_is_acceptable(PN_stdfloat x, PN_stdfloat y,
69 PN_stdfloat height_min, PN_stdfloat height_max,
70 PN_stdfloat slope_min, PN_stdfloat slope_max);
73 PN_stdfloat start_x, PN_stdfloat start_y,
74 PN_stdfloat size_xy,
int num_xy)
const;
76 virtual void output(ostream &out)
const;
77 virtual void write(ostream &out,
int indent_level = 0)
const;
80 const SpeedTree::SVertexAttribDesc *get_st_vertex_format()
const;
83 bool set_vertex_format(
const GeomVertexFormat *format);
86 static bool convert_vertex_format(
VertexAttribs &st_vertex_attribs,
87 const GeomVertexFormat *format);
88 static bool convert_vertex_column(SpeedTree::SVertexAttribDesc &st_attrib,
107 CPT(GeomVertexFormat) _vertex_format;
110 PN_stdfloat _min_height;
111 PN_stdfloat _max_height;
117 static void init_type() {
118 TypedReferenceCount::init_type();
119 register_type(_type_handle,
"STTerrain",
120 TypedReferenceCount::get_class_type());
123 return get_class_type();
125 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
131 INLINE ostream &operator << (ostream &out,
const STTerrain &terrain) {
136 #include "stTerrain.I"
This is an "unaligned" LVecBase4.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
This is the abstract base class that defines the interface needed to describe a terrain for rendering...
This defines how a single column is interleaved within a vertex array stored within a Geom...
A base class for all things which can have a name.
The name of a file, such as a texture file or an Egg file.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
This is the base class for all three-component vectors and points.
void output(ostream &out) const
Outputs the Namable.
TypeHandle is the identifier used to differentiate C++ class types.