AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
AnalysisBox.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. 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 AGX_ANALYSISBOX_H
18#define AGX_ANALYSISBOX_H
19
20#include <agx/Referenced.h>
21#include <agx/Bound.h>
22#include <agxCollide/Box.h>
23#include <agxSDK/Simulation.h>
24
25namespace agx
26{
28
33 {
34 public:
36
37 public:
46 const agx::Vec3& halfVec,
48
51
54
56 ParticleIdSet getParticlesInside() const;
57
59 bool containsParticle(agx::Index particleId) const;
60
62 bool containsPoint(const agx::Vec3& point) const;
63
65 bool getEnable() const;
66
68 void setEnable(bool enable);
69
72
75
77 void setBoxHalfVec( const agx::Vec3& halfVec );
78
80 void setBoxCenter( const agx::Vec3& center );
81
83 void setBoxRotation( const agx::Quat& rotation );
84
87
89 agx::AffineMatrix4x4 getTransform() const;
90
92
93 protected:
95 virtual ~AnalysisBox();
96
98
99 agx::AffineMatrix4x4 getInvTransform() const;
100
102
104 // Variables
106 protected:
114 };
115
117
119
120 AGX_FORCE_INLINE void AnalysisBox::setEnable(bool enable) { m_enabled = enable; }
121
123
125}
126
127#endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXPHYSICS_EXPORT
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition Simulation.h:126
Class that can be used to extract data from elements in a simulation within a specified bound.
Definition AnalysisBox.h:33
void setBoxHalfVec(const agx::Vec3 &halfVec)
Set the half vector of the Analysis Box bound.
Real getParticleMassInsideBound()
Return the particle mass in the particles inside the Analysis Box.
agx::AffineMatrix4x4 m_transform
agx::AffineMatrix4x4 m_invBoxTransform
ParticleIdSet getParticlesInside() const
Returns the particles ids inside the Analysis Box.
agx::Quat getBoxRotation() const
Get the rotation of the Analysis Box bound.
bool containsPoint(const agx::Vec3 &point) const
Returns true/false if the point is contained inside the Analysis Box bound.
virtual ~AnalysisBox()
Virtual Destructor.
agx::Bound3 m_bound
ParticleIdSet m_particleIdsInside
agx::Vec3 getBoxHalfVec() const
Get the half vector of the Analysis Box bound.
agx::AffineMatrix4x4 getInvTransform() const
agxSDK::Simulation * m_simulation
bool containsParticle(agx::Index particleId) const
Returns true/false if the particle given the specified particle id is inside the box.
void setBoxCenter(const agx::Vec3 &center)
Set the center of the Analysis Box bound.
void setEnable(bool enable)
Set true/false to enable/enable the Analysis Box.
agx::Vec3 getBoxCenter() const
Get the center point of the Analysis Box bound.
void updateContents()
Update the analysis box contents.
void updateInvTransform()
agx::ParticleSystem * getParticleSystem()
HashSet< agx::Index > ParticleIdSet
Definition AnalysisBox.h:35
bool getEnable() const
Return true/false if the box is enabled.
void setBoxRotation(const agx::Quat &rotation)
Set the rotation of the Analysis Box bound.
RigidBodyPtrVector m_rigidBodiesInside
agx::AffineMatrix4x4 getTransform() const
Get the transform of the Analysis box.
AnalysisBox(agxSDK::Simulation *simulation, const agx::Vec3 &halfVec, const agx::AffineMatrix4x4 &transform=agx::AffineMatrix4x4())
Constructor for the AnalysisBox.
Inheritance with partial specialization due to bug with ref_ptr containers.
A basic particle system that contains all the storages and buffers required for basic operation and a...
Base class providing referencing counted objects.
Definition Referenced.h:120
#define AGX_FORCE_INLINE
Definition macros.h:58
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition Real.h:42
UInt32 Index
Definition Integer.h:44