60 template<
typename FuncT,
typename... Args>
61 static void preCollide( FuncT callback,
agxSDK::Simulation* simulation, Args&&... args );
69 template<
typename FuncT,
typename... Args>
78 template<
typename FuncT,
typename... Args>
87 template<
typename FuncT,
typename... Args>
99 virtual void addNotification()
override;
104 virtual void removeNotification()
override;
126 using Callback = std::function<void()>;
139 static void registerCallback( Callback callback, CallbackType callbackType,
agxSDK::Simulation* simulation );
151 void executeCallbacks(
const agx::TimeStamp& t, CallbackType callbackType );
158 template<
typename FuncT,
typename... Args>
161 if ( simulation ==
nullptr )
164 registerCallback( std::bind( callback, simulation, std::forward<Args>( args )... ), PRE_COLLIDE_TYPE, simulation );
167 template<
typename FuncT,
typename... Args>
170 if ( simulation ==
nullptr )
173 registerCallback( std::bind( callback, simulation, std::forward<Args>( args )... ), PRE_TYPE, simulation );
176 template<
typename FuncT,
typename... Args>
179 if ( simulation ==
nullptr )
182 registerCallback( std::bind( callback, simulation, std::forward<Args>( args )... ), POST_TYPE, simulation );
185 template<
typename FuncT,
typename... Args>
188 if ( simulation ==
nullptr )
191 registerCallback( std::bind( callback, simulation, std::forward<Args>( args )... ), LAST_TYPE, simulation );
Helper to use lambdas as preCollide, pre, post and last step events.
Derive from this class to implement a listener for simulation step events.
static void pre(FuncT callback, agxSDK::Simulation *simulation, Args &&... args)
Register a pre step event callback.
#define AGXPHYSICS_EXPORT
static void last(FuncT callback, agxSDK::Simulation *simulation, Args &&... args)
Register a last step event callback.
Smart pointer for handling referenced counted objects.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
static void post(FuncT callback, agxSDK::Simulation *simulation, Args &&... args)
Register a post step event callback.
Inheritance with partial specialization due to bug with ref_ptr containers.
static void preCollide(FuncT callback, agxSDK::Simulation *simulation, Args &&... args)
Register a pre-collide step event callback.
The agxUtil namespace contain classes and methods for utility functionality.