|
AGXDynamics
2.31.1.0
|
A pager that will dynamically handle terrain tiles in a agxSDK::Simulation. More...
#include <TerrainPager.h>
Inheritance diagram for agxTerrain::TerrainPager:Public Member Functions | |
| TerrainPager (size_t tileResolution, size_t tileOverlap, agx::Real tileElementSize, agx::Real maximumDepth, agx::Vec3 refPoint, agx::Quat refRotation, agxTerrain::Terrain *templateTerrain) | |
| Constructor. More... | |
| bool | add (agx::RigidBody *body, agx::Real requiredTileRadius, agx::Real preloadTileRadius) |
| Adds a RigidBody to the terrain pager. More... | |
| bool | add (agxTerrain::Shovel *shovel, agx::Real requiredTileRadius, agx::Real preloadTileRadius) |
| Adds a Shovel and its RigidBody to the terrain pager. More... | |
| void | addListener (EventListener *listener) |
| virtual void | addNotification () override |
| Notification to the TerrainPager when being added to a Simulation. More... | |
| virtual void | addObject (agx::Object *object, bool assignContext=true) |
| Add an object to the component. More... | |
| AGX_DECLARE_VECTOR_TYPES (Event) | |
| void | applyChangesToTemplateTerrain () |
| Signals to the TerrainPager that the template terrain has been updated and that any changes to the template terrain should be applied to the active terrain tiles in the pager. More... | |
| template<typename T > | |
| T * | as () |
| Subclass casting. More... | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. More... | |
| template<typename T > | |
| const T * | asSafe () const |
| virtual String | autoComplete (const String &partialName, StringVector &matchingNames) const |
| virtual void | buildNavigationTree (agxJson::Value &eNode) const override |
| virtual void | configure (TiXmlElement *eComponent) override |
| void | configure (Model *model) |
| agx::String | fullName () const |
| agx::String | fullPath () const |
| agx::String | fullPath (const agx::Object *root) const |
| agx::Object * | getAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr) |
| const agx::Object * | getAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr) const |
| template<typename T > | |
| T * | getAutoScopedResource (const agx::Path &path) |
| template<typename T > | |
| const T * | getAutoScopedResource (const agx::Path &path) const |
| const char * | getClassName () const override |
| agx::Object * | getContext () |
| const agx::Object * | getContext () const |
| template<typename T > | |
| T * | getContext () |
| template<typename T > | |
| const T * | getContext () const |
| agx::Device * | getDevice () |
| const agx::Device * | getDevice () const |
| template<typename T > | |
| T * | getDevice () |
| template<typename T > | |
| const T * | getDevice () const |
| bool | getEmbedCacheFilesInArhive () const |
| Returns if cached files should be embedded in AGX Archives used for serialization. More... | |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::String | getFileCacheDirectory () const |
| Return the location for where files should be temporary cached when not needed in memory. More... | |
| agx::UInt32 | getId () const |
| const agx::Name & | getImplementationName () const |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. More... | |
| int | getMask () const |
| agx::Model * | getModel () |
| const agx::Model * | getModel () const |
| const agx::Name & | getName () const |
| agx::Object * | getNextSibling () |
| const agx::Object * | getNextSibling () const |
| size_t | getNumObjects (const agx::Name &name) const |
| agx::Object * | getObject (const agx::Name &name, size_t index=0) |
| const agx::Object * | getObject (const agx::Name &name, size_t index=0) const |
| agx::Object * | getObject (const agx::Name &name, agx::Model *model, size_t index=0) |
| const agx::Object * | getObject (const agx::Name &name, agx::Model *model, size_t index=0) const |
| template<typename T > | |
| T * | getObject (const agx::Name &name, size_t index=0) |
| template<typename T > | |
| const T * | getObject (const agx::Name &name, size_t index=0) const |
| const agx::ObjectRefVector & | getObjects () const |
| template<typename T > | |
| void | getObjects (agx::ObjectPtrVector &result, bool recursive=false) const |
| void | getObjects (agx::ObjectPtrVector &result, const agx::Model *model, bool recursive=false) const |
| template<typename T > | |
| void | getObjects (ObjectPtrVector &result, bool recursive) const |
| agx::Path | getPath () const |
| agx::Path | getPath (const agx::Object *root) const |
| int | getPriority () const |
| int | getReferenceCount () const |
| agx::Object * | getResource (const agx::Path &path, agx::Model *model=nullptr) |
| const agx::Object * | getResource (const agx::Path &path, agx::Model *model=nullptr) const |
| template<typename T > | |
| T * | getResource (const agx::Path &path) |
| template<typename T > | |
| const T * | getResource (const agx::Path &path) const |
| virtual Object * | getResourceImpl (const Path &path, agx::Model *model) override |
| agx::Object * | getRootContext () |
| const agx::Object * | getRootContext () const |
| bool | getShouldStoreCompaction () const |
| Returns whether the terrain pager should store compaction data for tiles that are paged out. More... | |
| bool | getShouldStoreDeltas () |
| Return whether the terrain pager should store changes to the terrain every time step. More... | |
| Simulation * | getSimulation () |
| const Simulation * | getSimulation () const |
| agxStream::StorageAgent * | getStorageAgent () const override |
| agxTerrain::Terrain * | getTemplateTerrain () |
| Fetches the template terrain. More... | |
| TerrainDataSource * | getTerrainDataSource () |
| Returns the data source the pager uses for fetching height data for tiles. More... | |
| agx::RealPair | getTileLoadRadius (agx::RigidBody *body) |
| Get the tile readiuses for a body. More... | |
| const TileSpecification & | getTileSpecification () const |
| Specifies a new reference point for the terrain grid tiles. More... | |
| agx::Real | getTotalTerrainMass () |
| Calculates the total mass of all currently paged in terrain tiles. More... | |
| Type | getType () const |
| agx::Uuid | getUuid () const |
| bool | hasListener (EventListener *listener) |
| bool | hasParent (const agx::Object *node) const |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| bool | isEnabled () const |
| bool | isFinished () const |
| bool | isUnique () const |
| virtual void | last (const agx::TimeStamp &time) override |
| Callback from Simulation. More... | |
| 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 callbacks. More... | |
| 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 callbacks. More... | |
| virtual void | preCollide (const agx::TimeStamp &time) override |
| Callback from Simulation. More... | |
| virtual void | printSubtree () const override |
| void | printSubtree (std::ostream &stream, int depth=0) const |
| TerrainRaycastResult | raycast (agx::Vec3 start, agx::Vec3 end, agx::Vec3 &result) |
| Perform raycasting against the paged terrain. More... | |
| virtual void | rebind () override |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
| bool | remove (agx::RigidBody *body) |
| Remove body so that the terrain pager no longer uses the body when determining which terrain tiles that are needed. More... | |
| bool | remove (agxTerrain::Shovel *shovel) |
| Removes a shovel object from the terrain pager, if it exists. More... | |
| void | removeAllObjects () |
| Remove all components. More... | |
| void | removeListener (EventListener *listener) |
| virtual void | removeNotification () override |
| Performs cleanup when removed from the simulation. More... | |
| virtual void | removeObject (agx::Object *object) |
| Remove an object from the component. More... | |
| void | removeObject (const agx::Name &name, size_t index=0) |
| Remove an object with a specified name (and optional index) from the component. More... | |
| virtual void | restore (agxStream::InputArchive &in) override |
| void | restore (const agxTerrain::TileModificationVector &restoreData) |
| Restores internal data from stream. More... | |
| virtual void | save (TiXmlElement *) const |
| virtual void | setContext (agx::Object *context) |
| void | setEmbedCacheFilesInArchive (bool embed) |
| Sets if cached files written out to disk should be embeded in AGX Archives when store is called. More... | |
| void | setEnable (bool enable) |
| Specify whether the listener should react at all at events. More... | |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. More... | |
| bool | setFileCacheDirectory (agx::String dir) |
| Specify the location for there terrain tiles should be stored when cached to disk. More... | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More... | |
| void | setId (UInt32 id) |
| virtual void | setMask (int mask) override |
| Specifies a bitmask which determines which event types will activate this listener. More... | |
| void | setModel (agx::Model *model) |
| Set the object model (handled automatically). More... | |
| void | setName (const agx::Name &name) |
| Set the name of the object. More... | |
| void | setShouldStoreCompaction (bool shouldStoreCompaction, size_t maximumCompactionDepth) |
| Sets if the terrain pager should store compaction data for tiles that are paged out. More... | |
| void | setShouldStoreDeltas (bool shouldStoreDeltas) |
| Specify whether the terrain pager should store changes to the terrain every time step. More... | |
| void | setTerrainDataSource (TerrainDataSource *tds) |
| Sets the data source that the pager needs to fetch terrain tile data. More... | |
| bool | setTileLoadRadiuses (agx::RigidBody *body, agx::Real requiredTileRadius, agx::Real preloadTileRadius) |
| Set tile radiuses for a already added RigidBody. More... | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. More... | |
| virtual void | snapshot (TiXmlNode *eParent, const String &directory) const override |
| virtual void | store (agxStream::OutputArchive &out) const override |
| void | store (agxTerrain::TileModificationVector &storeData) |
| Stores internal data into stream. More... | |
| void | traverse (const TraverseCallback &callback) |
| void | traverse (ComponentVisitor *) |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
Static Public Member Functions | |
| static Component * | _load (TiXmlElement *eComponent, Device *device) |
| static agx::Model * | ClassModel () |
| static agxStream::Serializable * | create () |
| static agxStream::Serializable * | create (agxStream::InputArchive &) |
| static agx::String | generateName (const agx::String &bindPath) |
| static const HashSet< Object * > & | getActiveObjects () |
| static const char * | getConstructClassId () |
| static bool | getEnableRebind () |
| Should rebinding be allowed? Right now a global setting. More... | |
| static Component * | load (const String &path, const Path &_namespace=Path()) |
| static Component * | load (const String &path, Device *device, const Path &_namespace=Path()) |
| static Component * | load (const Path &path, const Name &implementation, Device *device, const Path &_namespace=Path()) |
| static Component * | load (TiXmlElement *eComponent, Device *device) |
| static Object * | load (const String &path, Device *device, const String &type="", size_t instance=0) |
| static Object * | load (const String &path, Device *device, const String &type, const String &attribute, const String &value) |
| static void | load (const String &path, Device *device, ObjectPtrVector &loadedObjects) |
| static TiXmlDocument | openDocument (const String &path) |
| static void | setEnableRebind (bool flag) |
| Sets if rebinding of objects should be allowed (Right now a global setting). More... | |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More... | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Public Attributes | |
| ObjectEvent | addObjectEvent |
| ObjectEvent | removeObjectEvent |
| TileLoadEvent | tileLoadEvent |
| An event that the TerrainPager will trigger after a new tile as been loaded and added to the simulation. More... | |
| TileUnloadEvent | tileUnloadEvent |
| An event that the TerrainPager will trigger just before it removes a tile from the simulation. More... | |
Protected Member Functions | |
| TerrainPager () | |
| Serializable. More... | |
| virtual | ~TerrainPager () |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
| String | expandAutoCompletionMatch (const String &query, const StringVector &matchingNames) const |
| void | generateUuid () |
| agx::Real | getOverlappingAreaSolidMass (agxTerrain::TileId, agxTerrain::TileId) |
| void | handleNewTerrainTile (agxTerrain::TerrainTile) |
| void | prepareSimulation (bool fromRestore) |
| void | setDevice (Device *device) |
| void | setSimulation (Simulation *simulation) |
| Set the associated simulation for this EventListener. More... | |
| void | unloadAllTiles () |
| void | unloadUnusedTiles (bool partOfRemoveNotification) |
| void | updateActiveTiles () |
Static Protected Member Functions | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More... | |
Protected Attributes | |
| bool | m_enabled |
| int | m_mask |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| agx::UInt32 | m_priority |
| AtomicValue | m_refCount |
| Type | m_type |
A pager that will dynamically handle terrain tiles in a agxSDK::Simulation.
The pager uses a 2D-grid and populates the grid tiles with terrain instances as needed. There is a reference point which specifies the (0,0) position for the 2D-grid. There is also a reference rotation which should be used to map the grids local Z-axis to the up direction at the reference point.
The reference point should be specified to be near the location in the world where the simulation is being performed.
In a default created Simulation with uniform gravity, the reference rotation can be set to the identity matrix since AGX uses Z as default up axis. If the gravity direction is changed and e.g. the x-z plane is used for ground and y for up, then the rotation must be set accordingly.
On the other hand, if the Simulation is being performed on a sphere (e.g Earth) with a point gravity source, then it is important that the working area is relatively close to the reference point. With Earths radius and a distance 10km away from the reference point, a height difference of a few meters can be observed due to Earths curvature. The approximation within the pager to work with a 2D-grid can handle these heigh differences within the different tiles without problem. But if the reference point is set at the north pole and the working area is near the equator problems will occur.
To track which grid tiles that needs to have active terrain instances, one or more bodies are added to the TerrainPager. The world position for those bodies will be used to determine which tiles should be available. Along with the body position, two radiuses are used:
Excavation in the Terrain works best when the excavation is being performed within a tile. Therefor tiles can have a margin so that they have a overlap to make the transition from one tile to the next work so the excavation is always kept within a single tile and never reaches a tile edge. This margin is specified via how many height values that should overlap.
If margins larger than 0 are used, then this affects which data points from each tiles heightfield that should be used for rendering to avoid drawing the same part twice.
NOTE:
Definition at line 97 of file TerrainPager.h.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Event when adding removing child objects.
NOTE: Events are triggered recursively up the parent structure Example: B is added to root node A, one event is triggered (A.addObjectEvent(A, B)). Then when C is added to B two events are triggered (B.addObjectEvent(B, C), and A.addObjectEvent(B,C))
Definition at line 61 of file Component.h.
| typedef agx::Callback2< agxTerrain::TileId, agxTerrain::Terrain* > agxTerrain::TerrainPager::TileCallback |
Callback type.
Definition at line 102 of file TerrainPager.h.
| typedef agx::Event2< agxTerrain::TileId, agxTerrain::Terrain* > agxTerrain::TerrainPager::TileLoadEvent |
Event types.
Definition at line 105 of file TerrainPager.h.
| typedef agx::Event2< agxTerrain::TileId, agxTerrain::Terrain* > agxTerrain::TerrainPager::TileUnloadEvent |
Definition at line 106 of file TerrainPager.h.
|
inherited |
Definition at line 141 of file Component.h.
|
inherited |
Defines the event states for which a listener will be activated, a mask can be bitwise OR:ed from these members.
| Enumerator | |
|---|---|
| STEP_NONE | |
| PRE_COLLIDE |
Triggered just BEFORE a simulation step is taken. |
| PRE_STEP |
Triggered just BEFORE a Dynamics stepForward step is taken. |
| POST_STEP |
Triggered just AFTER a Dynamics stepForward step is taken. |
| LAST_STEP |
Triggered last in a Simulation::stepForward call. |
| DEFAULT |
The default activation mask. |
| ALL |
All events. |
Definition at line 45 of file StepEventListener.h.
Enum with different types of result from the raycast method.
| Enumerator | |
|---|---|
| RAYCAST_NO_RESULT | |
| RAYCAST_HIT_ACTIVE_TERRAIN_TILE | |
| RAYCAST_RESULT_FROM_DATASOURCE | |
Definition at line 305 of file TerrainPager.h.
|
inherited |
Type of EventListener.
| Enumerator | |
|---|---|
| UNDEFINED_TYPE |
Undefined type. |
| STEP_EVENT_LISTENER |
Of type StepEventListener. |
| CONTACT_EVENT_LISTENER |
Of type ContactEventListener. |
| GUI_EVENT_LISTENER |
Of type GuiEventListener. |
Definition at line 42 of file EventListener.h.
| agxTerrain::TerrainPager::TerrainPager | ( | size_t | tileResolution, |
| size_t | tileOverlap, | ||
| agx::Real | tileElementSize, | ||
| agx::Real | maximumDepth, | ||
| agx::Vec3 | refPoint, | ||
| agx::Quat | refRotation, | ||
| agxTerrain::Terrain * | templateTerrain | ||
| ) |
Constructor.
Specifies tile information and the 2D-plane used for dynamic terrain tiles.
The TerrainPager do not mirror all the different parameters a terrain exposes, instead a template terrain is used for settings.
To support excavation, the terrain tiles have an optional margin. This margin can be set so that the excavation is performed within one tile and correct soil wedges are formed.
Example: tileResolution = 301, tileOverlap 10, tileElementSize = 0.25, ....
Each tile then becomes (301-1)*0.25 = 75m x 75m The overlap on each side will be 10*0.25 = 2.5m
| tileResolution | Specifies the number of height values for each dimension for (tile+margin). |
| tileOverlap | Specifies the number of height values that should overlap between two tiles. |
| tileElementSize | Size in meters for one element. Same as distance between two height values. |
| maximumDepth | How deep in meters the terrain can be excavated |
| refPoint | A world reference point for where the terrain is located |
| refRotation | A rotation that will transform the Z-axis to the up direction at the referencePoint |
| templateTerrain | A template terrain whose settings will be used for the terrain tiles. |
|
protected |
Serializable.
Default constructor.
|
protectedvirtual |
|
staticinherited |
| bool agxTerrain::TerrainPager::add | ( | agx::RigidBody * | body, |
| agx::Real | requiredTileRadius, | ||
| agx::Real | preloadTileRadius | ||
| ) |
Adds a RigidBody to the terrain pager.
The pager will make sure that terrain tiles within the required radius are present in the Simulation before stepping and tiles within the preload radius will be loaded and inserted when available.
| bool agxTerrain::TerrainPager::add | ( | agxTerrain::Shovel * | shovel, |
| agx::Real | requiredTileRadius, | ||
| agx::Real | preloadTileRadius | ||
| ) |
Adds a Shovel and its RigidBody to the terrain pager.
The pager will make sure that terrain tiles within the required radius are present in the Simulation before stepping and tiles within the preload radius will be loaded and inserted when available.
|
inherited |
|
overridevirtual |
Notification to the TerrainPager when being added to a Simulation.
Reimplemented from agxSDK::EventListener.
|
virtualinherited |
Add an object to the component.
| object | The object to be added |
| assignContext | True if the child get the component as the context, set to false to allow 'weak' coupled children |
|
inherited |
|
protectedinherited |
| void agxTerrain::TerrainPager::applyChangesToTemplateTerrain | ( | ) |
Signals to the TerrainPager that the template terrain has been updated and that any changes to the template terrain should be applied to the active terrain tiles in the pager.
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
|
virtualinherited |
Reimplemented in agx::Namespace.
|
overridevirtualinherited |
Reimplemented from agx::Object.
Reimplemented in agxData::Buffer, and agx::Model.
|
staticinherited |
|
overridevirtualinherited |
Reimplemented from agx::Object.
Reimplemented in agx::Clock, agx::Task, agx::Kernel, agx::UnresolvedTask, and agx::Clock.
|
inlinestaticinherited |
Definition at line 95 of file StepEventListener.h.
|
inlinestaticinherited |
Definition at line 95 of file StepEventListener.h.
|
protectedinherited |
|
protectedinherited |
|
inherited |
Referenced by agx::ScalarParameter::get(), agx::ArrayParameter::get(), agxData::Buffer::getArray(), and agxData::Buffer::getElement().
|
inherited |
|
inherited |
|
staticinherited |
|
protectedinherited |
|
staticinherited |
|
inherited |
Referenced by agx::Object::getAutoScopedResource().
|
inherited |
|
inherited |
Definition at line 428 of file Object.h.
References agx::Object::getAutoScopedResource(), and agx::Referenced::is().
|
inherited |
|
inlineoverridevirtualinherited |
Reimplemented from agxSDK::EventListener.
Definition at line 95 of file StepEventListener.h.
|
inlinestaticinherited |
Definition at line 95 of file StepEventListener.h.
|
inherited |
Definition at line 373 of file Object.h.
Referenced by agxData::Value::get(), and agx::Model::getNamespace().
|
inherited |
|
inherited |
|
staticprotectedinherited |
|
inherited |
Definition at line 222 of file Component.h.
Referenced by agx::Component::getDevice().
|
inherited |
Definition at line 223 of file Component.h.
References agx::Component::getDevice().
|
inherited |
|
inherited |
|
inline |
Returns if cached files should be embedded in AGX Archives used for serialization.
Definition at line 455 of file TerrainPager.h.
References agxTerrain::TerrainCache::getEmbedCacheFilesInArhive().
|
staticinherited |
Should rebinding be allowed? Right now a global setting.
|
inherited |
Definition at line 273 of file Serializable.h.
|
inherited |
| agx::String agxTerrain::TerrainPager::getFileCacheDirectory | ( | ) | const |
Return the location for where files should be temporary cached when not needed in memory.
|
inherited |
Definition at line 370 of file Object.h.
Referenced by agxData::EntityStorage::indexToId().
|
inherited |
|
inherited |
This index is given at creation of this object.
It is guaranteed to be unique for the lifetime of this library instance. As long as the application is running. This value is not serialized or restored. A new object will always get a new index no matter how it is created.
Definition at line 247 of file Serializable.h.
|
inherited |
Referenced by agxSDK::GuiEventListener::_keyboard(), agxSDK::GuiEventListener::_mouse(), agxSDK::GuiEventListener::_mouseDragged(), agxSDK::GuiEventListener::_mouseMoved(), and agxSDK::GuiEventListener::_update().
|
inherited |
|
inherited |
Definition at line 369 of file Object.h.
Referenced by agxData::Value::get(), agxData::EntityStorage::get(), agxData::FormatBinding< T >::getFormat(), and agxData::EntityPtr::operator()().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Definition at line 194 of file Component.h.
Referenced by agxData::EntityPtr::operator()().
|
inherited |
Definition at line 195 of file Component.h.
|
inherited |
Definition at line 197 of file Component.h.
|
inherited |
Definition at line 198 of file Component.h.
|
inherited |
|
inherited |
|
inherited |
Definition at line 192 of file Component.h.
Referenced by agx::Component::getObjects().
|
inherited |
|
inherited |
|
inherited |
Definition at line 241 of file Component.h.
References agx::Component::getObjects().
|
protected |
|
inherited |
Referenced by agxData::EntityStorage::dereferenceMultipliedAttribute(), agx::ScalarParameter::get(), agx::ArrayParameter::get(), agx::PointerParameter::get(), agxData::EntityInstance::verifyIndex(), and agxData::EntityPtr::verifyIndex().
|
inherited |
| root | A node along the parent path from this object. |
|
inherited |
|
inherited |
|
inherited |
Referenced by agx::Object::getResource().
|
inherited |
|
inherited |
Definition at line 414 of file Object.h.
References agx::Object::getResource(), and agx::Referenced::is().
|
inherited |
|
overridevirtualinherited |
Reimplemented from agx::Object.
Reimplemented in agx::Task, and agxData::EntityStorage.
|
inherited |
|
inherited |
| bool agxTerrain::TerrainPager::getShouldStoreCompaction | ( | ) | const |
Returns whether the terrain pager should store compaction data for tiles that are paged out.
| bool agxTerrain::TerrainPager::getShouldStoreDeltas | ( | ) |
Return whether the terrain pager should store changes to the terrain every time step.
|
inherited |
Referenced by agxUtil::GeneralContactEventListener< agxModel::TwoBodyTire >::separation().
|
inherited |
|
inlineoverridevirtualinherited |
Reimplemented from agxSDK::EventListener.
Definition at line 95 of file StepEventListener.h.
| agxTerrain::Terrain* agxTerrain::TerrainPager::getTemplateTerrain | ( | ) |
Fetches the template terrain.
The settings for the template terrain are used on new terrain tiles when they are inserted into the simulation.
| TerrainDataSource* agxTerrain::TerrainPager::getTerrainDataSource | ( | ) |
Returns the data source the pager uses for fetching height data for tiles.
| agx::RealPair agxTerrain::TerrainPager::getTileLoadRadius | ( | agx::RigidBody * | body | ) |
Get the tile readiuses for a body.
If body is not found, (-1,-1) is returned. The first number in the pair is the required radius, the second the preload radius
| const TileSpecification& agxTerrain::TerrainPager::getTileSpecification | ( | ) | const |
Specifies a new reference point for the terrain grid tiles.
This is an expensive operation and should be avoided if possible.
| agx::Real agxTerrain::TerrainPager::getTotalTerrainMass | ( | ) |
Calculates the total mass of all currently paged in terrain tiles.
The mass of the areas where tiles are overlapping is not counted twice. NOTE: The mass of the areas where tiles are overlapping might be out of sync if this method is called in a time-step where one or more vertices within the overlapping area has been modified. Which might make this calculation invalid.
|
inherited |
|
inherited |
Definition at line 268 of file Serializable.h.
|
protected |
|
inherited |
|
inherited |
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::Buffer::getElement(), and agx::Object::getResource().
|
inherited |
|
inherited |
Definition at line 252 of file Serializable.h.
|
overridevirtual |
Callback from Simulation.
Height synchronization for overlapping parts. No longer needed tiles are removed at this stage.
Reimplemented from agxSDK::StepEventListener.
|
staticinherited |
|
staticinherited |
|
staticinherited |
|
staticinherited |
|
staticinherited |
Definition at line 379 of file Object.h.
References agx::Object::load().
|
staticinherited |
Definition at line 386 of file Object.h.
References agx::Object::load().
|
staticinherited |
|
staticinherited |
|
inlinevirtualinherited |
Called after a step is taken in the simulation Implement this method in the derived class to get callbacks.
| time | - the current simulation time |
Reimplemented in agxModel::Tree::TreeStepEventListener, agxModel::WindAndWaterController, agxModel::Terrain, agxModel::FractureGenerator, agxControl::EventSensor, agxSDK::SimulationStatisticsListener, agxQt::ParticleSystemRenderUtility, agxModel::ContactGenerator, agxPython::ReactiveScript, agx::GranularImpactDataWriter, agxModel::HeightFieldDeformerJournalRecorder, agxUtil::StepEventCallback, agxOSG::TerrainGridRenderer, agx::GranularDataExporter, agxOSG::TerrainHeightColorRenderer, agxSDK::SimulationSerializer, agxOSG::CableDamageDataRenderer, agxPowerLine::PowerLinesHandler, agx::ContactForceFilter, agx::JournalCustomDataRecorder, agxOSG::TerrainRenderer, agxSDK::LogListener, agxOSG::TreeRenderer, agxUnit::BodyCaptureDeterminism, and agxDriveTrain::EngineDampingUpdater.
Definition at line 108 of file StepEventListener.h.
|
inlinevirtualinherited |
Called before a step is taken in the simulation Implement this method in the derived class to get callbacks.
| time | - the current simulation time |
Reimplemented in agxModel::Tree::TreeStepEventListener, agxModel::WindAndWaterController, agxSensor::JoystickManager, agxModel::Terrain, agxSDK::SimulationStatisticsListener, agxModel::FractureGenerator, agxControl::EventSensor, agxQt::ParticleSystemRenderUtility, agxModel::ContactGenerator, agx::GranularImpactDataWriter, agxModel::HeightFieldDeformerJournalRecorder, agxSensor::Joystick, agxUtil::StepEventCallback, agx::GranularDataExporter, agxSDK::SimulationSerializer, agxPowerLine::PowerLinesHandler, agxSDK::LogListener, agx::JournalCustomDataRecorder, agxDriveTrain::EngineDampingUpdater, and agxLua::GarbageListener.
Definition at line 107 of file StepEventListener.h.
|
overridevirtual |
Callback from Simulation.
Ready preloaded terraintiles are inserted at this stage.
Reimplemented from agxSDK::StepEventListener.
|
protected |
|
overridevirtualinherited |
Reimplemented from agx::Object.
|
inherited |
| TerrainRaycastResult agxTerrain::TerrainPager::raycast | ( | agx::Vec3 | start, |
| agx::Vec3 | end, | ||
| agx::Vec3 & | result | ||
| ) |
Perform raycasting against the paged terrain.
Test via active tiles:
If a terrain tile is modified and then paged out, a result from the datasource will not show those modifications. For best results, raycasting should be performed against paged in tiles.
|
overridevirtualinherited |
Reimplemented from agx::Object.
Reimplemented in agx::Task, and agx::Clock.
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
Referenced by agxData::Val< UInt >::Val().
| bool agxTerrain::TerrainPager::remove | ( | agx::RigidBody * | body | ) |
Remove body so that the terrain pager no longer uses the body when determining which terrain tiles that are needed.
| bool agxTerrain::TerrainPager::remove | ( | agxTerrain::Shovel * | shovel | ) |
Removes a shovel object from the terrain pager, if it exists.
|
inherited |
Remove all components.
|
inherited |
|
overridevirtual |
Performs cleanup when removed from the simulation.
Reimplemented from agxSDK::EventListener.
|
virtualinherited |
Remove an object from the component.
Remove an object with a specified name (and optional index) from the component.
|
overridevirtualinherited |
Reimplemented from agxSDK::EventListener.
Reimplemented in agxModel::WindAndWaterController, agxModel::Terrain, agxControl::EventSensor, agxModel::FractureGenerator, agxModel::DeformableParticleCreator, agxSDK::SimulationStatisticsListener, agx::GranularImpactDataWriter, agxModel::HeightFieldDeformerJournalRecorder, agxControl::MeasurementSensor, agxModel::DeformableMineFace, agx::JournalCustomDataRecorder, agxModel::HeightFieldDeformer, and agxDriveTrain::EngineDampingUpdater.
| void agxTerrain::TerrainPager::restore | ( | const agxTerrain::TileModificationVector & | restoreData | ) |
Restores internal data from stream.
|
inlinevirtualinherited |
Reimplemented in agx::Clock.
|
virtualinherited |
Reimplemented in agx::Task, and agxData::FunctionValue.
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
|
inline |
Sets if cached files written out to disk should be embeded in AGX Archives when store is called.
Default false.
Definition at line 449 of file TerrainPager.h.
References agxTerrain::TerrainCache::setEmbedCacheFilesInArchive().
|
inherited |
Specify whether the listener should react at all at events.
| enable | - If false, the listener will not be activated during any events |
|
staticinherited |
Sets if rebinding of objects should be allowed (Right now a global setting).
Allowing it when adding larger parts to the system tree might hit performance, so it might be smarter to disable it first, then add, and then enable again.
|
inherited |
Set to false to disable serialization of this object.
It will just be ignored during serialization (writing). It is still possible to restore TO this object.
|
staticinherited |
Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
| bool agxTerrain::TerrainPager::setFileCacheDirectory | ( | agx::String | dir | ) |
Specify the location for there terrain tiles should be stored when cached to disk.
|
inherited |
Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
|
overridevirtualinherited |
Specifies a bitmask which determines which event types will activate this listener.
| mask | - bitwise or:ed mask for the event types (ActivationMask) for which events this event listener will be activated |
Reimplemented from agxSDK::EventListener.
|
inherited |
Set the object model (handled automatically).
| void agxTerrain::TerrainPager::setShouldStoreCompaction | ( | bool | shouldStoreCompaction, |
| size_t | maximumCompactionDepth | ||
| ) |
Sets if the terrain pager should store compaction data for tiles that are paged out.
| shouldStoreCompaction | Bool flag to set if compction should be stored. |
| maximumCompactionDepth | Sets how deep compaction data should be stored. Specifically how many voxels below the surface. |
| void agxTerrain::TerrainPager::setShouldStoreDeltas | ( | bool | shouldStoreDeltas | ) |
Specify whether the terrain pager should store changes to the terrain every time step.
Should only be true if restore function is planned to be used.
|
protectedinherited |
Set the associated simulation for this EventListener.
Referenced by agxOSG::PickHandler::setSimulation().
| void agxTerrain::TerrainPager::setTerrainDataSource | ( | TerrainDataSource * | tds | ) |
Sets the data source that the pager needs to fetch terrain tile data.
| bool agxTerrain::TerrainPager::setTileLoadRadiuses | ( | agx::RigidBody * | body, |
| agx::Real | requiredTileRadius, | ||
| agx::Real | preloadTileRadius | ||
| ) |
Set tile radiuses for a already added RigidBody.
If a radius is negative, then it is ignored making it possible to have a body that does not require any tiles but can be used to preload tiles.
Explicitly set a Uuid on a serializable object.
Use this method with great care, as it can result in non-unique identifiers in the system!
|
overridevirtualinherited |
Reimplemented from agx::Object.
|
overridevirtualinherited |
Reimplemented from agxSDK::EventListener.
Reimplemented in agxModel::WindAndWaterController, agxModel::Terrain, agxControl::EventSensor, agxModel::FractureGenerator, agxModel::DeformableParticleCreator, agxSDK::SimulationStatisticsListener, agx::GranularImpactDataWriter, agxModel::HeightFieldDeformerJournalRecorder, agxControl::MeasurementSensor, agxModel::DeformableMineFace, agx::JournalCustomDataRecorder, agxModel::HeightFieldDeformer, and agxDriveTrain::EngineDampingUpdater.
| void agxTerrain::TerrainPager::store | ( | agxTerrain::TileModificationVector & | storeData | ) |
Stores internal data into stream.
|
inherited |
|
inherited |
|
protected |
|
protected |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
|
protected |
|
staticinherited |
|
inherited |
Definition at line 63 of file Component.h.
|
protectedinherited |
Definition at line 124 of file EventListener.h.
|
protectedinherited |
Definition at line 123 of file EventListener.h.
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
protectedinherited |
Definition at line 125 of file EventListener.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
|
protectedinherited |
Definition at line 121 of file EventListener.h.
|
inherited |
Definition at line 64 of file Component.h.
| TileLoadEvent agxTerrain::TerrainPager::tileLoadEvent |
An event that the TerrainPager will trigger after a new tile as been loaded and added to the simulation.
Definition at line 348 of file TerrainPager.h.
| TileUnloadEvent agxTerrain::TerrainPager::tileUnloadEvent |
An event that the TerrainPager will trigger just before it removes a tile from the simulation.
Definition at line 354 of file TerrainPager.h.