SmallChange
1.0.0
A collection of extensions to Coin3D
|
The SmScenery class is a Coin node interface to the SIM Scenery library. More...
#include <SmallChange/nodes/SmScenery.h>
Public Types | |
enum | ColorTexturing { DISABLED , INTERPOLATED , DISCRETE } |
Public Member Functions | |
int | addElevationDataset (const char *name) |
int | addMaterialDataset (const char *name, uint32_t color) |
int | addTextureDataset (int elevationdataset, const char *name, SmSceneryTexture2CB *cb, void *closure) |
void | changeDatasetProximity (int datasetid, int numdatasets, int *datasets, float epsilon, float newval) |
void | cullDatasetAbove (int datasetid, int numdatasets, int *datasets, float distance) |
void | cullDatasetBelow (int datasetid, int numdatasets, int *datasets, float distance) |
int | deleteElevationDataset (int datasetid) |
float | getBlockRottger (void) const |
SbVec2f | getDatasetElevationRange (int dataset) const |
SbBool | getElevation (const double x, const double y, float &elev) |
SbVec2f | getElevationRange (void) const |
float | getLoadRottger (void) const |
SbVec3f | getRenderCoordinateOffset (void) const |
void * | getScenerySystemHandle () |
void | getSpacingForLodlevel (int lodlevel, double *spacing) const |
float | getUndefElevationValue (void) const |
SbBool | getVertexArraysRendering (void) const |
virtual void | GLRender (SoGLRenderAction *action) |
void | oversampleDataset (int datasetid) |
int | postFrame (uint32_t glcontextid) |
void | preFrame (uint32_t glcontextid) |
virtual void | rayPick (SoRayPickAction *action) |
void | refreshTextures (const int id) |
void | set2DColorationTextureCB (SmSceneryTexture2CB *callback, void *closure) |
void | setBlockRottger (const float c) |
void | setCrossAndLineElevationData (int datasetid, int lodlevel, int startcross, int startline, int numcross, int numline, float *elevationvalues) |
void | setLoadRottger (const float c) |
void | setVertexArraysRendering (const SbBool onoff) |
void | smoothDataset (int datasetid) |
void | stripHorizontals (int datasetid, float maxskew) |
void | stripVerticals (int datasetid, float dropsize) |
Static Public Member Functions | |
static uint32_t | colortexture_cb (void *node, double *xypos, float elevation, double *spacing) |
static SmScenery * | createCrossAndLineInstance (double *min, double *spacing, int *elements) |
static SmScenery * | createInstance (const int cols, const int rows, double *xyzgrid, const float undefz=999999.0f) |
static SmScenery * | createInstance (const int points, double *xyzvals, const float reach=-1.0f) |
static SmScenery * | createInstance (double *origo, double *spacing, int *elements, float *values, const float undefval=999999.0f) |
static SoCallbackAction::Response | evaluateS (void *userdata, SoCallbackAction *action, const SoNode *node) |
static void | initClass (void) |
Public Attributes | |
SoSFFloat | blockRottger |
The rottger factor for tessellating the surface of a terrain block. | |
SoMFFloat | colorElevation |
A table of elevation values, which will decide where the colors given in colorMap will kick in. | |
SoMFFloat | colorMap |
A table of colors to use for coloring the terrain, starting with the color of the lowest elevations, going upwards. | |
SoSFEnum | colorTexturing |
Decides whether or not the values of colorMap and colorElevation (optional) should be used to generate a texture for the terrain. | |
SoSFFloat | elevationLineDistance |
The elevation distance between elevation lines. | |
SoSFShort | elevationLineEmphasis |
Emphasize every Nth elevation line. | |
SoSFFloat | elevationLineOffset |
Offset the elevation lines with this value. | |
SoSFBool | elevationLines |
Whether or not the elevation lines feature should be used. | |
SoSFFloat | elevationLineThickness |
Make elevation lines this thick. | |
SoSFString | filename |
The filename for a SIM Scenery database. | |
SoSFFloat | loadRottger |
The rottger formula constant for deciding the LOD level of blocks as you remove yourself from the focus points. | |
SoMFInt32 | renderSequence |
The description of how datasets in the SIM Scenery database should be merged before being rendered. | |
SoSFBool | visualDebug |
Show information designed for debugging purposes on the viewport. | |
Protected Member Functions | |
virtual void | computeBBox (SoAction *action, SbBox3f &box, SbVec3f ¢er) |
virtual void | evaluate (SoAction *action) |
virtual void | generatePrimitives (SoAction *action) |
The SmScenery class is a Coin node interface to the SIM Scenery library.
SbBool SmScenery::getVertexArraysRendering | ( | void | ) | const |
Returns whether vertex array rendering is used.
Sets whether vertex array rendering should be used (still a bit slower, but works on ATI cards). Probably faster on OS X.
SmSFFloat SmScenery::blockRottger |
The rottger factor for tessellating the surface of a terrain block.
If the terrain is textured with a light-based texture, you can keep this fairly low (16-32) and still have excellent visual results. If you on the other hand depend on normals for shading the terrain, you may need to use a high value (64->)
SoMFFloat SmScenery::colorElevation |
A table of elevation values, which will decide where the colors given in colorMap will kick in.
If empty, colors will be interpolated evenly over the full range of the terrain.
If used, the number of values must correspond to the number of colors in the colorMap field, or coloration will be ignored all together. For TRUE / INTERPOLATED, the number of elevation values will have to be equal to the number of colors - elevation values outside the given range of elevation values will just use the colosest color value. For DISCRETE, the number of elevation values has to be one less than the number of colors.
SoMFFloat SmScenery::colorMap |
A table of colors to use for coloring the terrain, starting with the color of the lowest elevations, going upwards.
The colorization values should range from 0.0 to 1.0, and are given in the red, green, blue, and alpha component order. The alpha component is currently ignored. To avoid surprises if it is ever turned on in the future, you should always use 1.0 for the alpha component.
Going outside the 0.0 - 1.0 range is possible, and won't lead to anything other than that values will be used as is during color interpolation, but clamped to a value within the 0.0 - 1.0 range before being used to colorize the texture. You can probably abuse this information to achieve some effect or other, although we won't guarantee this behaviour to stay unchanged.
SoSFEnum SmScenery::colorTexturing |
Decides whether or not the values of colorMap and colorElevation (optional) should be used to generate a texture for the terrain.
The value DISABLED (default) is for not rendering with a color texture. The value INTERPOLATED is for rendering with a texture that has interpolated colors. The value DISCRETE will give you uniform colors with discrete, hard edges between the color changes.
SoSFFloat SmScenery::elevationLineDistance |
The elevation distance between elevation lines.
The math is not correct for this feature yet.
SoSFShort SmScenery::elevationLineEmphasis |
Emphasize every Nth elevation line.
Not implemented yet.
SoSFFloat SmScenery::elevationLineOffset |
Offset the elevation lines with this value.
The math is not correct for this feature yet.
SoSFFloat SmScenery::elevationLineThickness |
Make elevation lines this thick.
The math is not correct for this feature yet.
SoSFFloat SmScenery::loadRottger |
The rottger formula constant for deciding the LOD level of blocks as you remove yourself from the focus points.
Don't use a high value for this parameter unless you know what you are doing.
SoMFInt32 SmScenery::renderSequence |
The description of how datasets in the SIM Scenery database should be merged before being rendered.
Not really supported yet, but you can currently control which one terrain dataset will be rendered with which one texture dataset in the SIM Scnery database with it, which is kind of a subset of the functionality we aim to implement with this field.