AGX Dynamics  2.38.0.2
utils.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 #include <agxOSG/export.h>
20 #include <agx/Vec4.h>
21 
22 #include <agxUtil/agxUtil.h>
23 #include <agxUtil/Statistic.h>
24 #include <agxOSG/Node.h>
28 #include <agxOSG/ScalarColorMap.h>
30 #include <agxRender/Color.h>
31 
32 
33 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
34 #include <osg/observer_ptr>
35 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
36 
37 #include <agx/config/AGX_USE_AGXTERRAIN.h>
38 
39 
40 namespace agx
41 {
42  class RigidBody;
43  class ParticleSystem;
44 
45  class RigidBodyEmitter;
46 }
47 
48 namespace agxSDK
49 {
50  class Simulation;
51 }
52 
53 namespace agxCollide
54 {
55  class Geometry;
56 }
57 
58 namespace agxUtil
59 {
60  class ExponentialMovingAverageStatistic;
61 }
62 
63 namespace agxModel
64 {
65  class FractureGenerator;
66 }
67 
69 
70 
71 namespace osg {
72  class Geometry;
73  class Node;
74  class Texture2D;
75 }
76 
77 namespace osgSim
78 {
79  class ColorRange;
80 }
81 
82 namespace osgText
83 {
84  class Text;
85 }
87 
88 namespace agxOSG
89 {
90  class GeometryNode;
91  class FrameTrajectoryDrawable;
92  class TerrainVoxelRenderer;
93 
95  {
103  };
104 
109  AGXOSG_EXPORT GeometryNode* findGeometryNode( const agxCollide::Geometry* geometry, osg::Group* rootNode );
110 
126  AGXOSG_EXPORT bool setCubeMapTexture(osg::Node *node, const std::string& imagePath, const std::string& imageType = ".dds");
127 
133  AGXOSG_EXPORT void setEnvMapReflectionCoefficient(osg::Node* node, float coeff);
134 
146  AGXOSG_EXPORT bool setTexture(const agxCollide::Geometry* geometry, osg::Group* rootNode, const std::string& imagePath, bool repeat = false, TextureMode mode = DIFFUSE_TEXTURE);
147 
160  const agx::RigidBody* rigidBody, osg::Group* rootNode, const std::string& imagePath,
161  bool repeat = false, TextureMode mode = DIFFUSE_TEXTURE);
162 
174  osg::Node* node, const std::string& imagePath, bool repeat = false, TextureMode mode = DIFFUSE_TEXTURE,
175  float scaleU = 1.0f, float scaleV = 1.0f);
176 
177 
182  AGXOSG_EXPORT osg::Texture2D* createTexture(const std::string& filename);
183 
184 
196  osg::Node *node, osg::Texture2D *texture, bool repeat = false, TextureMode mode = DIFFUSE_TEXTURE,
197  float scaleU = 1.0f, float scaleV = 1.0f);
198 
209  AGXOSG_EXPORT bool setTexture(osg::Node *node, agxOSG::Texture2D *texture, bool repeat = false, TextureMode mode = DIFFUSE_TEXTURE, float scaleU = 1.0f, float scaleV = 1.0f);
210 
211 
222  AGXOSG_EXPORT bool setTexture(agxOSG::GeometryNode *node, agxOSG::Texture2D *texture, bool repeat = false, TextureMode mode = DIFFUSE_TEXTURE, float scaleU = 1.0f, float scaleV = 1.0f);
223 
224  template <typename T>
225  void setUniform( osg::Node *node, const std::string& name, T value)
226  {
227  if ( node == nullptr )
228  return;
229 
230  node->getOrCreateStateSet()->addUniform( new osg::Uniform(name.c_str(), value));
231  }
232 
244  AGXOSG_EXPORT bool addText(const agxCollide::Geometry* geometry,
245  osg::Group* root,
246  const std::string& text,
247  const agx::Vec3& relPosition = agx::Vec3(0, 0, 0),
248  const agx::Vec4f& color = agxRender::Color::Yellow(),
249  agx::Real size=0.2);
250 
259  AGXOSG_EXPORT osg::Geode* createText(const std::string& text,
260  const agx::Vec3& relPosition = agx::Vec3(0,0,0),
261  const agx::Vec4f& color = agxRender::Color::Yellow(),
262  agx::Real size = 0.2);
263 
264 
273  AGXOSG_EXPORT bool removeText(const agxCollide::Geometry* geometry, osg::Group * root, size_t index = 0);
274 
283  AGXOSG_EXPORT osgText::Text* findText( const agxCollide::Geometry* geometry, osg::Group* root, size_t index = 0 );
284 
299  AGXOSG_EXPORT osg::Geometry* createGrid(
300  unsigned int resU,
301  unsigned int resV,
302  const osg::Vec3& origin,
303  const osg::Vec3& endPointX,
304  const osg::Vec3& endPointY,
305  bool wireFrameMode = false);
306 
320  AGXOSG_EXPORT osg::Geode* createGrid(
321  unsigned int resU,
322  unsigned int resV,
323  const agx::Vec3& origin,
324  const agx::Vec3& endPointX,
325  const agx::Vec3& endPointY,
326  osg::Group* root);
327 
328 
347  AGXOSG_EXPORT osg::Geometry* create3DGrid(
348  unsigned int resU,
349  unsigned int resV,
350  unsigned int resW,
351  const osg::Vec3& origin,
352  const osg::Vec3& endPointX,
353  const osg::Vec3& endPointY,
354  const osg::Vec3& endPointZ,
355  float width
356  );
357 
374  AGXOSG_EXPORT osg::Geode* create3DGrid(
375  unsigned int resU,
376  unsigned int resV,
377  unsigned int resW,
378  const agx::Vec3& origin,
379  const agx::Vec3& endPointX,
380  const agx::Vec3& endPointY,
381  const agx::Vec3& endPointZ,
382  float width);
383 
384 
393  AGXOSG_EXPORT osg::Geode* createLine(const agx::Vec3& p1, const agx::Vec3& p2, const agx::Vec4& color, float width);
394 
403  AGXOSG_EXPORT osg::Geode* createPolyline(const agx::Vec3Vector& points, const agx::Vec4& color, float width);
404 
411  AGXOSG_EXPORT osg::MatrixTransform* createAxes(float scale=1, float width=3);
412 
417  AGXOSG_EXPORT osg::MatrixTransform* createAxes(agxCollide::Geometry* geometry, agx::Frame* relativeTransform, osg::Group* root, float scale = 1);
418 
423  AGXOSG_EXPORT osg::MatrixTransform* createAxes(agxCollide::Geometry* geometry, agx::AffineMatrix4x4 relativeTransform, osg::Group* root, float scale = 1);
424 
437  AGXOSG_EXPORT osg::MatrixTransform* createAxes(agx::RigidBody* rb, agx::Frame* relativeTransform, osg::Group* root, float scale = 1.f);
438 
444  AGXOSG_EXPORT osg::MatrixTransform* createAxes(agx::RigidBody* rb, agx::AffineMatrix4x4 relativeTransform, osg::Group* root, float scale = 1.f);
445 
446 
447  AGXOSG_EXPORT osg::MatrixTransform* createAxes(agx::AffineMatrix4x4 relativeTransform, osg::Group* root, float scale = 1.f);
448 
453  AGXOSG_EXPORT bool createAxes( agx::Constraint* constraint, osg::Group* root, float scale = 1.f );
454 
459  AGXOSG_EXPORT void setSpecularColor( osg::Node * node, const agx::Vec4f& color );
460 
464  AGXOSG_EXPORT void setShininess( osg::Node *node, float shininess );
465 
470  AGXOSG_EXPORT void setAmbientColor( osg::Node * node, const agx::Vec4f& color );
471 
475  AGXOSG_EXPORT void setAlpha( osg::Node * node, float alpha );
476 
481  AGXOSG_EXPORT void setDiffuseColor( osg::Node* node, const agx::Vec4f& color, bool override = false );
482 
483 
488  AGXOSG_EXPORT void setDiffuseColor( agx::RigidBody* rb, const agx::Vec4f& color, osg::Group* root );
489 
494  AGXOSG_EXPORT void setDiffuseColor( agxCollide::Geometry* geometry, const agx::Vec4f& color, osg::Group* root );
495 
504  AGXOSG_EXPORT agxOSG::GeometryNode *createVisual( const agxCollide::Geometry* geometry, osg::Group* root, float detailRatio = 1.0f, bool createAxes = false, bool evenIfSensor=true );
505 
510 
512 
514 
515  AGXOSG_EXPORT osg::Group *createVisual( agx::RigidBodyEmitter* emitter, osg::Group* root);
516 
517  AGXOSG_EXPORT osg::Group *createVisual(agx::Emitter* emitter, osg::Group* root);
518 
519 #if AGX_USE_AGXTERRAIN()
520 
535 #endif
536 
540  AGXOSG_EXPORT osg::MatrixTransform *createVisual(agx::ObserverFrame *frame, osg::Group* root, float scale = 1);
541 
542 
546  AGXOSG_EXPORT osg::Geode *createParticleContactGraph(agx::ParticleSystem* particleSystem, osg::Group* root, agx::Real minForce, agx::Real maxForce);
547 
553  AGXOSG_EXPORT osg::Geode *createParticleTrajectoriesVisual(agx::ParticleSystem* particleSystem, osg::Group* root, agx::Real sampling, agx::UInt numPositions);
554 
560  AGXOSG_EXPORT osg::Geode *createRigidBodyTrajectoriesVisual(agxSDK::Simulation * simulation, osg::Group* root, agx::Real sampling, agx::UInt numPositions, ScalarColorMap* scalarColorMap = nullptr );
561 
562  AGXOSG_EXPORT osg::Geode *createFrameTrajectoryDrawable(agxSDK::Simulation * simulation, osg::Group* root, agx::UInt numPositions, const agx::Vec4f& defaultColor = agx::Vec4f(0.5, 0.5, 0.5, 1.0));
563 
565 
569  AGXOSG_EXPORT osg::Group *createVisual( agx::RigidBody* rb, osg::Group* root, float detailRatio = 1.0f, bool createAxes = false );
570 
576  AGXOSG_EXPORT std::tuple<osg::Group*, std::vector<size_t>> createVisualWithGeometryConnection(agx::RigidBody* rb, osg::Group* root, float detailRatio = 1.0f, bool createAxes = false);
577 
581  AGXOSG_EXPORT osg::Group *createVisual( agxSDK::Assembly *parent, osg::Group* root, float detailRatio = 1.0f, bool createAxes = false );
582 
586  AGXOSG_EXPORT osg::Group* createVisualTemplateCaching( agxSDK::Assembly* parent, osg::Group* root, agxOSG::RigidBodyRenderCache* cache = nullptr, float detailRatio = 1.0f, bool createAxes = false );
587 
595 
599  AGXOSG_EXPORT osg::Group *createVisual(agxSDK::Simulation *simulation, osg::Group* root, float detailRatio = 1.0f, bool createAxes = false);
600 
601  AGXOSG_EXPORT bool setEnableOutline(osg::Node *node, bool enabled, const agxRender::Color& color=agxRender::Color(1,1,0,1), float width = 2.0);
602  AGXOSG_EXPORT bool getEnableOutline(osg::Node *node);
603 
604 
605 
606  AGXOSG_EXPORT void setEnableLight( bool enable, int lightNum, osg::Node* node );
607 
617  AGXOSG_EXPORT void getNearFarPoints(const osg::Camera* camera, float x, float y, agx::Vec3& near, agx::Vec3& far);
618 
627  AGXOSG_EXPORT agxCollide::LocalGeometryContact getHoveredGeometryContact(const osg::Camera * camera, agxCollide::Space * space, float x, float y);
628 
629  AGXOSG_EXPORT bool setEnableWireFrameMode(osg::Node* node, bool flag);
630 
631  AGXOSG_EXPORT bool forceWireFrameModeOn( osg::Node* node );
632 
633  AGXOSG_EXPORT bool toggleWireFrameMode(osg::Node* node);
634 
635  AGXOSG_EXPORT bool setOrbitCamera(osgViewer::Viewer* viewer,
636  osg::Group* node,
637  const agx::Vec3& eye,
638  const agx::Vec3& center,
639  const agx::Vec3& up,
640  int trackerMode);
641 
642 
643 
647  AGXOSG_EXPORT bool loadCubeMapImages(const std::string& imagename, const std::string& filetype, agx::Vector<osg::ref_ptr<osg::Image> >& images);
648 
652  AGXOSG_EXPORT osg::TextureCubeMap * createTextureCubeMap(agx::Vector<osg::ref_ptr<osg::Image> >& images);
653  AGXOSG_EXPORT osg::TextureCubeMap * createTextureCubeMap(const std::string& imagename, const std::string& filetype);
654 
658  AGXOSG_EXPORT void addRenderColorCallbackToFracture( agxModel::FractureGenerator * listener, osg::Group * root, const agx::Vec4f& color );
659 
665 
671 
672 }
agxOSG::setAmbientColor
AGXOSG_EXPORT void setAmbientColor(osg::Node *node, const agx::Vec4f &color)
Set the ambient part of a material for a node.
agx::UInt
uint64_t UInt
Definition: Integer.h:27
agxOSG::addRenderColorCallbackToFracture
AGXOSG_EXPORT void addRenderColorCallbackToFracture(agxModel::FractureGenerator *listener, osg::Group *root, const agx::Vec4f &color)
Adds createVisual callback to a FractureGenerator when new fragments are created that sets a specific...
agxOSG::createParticleTrajectoriesVisual
AGXOSG_EXPORT osg::Geode * createParticleTrajectoriesVisual(agx::ParticleSystem *particleSystem, osg::Group *root, agx::Real sampling, agx::UInt numPositions)
Creates a visual of the particle position trajectories.
agx::Real
double Real
Definition: Real.h:42
agxModel
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:36
agxOSG::createGrid
AGXOSG_EXPORT osg::Geode * createGrid(unsigned int resU, unsigned int resV, const agx::Vec3 &origin, const agx::Vec3 &endPointX, const agx::Vec3 &endPointY, osg::Group *root)
Create a uniform grid and adds it to a root.
Statistic.h
agxOSG::DIFFUSE_TEXTURE
@ DIFFUSE_TEXTURE
Definition: utils.h:96
agx::Vector
Templated vector class.
Definition: Vector.h:52
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:51
agxCollide::LocalGeometryContact
Definition: LocalContactPoint.h:209
agxOSG::createVisualUpdater
AGXOSG_EXPORT agxSDK::EventListener * createVisualUpdater(agxSDK::EventListener *listener, osg::Group *root)
Given some specific classes inheriting from EventListener, this function can handle custom visual rep...
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
agxOSG::ParticleSystemDrawable::ParticleShaderMode
ParticleShaderMode
Definition: ParticleSystemDrawable.h:56
agxSDK::EventListener
An EventListener can be associated to a Simulation and triggered upon various events.
Definition: EventListener.h:40
agxOSG::createText
AGXOSG_EXPORT osg::Geode * createText(const std::string &text, const agx::Vec3 &relPosition=agx::Vec3(0, 0, 0), const agx::Vec4f &color=agxRender::Color::Yellow(), agx::Real size=0.2)
Create a text object.
agx::AffineMatrix4x4T< Real >
agxOSG::SHADOW_JITTER_TEXTURE
@ SHADOW_JITTER_TEXTURE
Definition: utils.h:98
DEFAULT_PARTICLE_RENDERING_MODE
#define DEFAULT_PARTICLE_RENDERING_MODE
Definition: ParticleSystemDrawable.h:38
agxOSG::SPHEREMAP_TEXTURE
@ SPHEREMAP_TEXTURE
Definition: utils.h:102
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
agxOSG::create3DGrid
AGXOSG_EXPORT osg::Geode * create3DGrid(unsigned int resU, unsigned int resV, unsigned int resW, const agx::Vec3 &origin, const agx::Vec3 &endPointX, const agx::Vec3 &endPointY, const agx::Vec3 &endPointZ, float width)
Create a uniform grid and adds it to a root.
ScalarColorMap.h
agx::Vec4T
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:34
agxOSG::createTexture
AGXOSG_EXPORT osg::Texture2D * createTexture(const std::string &filename)
Create a Texture2D object that can be assigned to nodes.
Node.h
agxOSG::SPECULARMAP_TEXTURE
@ SPECULARMAP_TEXTURE
Definition: utils.h:101
agx::VectorPOD< Vec3 >
agxOSG::createTextureCubeMap
AGXOSG_EXPORT osg::TextureCubeMap * createTextureCubeMap(agx::Vector< osg::ref_ptr< osg::Image > > &images)
Internal functions for creating texture cube maps.
agxOSG::getEnableOutline
AGXOSG_EXPORT bool getEnableOutline(osg::Node *node)
agxOSG::TextureMode
TextureMode
Definition: utils.h:94
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
Vec4.h
agxOSG::addText
AGXOSG_EXPORT bool addText(const agxCollide::Geometry *geometry, osg::Group *root, const std::string &text, const agx::Vec3 &relPosition=agx::Vec3(0, 0, 0), const agx::Vec4f &color=agxRender::Color::Yellow(), agx::Real size=0.2)
Add text relative to an geometry.
agxOSG::setSpecularColor
AGXOSG_EXPORT void setSpecularColor(osg::Node *node, const agx::Vec4f &color)
Set the specular part of a material for a node.
agxOSG::setEnableLight
AGXOSG_EXPORT void setEnableLight(bool enable, int lightNum, osg::Node *node)
agxOSG::setDiffuseColor
AGXOSG_EXPORT void setDiffuseColor(agxCollide::Geometry *geometry, const agx::Vec4f &color, osg::Group *root)
Set the diffuse part of a material for a geometry.
agxSDK::Assembly
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Definition: Assembly.h:67
agxOSG::createVisualTemplateCaching
AGXOSG_EXPORT osg::Group * createVisualTemplateCaching(agxSDK::Assembly *parent, osg::Group *root, agxOSG::RigidBodyRenderCache *cache=nullptr, float detailRatio=1.0f, bool createAxes=false)
Given an Assembly, this function creates visual representation of all the geometries.
agxRender::Color
Utility color class with "common colors".
Definition: Color.h:33
agxOSG::createTrimesh
AGXOSG_EXPORT agxCollide::Trimesh * createTrimesh(osg::Node *node)
Extracts mesh data from an osg::Node, creates an agxCollide::Trimesh from it and returns the result.
agx::ObserverFrame
With this class you can attach an ObserverFrame object relative to a RigidBody.
Definition: ObserverFrame.h:41
agx::ParticleSystem
A basic particle system that contains all the storages and buffers required for basic operation and a...
Definition: ParticleSystem.h:67
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:125
agxOSG::NORMALMAP_TEXTURE
@ NORMALMAP_TEXTURE
Definition: utils.h:99
agxOSG::toggleWireFrameMode
AGXOSG_EXPORT bool toggleWireFrameMode(osg::Node *node)
agxOSG::setEnableWireFrameMode
AGXOSG_EXPORT bool setEnableWireFrameMode(osg::Node *node, bool flag)
agx::Vec3
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
Definition: Vec3.h:36
agxOSG
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
agxModel::FractureGenerator
Definition: FractureGenerator.h:74
PushDisableWarnings.h
agxOSG::RigidBodySystemDrawable
Definition: RigidBodySystemDrawable.h:36
agxOSG::setUniform
void setUniform(osg::Node *node, const std::string &name, T value)
Definition: utils.h:225
agxOSG::ParticleSystemDrawable
Definition: ParticleSystemDrawable.h:44
agxOSG::createFrameTrajectoryDrawable
AGXOSG_EXPORT osg::Geode * createFrameTrajectoryDrawable(agxSDK::Simulation *simulation, osg::Group *root, agx::UInt numPositions, const agx::Vec4f &defaultColor=agx::Vec4f(0.5, 0.5, 0.5, 1.0))
GuiEventListener.h
agxOSG::setAlpha
AGXOSG_EXPORT void setAlpha(osg::Node *node, float alpha)
Set the alpha part of the material for a node.
RigidBodySystemDrawable.h
agxCollide::Geometry
The geometry representation used by the collision detection engine.
Definition: Geometry.h:91
agxOSG::setEnvMapReflectionCoefficient
AGXOSG_EXPORT void setEnvMapReflectionCoefficient(osg::Node *node, float coeff)
Specifies the amount of reflection that should be used (if CubeMap or SphereMap is assigned to the no...
agxOSG::createPolyline
AGXOSG_EXPORT osg::Geode * createPolyline(const agx::Vec3Vector &points, const agx::Vec4 &color, float width)
Create and return a new Polyine to render.
agxOSG::ParticleSystemDrawable::ParticleRenderingMode
ParticleRenderingMode
Definition: ParticleSystemDrawable.h:47
agxOSG::findGeometryNode
AGXOSG_EXPORT GeometryNode * findGeometryNode(const agxCollide::Geometry *geometry, osg::Group *rootNode)
Finds the geometry node associated to a geometry.
agxCollide::Space
This class contains all Geometries and performs Broad Phase and Narrow Phase collision detection to c...
Definition: Space.h:81
agxOSG::setCubeMapTexture
AGXOSG_EXPORT bool setCubeMapTexture(osg::Node *node, const std::string &imagePath, const std::string &imageType=".dds")
Assigns a Cubemap texture to the specified node.
agxOSG::setEnableOutline
AGXOSG_EXPORT bool setEnableOutline(osg::Node *node, bool enabled, const agxRender::Color &color=agxRender::Color(1, 1, 0, 1), float width=2.0)
agx::root
AGXCORE_EXPORT Component * root()
agx::RigidBodyEmitter
Spawns new Rigid Bodies inside a volume given to the Emitter.
Definition: RigidBodyEmitter.h:43
agxOSG::HEIGHTMAP_TEXTURE
@ HEIGHTMAP_TEXTURE
Definition: utils.h:100
agxOSG::createVisual
AGXOSG_EXPORT osg::Group * createVisual(agxSDK::Simulation *simulation, osg::Group *root, float detailRatio=1.0f, bool createAxes=false)
Given a simulation, this function creates visual representation of all the contents in the simulation...
agxOSG::setShininess
AGXOSG_EXPORT void setShininess(osg::Node *node, float shininess)
Set the shininess exponent for the Phong specular model.
agxOSG::RigidBodyRenderCache
RigidBodyRenderCache is used to cache generated visuals and lookup mappings of RigidBodies cloned fro...
Definition: RigidBodyRenderCache.h:36
agxSDK::TerrainInstance
agxTerrain::Terrain instance in a simulation, receiving step and contact callbacks in a controllable ...
Definition: TerrainInstance.h:43
agxOSG::Texture2D
Definition: agxOSG/Node.h:35
agxCollide
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Definition: ContactForceFilterParticipant.h:22
agxOSG::setOrbitCamera
AGXOSG_EXPORT bool setOrbitCamera(osgViewer::Viewer *viewer, osg::Group *node, const agx::Vec3 &eye, const agx::Vec3 &center, const agx::Vec3 &up, int trackerMode)
agxOSG::SHADOW_TEXTURE
@ SHADOW_TEXTURE
Definition: utils.h:97
agxOSG::findFrameTrajectoryDrawable
AGXOSG_EXPORT agxOSG::FrameTrajectoryDrawable * findFrameTrajectoryDrawable(osg::Group *root)
agx::Constraint
The base class for a constraint.
Definition: Constraint.h:88
RigidBodyRenderCache.h
agxOSG::getNearFarPoints
AGXOSG_EXPORT void getNearFarPoints(const osg::Camera *camera, float x, float y, agx::Vec3 &near, agx::Vec3 &far)
Get the near and far points of the current window, given a camera and x and y position.
export.h
agxOSG::removeText
AGXOSG_EXPORT bool removeText(const agxCollide::Geometry *geometry, osg::Group *root, size_t index=0)
Remove text from a geometry.
agxOSG::TerrainVoxelRenderer
Rendering class for the agxTerrain::Terrain.
Definition: TerrainVoxelRenderer.h:46
agxOSG::findText
AGXOSG_EXPORT osgText::Text * findText(const agxCollide::Geometry *geometry, osg::Group *root, size_t index=0)
Finds a text object already added to the geometry (so the text can be changed).
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
Color.h
agxOSG::setTexture
AGXOSG_EXPORT bool setTexture(agxOSG::GeometryNode *node, agxOSG::Texture2D *texture, bool repeat=false, TextureMode mode=DIFFUSE_TEXTURE, float scaleU=1.0f, float scaleV=1.0f)
Apply a 2D Texture to the specified node in OVERRIDE|PROTECTED mode.
agx::Vec3T< Real >
agxCollide::Trimesh
Triangle mesh for geometric intersection tests.
Definition: Trimesh.h:42
agxOSG::GeometryNode
A node that can be associated with a collision geometry so that the transformation of this node is up...
Definition: GeometryNode.h:41
agxOSG::createVisualWithGeometryConnection
AGXOSG_EXPORT std::tuple< osg::Group *, std::vector< size_t > > createVisualWithGeometryConnection(agx::RigidBody *rb, osg::Group *root, float detailRatio=1.0f, bool createAxes=false)
Given a rigid body, this function creates visual representation of all the geometries.
agxOSG::getHoveredGeometryContact
AGXOSG_EXPORT agxCollide::LocalGeometryContact getHoveredGeometryContact(const osg::Camera *camera, agxCollide::Space *space, float x, float y)
Get a geometry contact given the current camera and a position in the camera window.
agxOSG::addRenderCallbackToFracture
AGXOSG_EXPORT void addRenderCallbackToFracture(agxModel::FractureGenerator *listener, osg::Group *root)
Adds default createVisual callback to a FractureGenerator when new fragments are created that copies ...
agxRender::Color::Yellow
static agxRender::Color Yellow()
Definition: Color.h:193
ParticleSystemDrawable.h
agx::Frame
The object defining a frame of reference and providing transformations operations.
Definition: Frame.h:67
agxOSG::loadCubeMapImages
AGXOSG_EXPORT bool loadCubeMapImages(const std::string &imagename, const std::string &filetype, agx::Vector< osg::ref_ptr< osg::Image > > &images)
Internal function to load images into an array.
agx::Emitter
Spawns new bodys inside a given volume.
Definition: Emitter.h:44
agxOSG::ParticleSystemDrawable::ROTATION_SPRITES
@ ROTATION_SPRITES
Definition: ParticleSystemDrawable.h:59
agxUtil
The agxUtil namespace contain classes and methods for utility functionality.
Definition: CylindricalJoint.h:20
agxOSG::createLine
AGXOSG_EXPORT osg::Geode * createLine(const agx::Vec3 &p1, const agx::Vec3 &p2, const agx::Vec4 &color, float width)
Create and return a new Line to render.
agxOSG::createAxes
AGXOSG_EXPORT bool createAxes(agx::Constraint *constraint, osg::Group *root, float scale=1.f)
Create axes at the constraint attachments.
agxOSG::findParticleSystemDrawable
AGXOSG_EXPORT agxOSG::ParticleSystemDrawable * findParticleSystemDrawable(osg::Group *root)
agxOSG::findRigidBodySystemDrawable
AGXOSG_EXPORT agxOSG::RigidBodySystemDrawable * findRigidBodySystemDrawable(osg::Group *root)
agxOSG::forceWireFrameModeOn
AGXOSG_EXPORT bool forceWireFrameModeOn(osg::Node *node)
AGXOSG_EXPORT
#define AGXOSG_EXPORT
agxOSG::createRigidBodyTrajectoriesVisual
AGXOSG_EXPORT osg::Geode * createRigidBodyTrajectoriesVisual(agxSDK::Simulation *simulation, osg::Group *root, agx::Real sampling, agx::UInt numPositions, ScalarColorMap *scalarColorMap=nullptr)
Creates a visual of the rigid body position trajectories.
agxUtil.h
PopDisableWarnings.h
agxOSG::FrameTrajectoryDrawable
Definition: FrameTrajectoryDrawable.h:34
agxOSG::createParticleContactGraph
AGXOSG_EXPORT osg::Geode * createParticleContactGraph(agx::ParticleSystem *particleSystem, osg::Group *root, agx::Real minForce, agx::Real maxForce)
Creates a visual of the particle contact network, which colors contacts depending on contact force.