AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
RockGenerator.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx 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
28namespace agxOSG {
29 class Node;
30}
31
32namespace agxCollide {
33 class Space;
34}
35
36namespace agx {
37 class Material;
38 class RigidBody;
39}
40
41namespace agxSDK {
42 class Assembly;
43}
44
45namespace agxOSG
46{
48 {
49 public:
51 {
59 NUM_ROCK_TYPES
60 };
61
63
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 */
#define AGXOSG_EXPORT
This class contains all Geometries and performs Broad Phase and Narrow Phase collision detection to c...
Definition: Space.h:86
void addSphereElement(agx::RigidBody *body, osg::Group *visualRoot, const agx::Vec3 &localOffset, agx::Real elementRadius, agx::Real elementPositionJitter, agx::Real elementRadiusJitter, agx::Material *rockMaterial)
agx::RigidBody * generateRock(osg::Group *visualRoot, RockType type, agx::Real elementRadius, agx::Real elementPositionJitter, agx::Real elementRadiusJitter, agx::Real elementSpacing, agx::Material *rockMaterial)
void generateMayaRock(osg::Group *visualRoot, RockType type, agx::RigidBody *body, agx::Real elementRadius, agx::Real elementPositionJitter, agx::Material *rockMaterial)
void generateRocks(agxSDK::Assembly *root, agxCollide::Space *space, int numRocks, osg::Group *visualRoot, agx::Real emitterRadius, agx::Real elementRadius, agx::Material *rockMaterial, agx::Real emitVelocityMagnitude=0.0, agx::Real elementPositionJitter=0.5, agx::Real elementRadiusJitter=0.5, agx::Real elementSpacing=0.0)
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Definition: Assembly.h:70
Main material class which acts as a holder of a Surface Material and a Bulk material.
Definition: Material.h:378
Base class providing referencing counted objects.
Definition: Referenced.h:120
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:49
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30
This namespace consists of a set of classes for handling geometric intersection tests including boole...
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
agx::ref_ptr< RockGenerator > RockGeneratorRef
Definition: RockGenerator.h:90
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition: Real.h:41