17 #ifndef AGXSDK_SIMULATIONTRACK_H 18 #define AGXSDK_SIMULATIONTRACK_H 39 virtual agxData::Frame *readFrame()
override;
45 agxData::Frame *generateKeyFrame();
51 void setReadFrameOnNextPreTick(
bool flag);
53 void forcePushCurrentFrame();
56 void setKeyFrameInterval(
agx::UInt interval);
58 void setStoreConstraintData(
bool flag);
59 bool getStoreConstraintData()
const;
65 virtual agx::UInt getFrameStride()
override;
70 void setEnableIncrementalStructure(
bool flag);
75 bool getEnableIncrementalStructure()
const;
79 void tryPushCurrentFrameToTrack();
88 class ValueListener :
public agxData::Value::EventListener
100 class BufferListener :
public agxData::Buffer::EventListener
116 class StorageListener :
public agxData::EntityStorage::EventListener
134 class IncrementalArchive :
public agx::Observer
137 IncrementalArchive();
138 virtual ~IncrementalArchive();
143 std::stringstream& getStream();
148 virtual void objectDeleted(
void *target);
152 std::unique_ptr<std::stringstream> m_stream;
161 virtual agxData::Frame::DataBinding *createDataBinding(
const agx::Path& internalPath,
const agx::Path& externalPath)
override;
166 void synchronizeConstraintForceData();
167 void postSaveCallback();
173 void addStatisticsToFrame(agxData::Frame *frame);
176 void addObjectToFrame(agxData::Frame *frame,
agx::Object *
object,
const agx::Path& bindPath,
bool resetDirtyFlags,
bool recursive);
177 void addValueToFrame(agxData::Frame *frame,
agxData::Value *value,
const agx::Path& bindPath,
bool resetDirtyFlags);
178 void addBufferToFrame(agxData::Frame *frame,
agxData::Buffer *buffer,
const agx::Path& bindPath,
bool resetDirtyFlags);
181 void initializeBinding(
DataBinding *binding,
bool doingActualSimulation);
182 void initializeBinding(
agx::Object *
object,
bool doingActualSimulation,
bool recursive);
183 agxData::Frame *readFrameImpl(
bool isSequenceFrame);
185 void addConstraintDataToFrame( agxData::Frame *frame );
189 void extractTaskProfilingData(
agx::Task *task, agx::TaskTimingData& timingData);
194 friend class ValueListener;
195 ValueListener m_valueListener;
197 friend class BufferListener;
198 BufferListener m_bufferListener;
200 friend class StorageListener;
201 StorageListener m_storageListener;
204 DirtyValueTable m_activeValues;
207 DirtyBufferTable m_activeBuffers;
210 StorageTable m_activeStorages;
220 agx::Object::EventRefVector m_events;
221 bool m_saveFrameOnNextPreTick;
224 bool m_storeConstraintData;
227 bool m_enableThreadTimeline;
228 bool m_isProfilingFrame;
233 TaskProfilingSizeTable m_taskProfilingSizeTable;
235 agxData::BufferRefVector m_frameExportBuffers;
237 IncrementalArchive m_incrementalArchive;
240 void extractCustomTaskProfiling(agx::TaskTimingReportHandle* node, agx::TaskTimingData& timingData);
242 agx::Component *createFrameArchive(
bool isKeyFrame,
bool binary =
true);
285 bool m_enableIncrementalStructure;
311 DirtySet(
bool markAllDirty =
false);
317 bool isAllDirty()
const;
339 virtual void writeFrame(
const agxData::Frame *frame)
override;
341 virtual void forceFlush()
override;
348 void writeFrameImpl(
const agxData::Frame *frame);
355 void updateCallback();
358 void write(
const agxData::Frame::PartialBuffer *buffer,
const agxData::Frame *frame);
359 void write(
const agxData::Frame::EntityStorage *storage,
const agxData::Frame *frame);
361 void evaluateEventsPre(
const agxData::Frame *frame);
362 void evaluateEventsPost(
const agxData::Frame *frame);
363 void writeConstraintData(
const agxData::Frame *frame);
364 bool writeFrameArchive(
const agxData::Frame *frame);
366 void updateArrayBuffers();
370 template <
typename T>
371 T *getTarget(
const Object *source);
373 template <
typename T>
376 template <
typename T>
379 class IncrementalArchive :
public agx::Observer
382 IncrementalArchive();
383 virtual ~IncrementalArchive();
388 std::stringstream& getStream();
393 virtual void objectDeleted(
void *target);
397 std::unique_ptr<std::stringstream> m_stream;
417 bool m_needClockUpdate;
424 ObjectIdTable m_objectIdTable;
425 agxData::BufferRefVector m_arrayBuffers;
427 IncrementalArchive m_incrementalArchive;
void setBlocking(bool blocking)
Representation of a path, a list of name components.
AGXTERRAIN_EXPORT void clear()
Data storage for a collection of entity instances of a specified EntityModel.
agx::Task * getUpdateTask()
A component is an object containing other objects, enabling hierarchical structuring.
Abstract representation of a value.
The FrameReader reads frames from an external source.
#define AGXPHYSICS_EXPORT
The base class for a constraint.
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
#define AGX_DECLARE_POINTER_TYPES(type)
A representation of a generic task.
agx::UInt getKeyFrameInterval() const
Block synchronization primitive.
Base class providing referencing counted objects.
The geometry representation used by the collision detection engine.
The FrameWriter writes frames to an external target.
friend class ProviderHandle
Templated callback with one argument.
Templated callback with three arguments.
std::vector< bool > DynamicBitSet
Abstract representation of a data buffer.
agx::ref_ptr< agx::Referenced > object
bool AGXPHYSICS_EXPORT write(const std::string &filename, const agxStream::Serializable *data)
Write a Serializable object to a file.
The rigid body class, combining a geometric model and a frame of reference.
const agx::IndexVector & getIndexList() const
Templated callback with two arguments.
AGXTERRAIN_EXPORT TimingStorage & getStorage()
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Class for writing serialized data in binary format to a stream.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Clock class keeps representation of virtual/simulated time.
AGXCORE_EXPORT Component * root()
Inheritance with partial specialization due to bug with ref_ptr containers.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
agx::Object is a refcounted object with a name.