AGX Dynamics  2.38.0.2
RockGenerator.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 #ifndef AGXOSG_ROCKGENERATOR_H
18 #define AGXOSG_ROCKGENERATOR_H
19 
20 #include <agxOSG/export.h>
21 #include <agx/Referenced.h>
22 #include <agx/Vec3.h>
23 
24 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
25 #include <osg/Node>
26 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
27 
28 namespace agxOSG {
29  class Node;
30 }
31 
32 namespace agxCollide {
33  class Space;
34 }
35 
36 namespace agx {
37  class Material;
38  class RigidBody;
39 }
40 
41 namespace agxSDK {
42  class Assembly;
43 }
44 
45 namespace agxOSG
46 {
48  {
49  public:
50  enum RockType
51  {
59  NUM_ROCK_TYPES
60  };
61 
62  RockGenerator();
63 
64  void generateRocks( agxSDK::Assembly *root,
65  agxCollide::Space *space,
66  int numRocks,
67  osg::Group *visualRoot,
68  agx::Real emitterRadius,
69  agx::Real elementRadius,
70  agx::Material *rockMaterial,
71  agx::Real emitVelocityMagnitude = 0.0,
72  agx::Real elementPositionJitter = 0.5,
73  agx::Real elementRadiusJitter = 0.5,
74  agx::Real elementSpacing = 0.0 );
75 
76 
77  protected:
78  virtual ~RockGenerator();
79 
80  agx::RigidBody *generateRock(osg::Group *visualRoot, RockType type, agx::Real elementRadius, agx::Real elementPositionJitter, agx::Real elementRadiusJitter, agx::Real elementSpacing, agx::Material *rockMaterial);
81  void generateMayaRock(osg::Group *visualRoot, RockType type, agx::RigidBody *body, agx::Real elementRadius, agx::Real elementPositionJitter, agx::Material *rockMaterial);
82  void addSphereElement(agx::RigidBody *body, osg::Group *visualRoot, const agx::Vec3& localOffset, agx::Real elementRadius, agx::Real elementPositionJitter, agx::Real elementRadiusJitter, agx::Material *rockMaterial);
83 
84  private:
85  osg::ref_ptr<osg::Node> m_visualRock1;
86  osg::ref_ptr<osg::Node> m_visualRock2;
87  osg::ref_ptr<osg::Node> m_visualRock3;
88  };
89 
91 }
92 
93 #endif /* AGXOSG_ROCKGENERATOR_H */
Referenced.h
agx::Real
double Real
Definition: Real.h:42
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:51
agxOSG::RockGenerator::COMPOSITE_FOUR
@ COMPOSITE_FOUR
Definition: RockGenerator.h:55
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
agxSDK::Assembly
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Definition: Assembly.h:67
agxOSG::RockGenerator::MAYA_ROCK1
@ MAYA_ROCK1
Definition: RockGenerator.h:56
Vec3.h
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agxOSG::RockGenerator::COMPOSITE_ONE
@ COMPOSITE_ONE
Definition: RockGenerator.h:52
agxOSG
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
PushDisableWarnings.h
agxOSG::RockGeneratorRef
agx::ref_ptr< RockGenerator > RockGeneratorRef
Definition: RockGenerator.h:90
agxOSG::RockGenerator
Definition: RockGenerator.h:47
agxCollide::Space
This class contains all Geometries and performs Broad Phase and Narrow Phase collision detection to c...
Definition: Space.h:81
agx::root
AGXCORE_EXPORT Component * root()
agxOSG::RockGenerator::MAYA_ROCK2
@ MAYA_ROCK2
Definition: RockGenerator.h:57
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:119
agxOSG::RockGenerator::MAYA_ROCK3
@ MAYA_ROCK3
Definition: RockGenerator.h:58
agxCollide
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Definition: ContactForceFilterParticipant.h:22
export.h
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
agx::Material
Main material class which acts as a holder of a Surface Material and a Bulk material.
Definition: Material.h:375
agx::Vec3T< Real >
agxOSG::RockGenerator::COMPOSITE_THREE
@ COMPOSITE_THREE
Definition: RockGenerator.h:54
agxOSG::RockGenerator::COMPOSITE_TWO
@ COMPOSITE_TWO
Definition: RockGenerator.h:53
agxOSG::RockGenerator::RockType
RockType
Definition: RockGenerator.h:50
AGXOSG_EXPORT
#define AGXOSG_EXPORT
PopDisableWarnings.h