From 4ec660096d6875faa26bf8ca39c6f60bef78c069 Mon Sep 17 00:00:00 2001 From: Mike Christel Date: Tue, 3 Aug 2010 14:56:17 +0000 Subject: [PATCH] Added getters for auto_flatten mode, near and far (i.e., get_flatten_mode, get_near, get_far). --- panda/src/grutil/geoMipTerrain.I | 35 ++++++++++++++++++++++++++++++++ panda/src/grutil/geoMipTerrain.h | 7 ++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/panda/src/grutil/geoMipTerrain.I b/panda/src/grutil/geoMipTerrain.I index bbe85b9767..682f62a2b3 100644 --- a/panda/src/grutil/geoMipTerrain.I +++ b/panda/src/grutil/geoMipTerrain.I @@ -1,5 +1,7 @@ // Filename: geoMipTerrain.I // Created by: pro-rsoft (29jun07) +// Modified by: CMU ETC Summer 2010 team (03aug10) (added getters +// for _auto_flatten, _near, _far). // //////////////////////////////////////////////////////////////////// // @@ -337,6 +339,39 @@ set_far(double input_far) { _far = input_far; } +//////////////////////////////////////////////////////////////////// +// Function: GeoMipTerrain::get_far +// Access: Published +// Description: Returns the far LOD distance in the terrain coordinate +// space +//////////////////////////////////////////////////////////////////// +INLINE double GeoMipTerrain:: +get_far() { + return _far; +} + +//////////////////////////////////////////////////////////////////// +// Function: GeoMipTerrain::get_near +// Access: Published +// Description: Returns the near LOD distance in the terrain coordinate +// space +//////////////////////////////////////////////////////////////////// +INLINE double GeoMipTerrain:: +get_near() { + return _near; +} + +//////////////////////////////////////////////////////////////////// +// Function: GeoMipTerrain::get_flatten_mode +// Access: Published +// Description: Returns the automatic-flatten mode (e.g., off, +// flatten_light, flatten_medium, or flatten_strong) +//////////////////////////////////////////////////////////////////// +INLINE int GeoMipTerrain:: +get_flatten_mode() { + return _auto_flatten; +} + //////////////////////////////////////////////////////////////////// // Function: GeoMipTerrain::get_block_node_path // Access: Published diff --git a/panda/src/grutil/geoMipTerrain.h b/panda/src/grutil/geoMipTerrain.h index 9b44693fed..ebc55c26d3 100644 --- a/panda/src/grutil/geoMipTerrain.h +++ b/panda/src/grutil/geoMipTerrain.h @@ -1,5 +1,7 @@ // Filename: geoMipTerrain.h // Created by: pro-rsoft (29jun07) +// Modified by: CMU ETC Summer 2010 team (03aug10) (added +// get_flatten_mode(), get_near(), get_far() ). // //////////////////////////////////////////////////////////////////// // @@ -104,7 +106,10 @@ PUBLISHED: INLINE LVecBase2f get_block_from_pos(double x, double y); INLINE void set_border_stitching(bool stitching); INLINE bool get_border_stitching(); - + INLINE double get_far(); + INLINE double get_near(); + INLINE int get_flatten_mode(); + PNMImage make_slope_image(); void generate(); bool update();