Momentum Scripting v1
Loading...
Searching...
No Matches
Geometry.h
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 without having a written signed agreement with Algoryx Simulation AB.
9
10Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
11from using this software, unless otherwise stated in written agreements with
12Algoryx Simulation AB.
13*/
14
15
16#pragma once
17
18#include "momentum_export.h"
19#include "momentum_namespace.h"
20
21#include "macros.h"
22#include "ContactPoint.h"
23#include "Material.h"
24
25#include <string>
26
27#ifndef SWIG
29namespace agxCollide
30{
31 class Geometry;
32}
34#endif
35
36namespace MOMENTUM_NAMESPACE
37{
38 class ContactPoint;
39
43 class MOMENTUM_EXPORT Geometry
44 {
45 public:
46#ifndef SWIG
50 Geometry(agxCollide::Geometry* geometry);
51
56#endif
57
62 std::shared_ptr<Material> getMaterial() const;
63
69
70#ifndef AGX_MOMENTUM_ANALYSIS_API
77 void setEnableCollisions(bool flag);
78
85 void setSensor(bool flag);
86
96 bool addCollisionGroup(const std::string& name);
97
103 bool removeCollisionGroup(const std::string& name);
104
105#endif
106
112 bool hasCollisionGroup(const std::string& name) const;
113
118 std::vector<std::string> getCollisionGroups() const;
119
123 bool getSensor() const;
124
130
135 std::string getName() const;
136
141 std::pair<Vec3, Vec3> getBound() const;
142
147 bool pointIsInsideGeometry(Vec3 point, double radius) const;
148
150 std::string __str__() const;
152
153 bool operator==(const Geometry& other) const;
154 private:
156 friend class Simulation;
157 friend class GranularBodySystem;
158
159#ifndef SWIG
160 agxCollide::Geometry* m_geometry;
161#endif
162 public:
163#ifndef SWIG
164 bool is(agxCollide::Geometry* geometry) const;
165#endif
167 };
168
169 V1_DECLARE_CONTAINER_TYPE(Geometry);
170
171} // namespace momentum
172
A class describing a Geometry.
Definition: Geometry.h:44
std::string getName() const
Get the name of the geometry.
Geometry()
Default constructor.
bool hasCollisionGroup(const std::string &name) const
Checks if this geometry has a named collision group.
bool getEnableCollisions() const
Return whether this geometry can be involved in collisions.
std::pair< Vec3, Vec3 > getBound() const
Get the axis aligned bound of the Geometry.
bool pointIsInsideGeometry(Vec3 point, double radius) const
Check if the selected point is inside the geometry.
Geometry(agxCollide::Geometry *geometry)
Create a wrapper around an agxCollide::Geometry.
void setSensor(bool flag)
Specifies whether this geometry will generate contacts that the solver will see or not.
bool operator==(const Geometry &other) const
ContactPointVector getContacts() const
Get all contacts including this geometry during the current timestep.
std::shared_ptr< Material > getMaterial() const
Get the material of this geometry.
std::vector< std::string > getCollisionGroups() const
Get a list of all collision groups that this geometry has.
bool removeCollisionGroup(const std::string &name)
Remove a named collision group from this Geometry.
void setEnableCollisions(bool flag)
Enable/Disable collision detection of this geometry.
bool addCollisionGroup(const std::string &name)
Add a named collision group to this Geometry that can be used for contact filtering during a simulati...
The GranularBodySystem class acts as a container for all the active GranularBodies in the simulation.
Definition: GranularBodySystem.h:57
This class is used to access an existing simulation with all its contents including joints,...
Definition: Simulation.h:70
A 3 dimensional vector which can be used to define a point or a vector and contains basic arithmetic.
Definition: Vec3.h:40
Namespace for Momentum Scripting API.
Definition: AffineMatrix4x4.h:29
std::vector< std::shared_ptr< ContactPoint > > ContactPointVector
A vector with objects of the type ContactPoint .
Definition: ContactPoint.h:43