AGXDynamics  2.31.1.0
utils.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. 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 #ifndef AGXOSG_UTILS_H
18 #define AGXOSG_UTILS_H
19 
20 #include <agxOSG/export.h>
21 #include <agx/Vec4.h>
22 
23 #include <agxUtil/agxUtil.h>
24 #include <agxUtil/Statistic.h>
25 #include <agxOSG/Node.h>
27 #include <agxOSG/ScalarColorMap.h>
29 #include <agxRender/Color.h>
30 
31 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
32 #include <osg/observer_ptr>
33 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
34 
35 namespace agx
36 {
37  class RigidBody;
38  class ParticleSystem;
39 
40  class RigidBodyEmitter;
41 }
42 
43 namespace agxSDK
44 {
45  class Simulation;
46 }
47 
48 namespace agxCollide
49 {
50  class Geometry;
51 }
52 
53 namespace agxUtil
54 {
55  class ExponentialMovingAverageStatistic;
56 }
57 
58 namespace agxModel
59 {
60  class FractureGenerator;
61 }
62 
64 
65 
66 namespace osg {
67  class Geometry;
68  class Node;
69  class Texture2D;
70 }
71 
72 namespace osgSim
73 {
74  class ColorRange;
75 }
76 
77 namespace osgText
78 {
79  class Text;
80 }
82 
83 namespace agxOSG
84 {
85  class GeometryNode;
86  class FrameTrajectoryDrawable;
87 
89  {
97  };
98 
103  AGXOSG_EXPORT GeometryNode* findGeometryNode( const agxCollide::Geometry* geometry, osg::Group* rootNode );
104 
120  AGXOSG_EXPORT bool setCubeMapTexture(osg::Node *node, const std::string& imagePath, const std::string& imageType = ".dds");
121 
127  AGXOSG_EXPORT void setEnvMapReflectionCoefficient(osg::Node* node, float coeff);
128 
140  AGXOSG_EXPORT bool setTexture(const agxCollide::Geometry* geometry, osg::Group* rootNode, const std::string& imagePath, bool repeat = false, TextureMode mode = DIFFUSE_TEXTURE);
141 
154  const agx::RigidBody* rigidBody, osg::Group* rootNode, const std::string& imagePath,
155  bool repeat = false, TextureMode mode = DIFFUSE_TEXTURE);
156 
168  osg::Node* node, const std::string& imagePath, bool repeat = false, TextureMode mode = DIFFUSE_TEXTURE,
169  float scaleU = 1.0f, float scaleV = 1.0f);
170 
171 
176  AGXOSG_EXPORT osg::Texture2D* createTexture(const std::string& filename);
177 
178 
190  osg::Node *node, osg::Texture2D *texture, bool repeat = false, TextureMode mode = DIFFUSE_TEXTURE,
191  float scaleU = 1.0f, float scaleV = 1.0f);
192 
203  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);
204 
205 
216  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);
217 
218  template <typename T>
219  void setUniform( osg::Node *node, const std::string& name, T value)
220  {
221  if ( node == nullptr )
222  return;
223 
224  node->getOrCreateStateSet()->addUniform( new osg::Uniform(name.c_str(), value));
225  }
226 
238  AGXOSG_EXPORT bool addText(const agxCollide::Geometry* geometry,
239  osg::Group* root,
240  const std::string& text,
241  const agx::Vec3& relPosition = agx::Vec3(0, 0, 0),
242  const agx::Vec4f& color = agxRender::Color::Yellow(),
243  agx::Real size=0.2);
244 
253  AGXOSG_EXPORT osg::Geode* createText(const std::string& text,
254  const agx::Vec3& relPosition = agx::Vec3(0,0,0),
255  const agx::Vec4f& color = agxRender::Color::Yellow(),
256  agx::Real size = 0.2);
257 
258 
267  AGXOSG_EXPORT bool removeText(const agxCollide::Geometry* geometry, osg::Group * root, size_t index = 0);
268 
277  AGXOSG_EXPORT osgText::Text* findText( const agxCollide::Geometry* geometry, osg::Group* root, size_t index = 0 );
278 
293  AGXOSG_EXPORT osg::Geometry* createGrid(
294  unsigned int resU,
295  unsigned int resV,
296  const osg::Vec3& origin,
297  const osg::Vec3& endPointX,
298  const osg::Vec3& endPointY,
299  bool wireFrameMode = false);
300 
314  AGXOSG_EXPORT osg::Geode* createGrid(
315  unsigned int resU,
316  unsigned int resV,
317  const agx::Vec3& origin,
318  const agx::Vec3& endPointX,
319  const agx::Vec3& endPointY,
320  osg::Group* root);
321 
326  AGXOSG_EXPORT osg::MatrixTransform* createAxes(agxCollide::Geometry* geometry, agx::Frame* relativeTransform, osg::Group* root, float scale = 1, const agx::Vec4f& color = agx::Vec4f());
327  AGXOSG_EXPORT osg::MatrixTransform* createAxes(agxCollide::Geometry* geometry, agx::AffineMatrix4x4 relativeTransform, osg::Group* root, float scale = 1, const agx::Vec4f& color = agx::Vec4f());
328 
333  AGXOSG_EXPORT osg::MatrixTransform* createAxes(agx::RigidBody* rb, agx::Frame* relativeTransform, osg::Group* root, float scale = 1.f, const agx::Vec4f& color = agx::Vec4f());
334  AGXOSG_EXPORT osg::MatrixTransform* createAxes(agx::RigidBody* rb, agx::AffineMatrix4x4 relativeTransform, osg::Group* root, float scale = 1.f, const agx::Vec4f& color = agx::Vec4f());
335 
336 
337  AGXOSG_EXPORT osg::MatrixTransform* createAxes(agx::AffineMatrix4x4 relativeTransform, osg::Group* root, float scale = 1.f, const agx::Vec4f& color = agx::Vec4f());
338 
342  AGXOSG_EXPORT void createAxes( agx::Constraint* constraint, osg::Group* root, float scale = 1.f, const agx::Vec4f& color = agx::Vec4f() );
343 
348  AGXOSG_EXPORT void setSpecularColor( osg::Node * node, const agx::Vec4f& color );
349 
353  AGXOSG_EXPORT void setShininess( osg::Node *node, float shininess );
354 
359  AGXOSG_EXPORT void setAmbientColor( osg::Node * node, const agx::Vec4f& color );
360 
364  AGXOSG_EXPORT void setAlpha( osg::Node * node, float alpha );
365 
370  AGXOSG_EXPORT void setDiffuseColor( osg::Node * node, const agx::Vec4f& color );
371 
372 
377  AGXOSG_EXPORT void setDiffuseColor( agx::RigidBody* rb, const agx::Vec4f& color, osg::Group* root );
378 
383  AGXOSG_EXPORT void setDiffuseColor( agxCollide::Geometry* geometry, const agx::Vec4f& color, osg::Group* root );
384 
393  AGXOSG_EXPORT agxOSG::GeometryNode *createVisual( const agxCollide::Geometry* geometry, osg::Group* root, float detailRatio = 1.0f, bool createAxes = false, bool evenIfSensor=true );
394 
399 
401 
402  AGXOSG_EXPORT osg::Group *createVisual( agx::RigidBodyEmitter* emitter, osg::Group* root);
403 
404  AGXOSG_EXPORT osg::Group *createVisual(agx::Emitter* emitter, osg::Group* root);
405 
409  AGXOSG_EXPORT osg::MatrixTransform *createVisual(agx::ObserverFrame *frame, osg::Group* root, float scale = 1);
410 
411 
415  AGXOSG_EXPORT osg::Geode *createParticleContactGraph(agx::ParticleSystem* particleSystem, osg::Group* root, agx::Real minForce, agx::Real maxForce);
416 
422  AGXOSG_EXPORT osg::Geode *createParticleTrajectoriesVisual(agx::ParticleSystem* particleSystem, osg::Group* root, agx::Real sampling, agx::UInt numPositions);
423 
429  AGXOSG_EXPORT osg::Geode *createRigidBodyTrajectoriesVisual(agxSDK::Simulation * simulation, osg::Group* root, agx::Real sampling, agx::UInt numPositions, ScalarColorMap* scalarColorMap = nullptr );
430 
431  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));
432 
434 
438  AGXOSG_EXPORT osg::Group *createVisual( agx::RigidBody* rb, osg::Group* root, float detailRatio = 1.0f, bool createAxes = false );
439 
443  AGXOSG_EXPORT osg::Group *createVisual( agxSDK::Assembly *parent, osg::Group* root, float detailRatio = 1.0f, bool createAxes = false );
444 
445 
449  AGXOSG_EXPORT osg::Group *createVisual(agxSDK::Simulation *simulation, osg::Group* root, float detailRatio = 1.0f, bool createAxes = false);
450 
451  AGXOSG_EXPORT bool setEnableOutline(osg::Node *node, bool enabled, const agxRender::Color& color=agxRender::Color(1,1,0,1), float width = 2.0);
452  AGXOSG_EXPORT bool getEnableOutline(osg::Node *node);
453 
454 
455 
456  AGXOSG_EXPORT void setEnableLight( bool enable, int lightNum, osg::Node* node );
457 
467  AGXOSG_EXPORT void getNearFarPoints(const osg::Camera* camera, float x, float y, agx::Vec3& near, agx::Vec3& far);
468 
477  AGXOSG_EXPORT agxCollide::LocalGeometryContact getHoveredGeometryContact(const osg::Camera * camera, agxCollide::Space * space, float x, float y);
478 
479  AGXOSG_EXPORT bool setEnableWireFrameMode(osg::Node* node, bool flag);
480 
481  AGXOSG_EXPORT bool forceWireFrameModeOn( osg::Node* node );
482 
483  AGXOSG_EXPORT bool toggleWireFrameMode(osg::Node* node);
484 
485  AGXOSG_EXPORT bool setOrbitCamera(osgViewer::Viewer* viewer, agxOSG::GeometryNode* node,
486  const agx::Vec3& eye, const agx::Vec3& center, const agx::Vec3& up,
487  int trackerMode);
488 
489 
490 
494  AGXOSG_EXPORT bool loadCubeMapImages(const std::string& imagename, const std::string& filetype, agx::Vector<osg::ref_ptr<osg::Image> >& images);
495 
499  AGXOSG_EXPORT osg::TextureCubeMap * createTextureCubeMap(agx::Vector<osg::ref_ptr<osg::Image> >& images);
500  AGXOSG_EXPORT osg::TextureCubeMap * createTextureCubeMap(const std::string& imagename, const std::string& filetype);
501 
505  AGXOSG_EXPORT void addRenderCallbackToFractureListener(agxModel::FractureGenerator * listener, osg::Group * root, const agx::Vec4f& color);
506 
512 
521 
526  {
527  NORMAL_X = 0,
534  };
535 
548  {
549  public:
550  /* Create a force arrow renderer*/
552 
553  /*
554  Add body for contact force visualization, normal and friction force are visualized with one arrow each.
555  \param body - a rigid body.
556  \param localOffsetRelBody - the start point of the arrow relative the rigid body.
557  */
558  void add(agx::RigidBody* body, const agx::Vec3& localOffsetRelBody);
559 
560  /*
561  Remove a body from the contact force arrow visualization.
562  */
563  agx::Bool remove(agx::RigidBody* body);
564 
565  /*
566  Add a vector of 1DOF constraints. The sum of the motor forces are visualized with one arrow.
567  \param constraintVector - a vector with Constraint1DOF
568  \param localOffsetRelBody1 - the start point of the arrow relative the first rigid body of the first constraint.
569  */
570  void add(Constraint1DOFObserverVector& constraintVector, const agx::Vec3& localOffsetRelBody1);
571 
572  /*
573  Remove a constraints from the constraint force arrow visualization.
574  */
575  agx::Bool remove(agx::Constraint1DOF* constraint);
576  agx::Bool remove(Constraint1DOFObserverVector& constraintVector);
577 
578  /*
579  A smooth factor for a filter, smoothing the force arrow size.
580  \param smoothFactor - factor to be used with a agxUtil::ExponentialMovingAverageStatistic
581  */
582  void setSmoothFactor(const agx::Real& smoothFactor);
583  agx::Real getSmoothFactor() const;
584 
585  /*
586  Look and feel of the arrow
587  \param length - cone length
588  */
589  void setConeLength(const agx::Real& length);
590  agx::Real getConeLength() const;
591  /*
592  Look and feel of the arrow.
593  \param radius - arrow radius
594  */
595  void setArrowRadius(const agx::Real& radius);
596  agx::Real getArrowRadius() const;
597 
598  /*
599  Scale the size of the arrow (scale 1 would result in 1 Newton giving length of 1 l.u. )
600  \param scale - a scale factor from Newton to length units (l.u.).
601  */
602  void setScale(const agx::Real& scale);
603  agx::Real getScale() const;
604 
609  virtual void update(float x, float y);
610 
611  protected:
612  virtual ~ForceArrowRenderer();
613 
614  void drawArrow(const agx::Vec3& start, const agx::Vec3& force);
615 
621  RigidBodyRefVec3PairTable m_bodies;
622  Constraint1DOFObserverVectorVec3PairVector m_constraint1DOFVectors;
623  calculateTotalContactForceVectorVector m_bodyStatistics;
624  ExponentialMovingAverageStatisticVector m_constraintStatistics;
625  };
626 }
627 
628 #endif /* _AGXOSG_UTILS_H_ */
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::Real m_arrowRadius
Definition: utils.h:619
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
Definition: Vec3.h:36
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.
agx::Real m_smoothFactor
Definition: utils.h:617
#define AGXOSG_EXPORT
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.
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.
AGXOSG_EXPORT void setAlpha(osg::Node *node, float alpha)
Set the alpha part of the material for a node.
ExponentialMovingAverageStatisticVector m_constraintStatistics
Definition: utils.h:624
agx::Real m_coneLength
Definition: utils.h:618
bool Bool
Definition: Integer.h:48
AGXOSG_EXPORT bool setOrbitCamera(osgViewer::Viewer *viewer, agxOSG::GeometryNode *node, const agx::Vec3 &eye, const agx::Vec3 &center, const agx::Vec3 &up, int trackerMode)
agxCollide namespace consists of a set of classes for handling geometric intersection tests including...
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:34
AGXOSG_EXPORT bool toggleWireFrameMode(osg::Node *node)
AGXOSG_EXPORT agxOSG::FrameTrajectoryDrawable * findFrameTrajectoryDrawable(osg::Group *root)
Constraint1DOFObserverVectorVec3PairVector m_constraint1DOFVectors
Definition: utils.h:622
AGXOSG_EXPORT void addRenderCallbackToFractureListener(agxModel::FractureGenerator *listener, osg::Group *root, const agx::Vec4f &color)
Adds default createVisual callback to a fractureListener when new fragments are created.
GLenum GLuint GLenum GLsizei length
Definition: gl.h:5539
The base class for a constraint.
Definition: Constraint.h:86
Utility color class with "common colors".
Definition: Color.h:33
Specialization for constraints that have only one degree of freedom such as Hinge and Prismatic...
Definition: Constraint.h:674
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_EXPORT void setShininess(osg::Node *node, float shininess)
Set the shininess exponent for the Phong specular model.
AGXOSG_EXPORT bool setEnableWireFrameMode(osg::Node *node, bool flag)
agx::Vector< agxUtil::ExponentialMovingAverageStatistic > ExponentialMovingAverageStatisticVector
Definition: utils.h:519
AGXOSG_EXPORT void setSpecularColor(osg::Node *node, const agx::Vec4f &color)
Set the specular part of a material for a node.
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::Vector< agx::Constraint1DOFObserver > Constraint1DOFObserverVector
Helper vector&#39;s for ForceArrowListener.
Definition: utils.h:516
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_EXPORT agxCollide::Trimesh * createTrimesh(osg::Node *node)
Extracts mesh data from an osg::Node, creates an agxCollide::Trimesh from it and returns the result...
Spawns new bodys inside a given volume.
Definition: Emitter.h:37
RigidBodyRefVec3PairTable m_bodies
Definition: utils.h:621
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:36
The geometry representation used by the collision detection engine.
Definition: Geometry.h:88
Templated vector class.
Definition: Vector.h:52
ContactForceStatistics
Contact force directions.
Definition: utils.h:525
A basic particle system that contains all the storages and buffers required for basic operation and a...
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))
TextureMode
Definition: utils.h:88
uint32_t UInt
Definition: Integer.h:34
AGXOSG_EXPORT bool getEnableOutline(osg::Node *node)
This class contains all Geometries and performs Broad Phase and Narrow Phase collision detection to c...
Definition: Space.h:81
Namespace agx contains the dynamics/math part of the AGX Dynamics API.
agx::Vector< std::pair< Constraint1DOFObserverVector, agx::Vec3 > > Constraint1DOFObserverVectorVec3PairVector
Definition: utils.h:517
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
Derive from this class to implement a listener for simulation GuiEvents.
AGXOSG_EXPORT bool setEnableOutline(osg::Node *node, bool enabled, const agxRender::Color &color=agxRender::Color(1, 1, 0, 1), float width=2.0)
A node that can be associated with a collision geometry so that the transformation of this node is up...
Definition: GeometryNode.h:41
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.
AGXOSG_EXPORT void createAxes(agx::Constraint *constraint, osg::Group *root, float scale=1.f, const agx::Vec4f &color=agx::Vec4f())
Create axes at the constraint attachments.
AGXOSG_EXPORT void setDiffuseColor(agxCollide::Geometry *geometry, const agx::Vec4f &color, osg::Group *root)
Set the diffuse part of a material for a geometry.
AGXOSG_EXPORT GeometryNode * findGeometryNode(const agxCollide::Geometry *geometry, osg::Group *rootNode)
Finds the geometry node associated to a geometry.
static agxRender::Color Yellow()
Definition: Color.h:193
AGXOSG_EXPORT agxOSG::ParticleSystemDrawable * findParticleSystemDrawable(osg::Group *root)
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:52
calculateTotalContactForceVectorVector m_bodyStatistics
Definition: utils.h:623
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_EXPORT bool removeText(const agxCollide::Geometry *geometry, osg::Group *root, size_t index=0)
Remove text from a geometry.
The object defining a frame of reference and providing transformations operations.
Definition: Frame.h:67
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:121
Spawns new bodys inside a given volume.
AGXOSG_EXPORT osg::Texture2D * createTexture(const std::string &filename)
Create a Texture2D object that can be assigned to nodes.
double Real
Definition: Real.h:42
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.
Class that represents a linear scalar color map that converts a scalar interval to a specified color ...
AGXCORE_EXPORT Component * root()
AGXOSG_EXPORT osg::TextureCubeMap * createTextureCubeMap(agx::Vector< osg::ref_ptr< osg::Image > > &images)
Internal functions for creating texture cube maps.
Triangle mesh for geometric intersection tests.
Definition: Trimesh.h:42
agx::Vector< ExponentialMovingAverageStatisticVector > calculateTotalContactForceVectorVector
Definition: utils.h:520
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.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
Creates an arrow visualizing force, either contact force (for added bodies), or motor force for added...
Definition: utils.h:547
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).
AGXOSG_EXPORT void setEnableLight(bool enable, int lightNum, osg::Node *node)
agx::HashVector< agx::RigidBodyRef, agx::Vec3 > RigidBodyRefVec3PairTable
Definition: utils.h:518
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:102
AGXOSG_EXPORT bool forceWireFrameModeOn(osg::Node *node)
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_EXPORT void setAmbientColor(osg::Node *node, const agx::Vec4f &color)
Set the ambient part of a material for a node.
The agxUtil namespace contain classes and methods for utility functionality.
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:101
void setUniform(osg::Node *node, const std::string &name, T value)
Definition: utils.h:219
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints, geometries.
Definition: Assembly.h:73
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...
With this class you can attach an ObserverFrame object relative to a RigidBody.
Definition: ObserverFrame.h:42