AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
StepEventListener.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#pragma once
18
20#include <agx/TimeStamp.h>
21
22namespace agxSDK
23{
36 {
37 public:
38
41 STEP_NONE = 0x0,
42 PRE_COLLIDE = 0x1,
43 PRE_STEP = 0x2,
44 POST_STEP = 0x4,
45 LAST_STEP = 0x8,
46 DEFAULT = PRE_STEP | POST_STEP,
47 ALL = PRE_COLLIDE | PRE_STEP | POST_STEP | LAST_STEP
48 };
49
51 StepEventListener( int mask = DEFAULT );
52
57 virtual void setMask(int mask) override;
58
59
60 // ================ Override these three methods to catch events
66 virtual void preCollide(const agx::TimeStamp& time);
67
73 virtual void pre(const agx::TimeStamp& time);
74
80 virtual void post(const agx::TimeStamp& time);
81
88 virtual void last(const agx::TimeStamp& time);
89
90#ifndef SWIG
92#endif
93
94 protected:
95
96
99 };
100
101
102
103 inline void StepEventListener::preCollide(const agx::TimeStamp& /*time*/) { }
104 inline void StepEventListener::pre(const agx::TimeStamp& /*time*/) { }
105 inline void StepEventListener::post(const agx::TimeStamp& /*time*/) { }
106 inline void StepEventListener::last(const agx::TimeStamp& /*time*/) { }
107
108
109}
#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...
Definition: Serializable.h:207
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: agx/Vector.h:34
An EventListener can be associated to a Simulation and triggered upon various events.
Definition: EventListener.h:40
Derive from this class to implement a listener for simulation step events.
virtual void preCollide(const agx::TimeStamp &time)
Called before collision detection is performed in the simulation Implement this method in the derived...
virtual ~StepEventListener()
Destructor.
virtual void last(const agx::TimeStamp &time)
Called after a step is taken in the simulation Implement this method in the derived class to get call...
virtual void pre(const agx::TimeStamp &time)
Called before a step is taken in the simulation Implement this method in the derived class to get cal...
virtual void post(const agx::TimeStamp &time)
Called after a step is taken in the simulation Implement this method in the derived class to get call...
ActivationMask
Defines the event states for which a listener will be activated, a mask can be bitwise OR:ed from the...
StepEventListener(int mask=DEFAULT)
Default constructor, sets the default activation mask to all (POST_STEP and PRE_STEP) events.
virtual void setMask(int mask) override
Specifies a bitmask which determines which event types will activate this listener.
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