23 #ifndef GL_GLEXT_PROTOTYPES 24 #define GL_GLEXT_PROTOTYPES 1 //for glGenBuffers, glBindBuffer, 33 #ifdef HAVE_OSG_VERSION_H 34 #include <osg/Version> 48 #include <mars/utils/misc.h> 54 int resolution,
int depth) {
56 setSupportsDisplayList(
false);
57 setUseDisplayList(
false);
59 int steps = resolution;
61 scaleZ, 1.0/width, 1.0/height, depth,
64 width = height =
scale = 1.0;
103 osg::State& state = *renderInfo.getState();
104 state.disableAllVertexArrays();
105 #if (OPENSCENEGRAPH_MAJOR_VERSION < 3 || ( OPENSCENEGRAPH_MAJOR_VERSION == 3 && OPENSCENEGRAPH_MINOR_VERSION < 5) || ( OPENSCENEGRAPH_MAJOR_VERSION == 3 && OPENSCENEGRAPH_MINOR_VERSION == 5 && OPENSCENEGRAPH_PATCH_VERSION < 9)) 106 osg::ArrayDispatchers& arrayDispatchers = state.getArrayDispatchers();
107 #elif (OPENSCENEGRAPH_MAJOR_VERSION > 3 || (OPENSCENEGRAPH_MAJOR_VERSION == 3 && OPENSCENEGRAPH_MINOR_VERSION > 5) || (OPENSCENEGRAPH_MAJOR_VERSION == 3 && OPENSCENEGRAPH_MINOR_VERSION == 5 && OPENSCENEGRAPH_PATCH_VERSION >= 9)) 108 osg::AttributeDispatchers& arrayDispatchers = state.getAttributeDispatchers();
110 #error Unknown OSG Version 113 arrayDispatchers.reset();
116 state.lazyDisablingOfVertexAttributes();
117 state.applyDisablingOfVertexAttributes();
123 fprintf(stderr,
"MultiResHeightMapRenderer: drawTime: %ld\n", drawTime);
128 double zPos,
double radius) {
133 #if (OPENSCENEGRAPH_MAJOR_VERSION < 3 || ( OPENSCENEGRAPH_MAJOR_VERSION == 3 && OPENSCENEGRAPH_MINOR_VERSION < 4)) 137 #elif (OPENSCENEGRAPH_MAJOR_VERSION > 3 || (OPENSCENEGRAPH_MAJOR_VERSION == 3 && OPENSCENEGRAPH_MINOR_VERSION >= 4)) 142 #error Unknown OSG Version void setCameraPosition(double x, double y)
void setDrawWireframe(bool drawWireframe)
virtual ~VertexBufferTerrain()
MultiResHeightMapRenderer * mrhmr
virtual void drawImplementation(osg::RenderInfo &renderInfo) const
void setCameraPosition(double x, double y)
VertexBufferTerrain(int width, int height, double scaleZ, int resolution, int depth)
void setSelected(bool val)
void collideSphere(double xPos, double yPos, double zPos, double radius)
osg::BoundingBox computeBound() const
void setDrawSolid(bool drawSolid)
long long getTimeDiff(long long start)
returns the time difference between now and a given reference.