AGX Dynamics  2.35.0.1
agxOSG/HeightField.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 
20 #include <agxOSG/Node.h>
21 
22 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
23 #include <osg/Drawable>
24 #include <osgViewer/Viewer>
25 #include <osgSim/ColorRange>
26 #include <osgSim/ScalarsToColors>
27 #include <osg/Version>
28 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
29 #include <agxCollide/HeightField.h>
30 
31 namespace agxOSG
32 {
34 
39  class AGXOSG_EXPORT HeightField : public osg::Geode
40  {
41 
42  public:
48  HeightField( const agxCollide::HeightField* heightField);
49 
54 
55 
56  osg::Geometry *getGeometry();
57  const osg::Geometry *getGeometry() const ;
58 
59 
60  protected:
61  bool createVisual(const agxCollide::HeightField *heightField);
62  virtual void traverse(osg::NodeVisitor& nv);
63 
64  virtual ~HeightField();
65 
66  protected:
68  osg::ref_ptr<osg::Geometry> m_geometry;
69  osg::StateSet* m_stateSet;
71  };
72 }
73 
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGXOSG_EXPORT
A HeightField is a collision shape that can be created from a grid structure, like an image.
Rendering class for the agxCollide::HeightField The visual representation will be updated if the Heig...
agxCollide::HeightFieldConstObserver m_heightField
osg::StateSet * m_stateSet
virtual void traverse(osg::NodeVisitor &nv)
osg::ref_ptr< osg::Geometry > m_geometry
osg::Geometry * getGeometry()
HeightField(const agxCollide::HeightField *heightField)
Construct a renderable height field from the specified collision HeightField.
bool createVisual(const agxCollide::HeightField *heightField)
virtual ~HeightField()
const agxCollide::HeightField * getHeightField() const
const osg::Geometry * getGeometry() const
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
uint32_t UInt32
Definition: Integer.h:40