|
AGX Dynamics
2.35.0.1
|
Abstract interface for requesting height data for a Terrain tile. More...
#include <TerrainDataSource.h>
Inheritance diagram for agxTerrain::TerrainDataSource:Public Types | |
| typedef agx::RealVector | TerrainHeightType |
| Datatype used for returning height values. More... | |
Public Member Functions | |
| AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agxTerrain::TerrainDataSource) | |
| virtual TerrainHeightType | fetchTerrainTile (const TileSpecification &ts, agxTerrain::TileId id)=0 |
| Return height data for requested tile according to the TileSpecification. More... | |
| virtual bool | raycast (agx::Vec3 start, agx::Vec3 end, agx::Vec3 &raycastResult) |
| Perform raycasting against the terrain. More... | |
| virtual void | restore (agxStream::InputArchive &in) override |
| virtual void | store (agxStream::OutputArchive &out) const override |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. More... | |
| Referenced (const Referenced &) | |
| 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 |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. More... | |
| 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... | |
| 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... | |
Public Member Functions inherited from agxStream::Serializable | |
| virtual | ~Serializable () |
| Destructor for normal C++ use but hidden from SWIG bindings. More... | |
| virtual const char * | getClassName () const |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. More... | |
| virtual StorageAgent * | getStorageAgent () const =0 |
| agx::Uuid | getUuid () const |
| bool | isFinished () const |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. More... | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More... | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Public Member Functions inherited from agxStream::Serializable | |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More... | |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. More... | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Protected Member Functions inherited from agxStream::Serializable | |
| Serializable () | |
| Default constructor. More... | |
| Serializable (const Serializable &other) | |
| Copy constructor. More... | |
| void | generateUuid () |
Static Protected Member Functions inherited from agx::Referenced | |
| 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 inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Abstract interface for requesting height data for a Terrain tile.
Definition at line 39 of file TerrainDataSource.h.
Datatype used for returning height values.
Definition at line 46 of file TerrainDataSource.h.
| agxTerrain::TerrainDataSource::AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE | ( | agxTerrain::TerrainDataSource | ) |
|
pure virtual |
Return height data for requested tile according to the TileSpecification.
The returned vector should have ts.getTileResolution squared number of height values. If the TerrainDataSource is not able to provide data, an empty vector can be returned.
Upon no data returned, the TerrainCache will reply to the TerrainPager with the requested TileId id but having no terrain instance signaling that the request was processed but could not be fullfilled. In this scenario, there will be an empty tile where it should have been a terrain instance and the same tile will be requested again on the next stepForward.
| ts | - The specification of how new tiles are created by the data source |
| id | - The id or position of the tile relative to other paged terrain tiles |
Implemented in agxTerrain::ExternalTerrainDataSource, and agxTerrain::TerrainRasterizer.
|
virtual |
Perform raycasting against the terrain.
This can be called by the TerrainPager when TerrainPager::raycast is used and no active tile is hit.
Default implementation returns false. Classes inheriting from TerrainDataSource can overload this method and add support if possible.
| start | - The start position of the raycast |
| end | - The end position of the raycast |
| raycastResult | - A reference to a Vec3 in which to store the point where the raycast hits the data source, |
Reimplemented in agxTerrain::ExternalTerrainDataSource, and agxTerrain::TerrainRasterizer.
|
overridevirtual |
Reimplemented in agxTerrain::ExternalTerrainDataSource, and agxTerrain::TerrainRasterizer.
|
overridevirtual |
Reimplemented in agxTerrain::ExternalTerrainDataSource, and agxTerrain::TerrainRasterizer.