AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
SensorEvent.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 AGXCONTROL_SENSOREVENT_H
18#define AGXCONTROL_SENSOREVENT_H
19
20#include <agx/config.h>
21
23#include <agx/Referenced.h>
24#include <agx/Name.h>
25#include <agx/TimeStamp.h>
26#include <agxCollide/Contacts.h>
28#include <agxCollide/Geometry.h>
31
32namespace agxSDK
33{
34 class Simulation;
35}
36
37namespace agxControl
38{
39 class EventSensor;
40
43
49 {
50
51 public:
52
54 SensorEvent( const agx::Name& name = agx::Name());
55
59 const agx::Name& getName() const;
60
64 virtual void triggerEvent(const agx::TimeStamp& t,
65 agxSDK::Simulation* simulation,
67 EventSensor* sensor);
68
72 virtual void triggerParticleEvent(const agx::TimeStamp& t,
73 agxSDK::Simulation* simulation,
74 agx::Physics::ParticleGeometryContactInstance contact,
75 agx::Physics::ParticleData& particleData,
76 agx::Physics::GeometryData& geometryData,
77 EventSensor* sensor);
78
82 virtual void postContactHandling(agxSDK::Simulation *simulation, EventSensor * sensor);
83
88 virtual void addNotification(EventSensor * sensor);
89
93 virtual void update(const agx::TimeStamp& t);
94
96
97 friend class EventSensor;
98
99 protected:
101 virtual ~SensorEvent();
102
103 protected:
108
109 };
110
118 {
119 public:
122
126 virtual void triggerEvent(const agx::TimeStamp& t, agxSDK::Simulation * simulation, agxCollide::GeometryContact *cd, EventSensor * sensor) override;
127
132 agxSDK::Simulation* simulation,
133 agx::Physics::ParticleGeometryContactInstance contact,
134 agx::Physics::ParticleData& particleData,
135 agx::Physics::GeometryData& geometryData,
136 EventSensor* sensor) override;
137
141 virtual void postContactHandling(agxSDK::Simulation *simulation, EventSensor * sensor) override;
142
147 virtual void addNotification(EventSensor * sensor) override;
148
152 virtual void update(const agx::TimeStamp& t) override;
153
155
156 protected:
159
160 };
161}
162
163#endif /*SENSOREVENT_H_*/
164
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition agx/Vector.h:34
A contact between two geometries.
Definition Contacts.h:271
This is a sensor class that can be attached to an geometry in the simulation.
Definition EventSensor.h:48
A sensor event is an event triggered when the sensor is activated by a contact.
Definition SensorEvent.h:49
const agx::Name & getName() const
virtual void postContactHandling(agxSDK::Simulation *simulation, EventSensor *sensor)
Post function that will be triggered for the event after all the contacts have handled in the operati...
agx::Name m_name
Name of the sensor event.
virtual void triggerEvent(const agx::TimeStamp &t, agxSDK::Simulation *simulation, agxCollide::GeometryContact *cd, EventSensor *sensor)
Triggers the sensor event by passing contact information.
virtual void triggerParticleEvent(const agx::TimeStamp &t, agxSDK::Simulation *simulation, agx::Physics::ParticleGeometryContactInstance contact, agx::Physics::ParticleData &particleData, agx::Physics::GeometryData &geometryData, EventSensor *sensor)
Triggers the sensor event by passing particle contact information.
SensorEvent(const agx::Name &name=agx::Name())
Default Constructor.
virtual void update(const agx::TimeStamp &t)
Used to update the sensor event each time step, if they have time dependent components.
virtual ~SensorEvent()
Destructor.
virtual void addNotification(EventSensor *sensor)
Function will be executed when the sensor that the operations is added to is added to a simulation.
int priority
The priority of the sensor event.
A specific type of sensor event that triggers a change in the simulation when activated by a contact.
virtual void addNotification(EventSensor *sensor) override
Function will be executed when the sensor that the operations is added to is added to a simulation.
virtual void triggerParticleEvent(const agx::TimeStamp &t, agxSDK::Simulation *simulation, agx::Physics::ParticleGeometryContactInstance contact, agx::Physics::ParticleData &particleData, agx::Physics::GeometryData &geometryData, EventSensor *sensor) override
Triggers the sensor event by passing particle contact information.
virtual void triggerEvent(const agx::TimeStamp &t, agxSDK::Simulation *simulation, agxCollide::GeometryContact *cd, EventSensor *sensor) override
Triggers the sensor event by passing contact information.
virtual void update(const agx::TimeStamp &t) override
Used to update the sensor operation each time step, if they have time dependent components.
SensorOperation(const agx::Name &name=agx::Name())
Default constructor.
virtual ~SensorOperation()
Destructor.
virtual void postContactHandling(agxSDK::Simulation *simulation, EventSensor *sensor) override
Post function that will be triggered for the event after all the contacts have handled in the operati...
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition Simulation.h:126
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Representation of a name string.
Definition Name.h:33
Base class providing referencing counted objects.
Definition Referenced.h:120
This namespace contains general operation and action classes which can be used to control a agxSDK::S...
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition Constraint.h:31
agx::Real TimeStamp
Definition TimeStamp.h:26