26 #include <osg/Referenced> 28 #include <osg/Texture2D> 29 #include <osg/MatrixTransform> 30 #include <osg/Projection> 31 #include <osg/StateSet> 32 #include <osg/PositionAttitudeTransform> 34 #include <osg/Material> 35 #include <osgShadow/ShadowedScene> 36 #include <osgShadow/ShadowTechnique> 37 #include <osg/LightSource> 38 #include <osg/Geometry> 72 SceneDecorator(
int windowSizeX,
int windowSizeY,
int enabledLights = LIGHT0 | LIGHT1 );
75 void setEnableShadows(
bool flag );
78 bool getEnableShadows()
const;
81 void setEnable(
bool flag );
84 bool getEnable()
const;
87 bool isEnabled()
const;
111 void setLogoPosition(
float x,
float y);
114 void setEnableLogo(
bool flag );
117 bool getEnableLogo()
const;
120 bool setLogoFile(
const std::string& filename,
float density = 1.0);
129 void setEnableShaderState(
bool flag,
bool lock=
false );
132 bool getEnableShaderState( )
const;
140 bool setBaseTexture(
const std::string& imagePath);
156 void setMaximumLogoDimension(
float x,
float y);
161 static osg::Vec2 getDefaultLogoPosition();
169 osg::MatrixTransform*
getHud() {
return m_hudRoot.get(); }
172 virtual bool insertChild(
unsigned int index, osg::Node *child ) {
return m_currentRoot->insertChild(index, child); }
173 virtual bool addChild(osg::Node *child) {
return m_currentRoot->addChild(child); }
174 inline bool removeChild( osg::Node *child ) {
return m_currentRoot->removeChild(child); }
175 inline bool removeChild(
unsigned int pos,
unsigned int numChildrenToRemove=1 ) {
return m_currentRoot->removeChild(pos, numChildrenToRemove); }
176 virtual bool replaceChild( osg::Node *origChild, osg::Node* newChild ) {
return m_currentRoot->replaceChild(origChild, newChild); }
177 virtual bool setChild(
unsigned int i, osg::Node* node ) {
return m_currentRoot->setChild(i, node); }
178 virtual bool removeChildren(
unsigned int pos,
unsigned int numChildrenToRemove) {
return m_currentRoot->removeChildren(pos, numChildrenToRemove); }
184 void calculateLightPositions(osg::Node* bound_node =
nullptr);
186 void calculateLightPositions(
const osg::BoundingBox& boundingBox );
188 void calculateLightPositions(
const osg::BoundingSphere& boundingSphere );
191 std::string getFontName()
const;
194 void setFontName(
const std::string& fontName);
197 void updateWindowSize(
int sizeX,
int sizeY);
200 void setScreenPixelScale(
float scale);
203 float getFontSize()
const;
206 void setFontSize(
const float& fontSize);
209 osg::LightSource* getShadowLightSource();
215 ALL = LIGHT0 | LIGHT1 | LIGHT2
219 static size_t lightToIndex(
Lights l);
221 void setEnableCalculateLightPositions(
Lights l,
bool f );
223 bool getEnableCalculateLightPositions(
Lights l)
const;
226 bool setShadowLightSource(
Lights l);
230 osg::LightSource* getOSGLight(
Lights l);
252 void setBackgroundColor(
const agx::Vec4f& color);
272 void setBackgroundColor(
agx::Vec3 color);
294 void setEnableLights(
int lightMask = ALL);
300 void setEnableRenderedCursor(
bool enable );
301 bool getEnableRenderedCursor()
const;
302 void updateCursorPosition(
float x,
float y );
304 osg::Texture2D* getLogo();
307 void setLogo(osg::Texture2D* logo,
float density = 1.0);
315 osg::Group* getShadowedScene()
const;
320 osg::Group* getNonShadowedScene()
const;
322 static const osg::Material* getDefaultDecoratorMaterial();
332 void createBackground();
375 void createDecoratorState();
379 bool m_calculateLightPosition[3];
osg::ref_ptr< osg::Node > m_cursorTransform
virtual bool removeChildren(unsigned int pos, unsigned int numChildrenToRemove)
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API...
osg::ref_ptr< osg::Switch > m_logoSwitch
osg::ref_ptr< osg::Vec3Array > m_backgroundColors
virtual bool insertChild(unsigned int index, osg::Node *child)
virtual bool setChild(unsigned int i, osg::Node *node)
A class holding 4 dimensional vectors and providing basic arithmetic.
osg::MatrixTransform * getHud()
Return a pointer to the hud group.
osg::ref_ptr< osg::Group > m_enabledNonShadowRoot
osg::ref_ptr< osg::PositionAttitudeTransform > m_logoTransform
LogoLocation
Specifies the location of the logo.
Namespace containing classes for handling debug rendering of collision geometries, constraints, contacts and rigid bodies.
Vec2T< Real > Vec2
The object holding 2 dimensional vectors and providing basic arithmetic.
osg::ref_ptr< osg::Switch > m_backgroundRoot
ShadowMethod m_shadowMethod
osg::ref_ptr< osg::LightSource > m_ShadowlightSource
Decorates a scene with a specific AGX Rendering Style.
bool removeChild(unsigned int pos, unsigned int numChildrenToRemove=1)
osg::ref_ptr< osgShadow::ShadowedScene > m_shadowedScene
osg::ref_ptr< osg::StateSet > m_decoratorStateSet
osg::ref_ptr< osgShadow::ShadowTechnique > m_shadowTechnique
bool removeChild(osg::Node *child)
osg::observer_ptr< osg::Geometry > m_backgroundQuad
ShadowMethod getShadowMethod() const
osg::ref_ptr< osg::MatrixTransform > m_hudRoot
float m_maximumLogoDimensionX
agx::Vector< osg::ref_ptr< osg::LightSource > > m_lightSources
static osg::ref_ptr< osg::Material > s_decoratorMaterial
virtual bool replaceChild(osg::Node *origChild, osg::Node *newChild)
bool m_shaderSupportAvailable
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
osg::ref_ptr< osg::Camera > m_hudCamera
osg::ref_ptr< osg::Group > m_currentRoot
osg::ref_ptr< osg::StateSet > m_logoStateSet
osg::ref_ptr< osg::Group > m_disabledRoot
std::string m_baseTexturePath
osg::ref_ptr< osg::Projection > m_hudProjection
osg::ref_ptr< osg::Group > m_disabledNonShadowRoot
osg::ref_ptr< osg::Group > m_enabledRoot
osg::StateSet * getDecoratorStateSet()
virtual bool addChild(osg::Node *child)
LogoLocation m_logoLocation
float m_maximumLogoDimensionY
osg::ref_ptr< osg::Texture2D > m_logoTexture
agx::Vector< osgText::Text * > m_text