AGX Dynamics  2.37.2.0
agxTerrain::TileSpecification Class Reference

A TileSpecification determines where in the world a 2D TileId is located and contains utility methods for coordinate transforms. More...

#include <TileSpecification.h>

Public Member Functions

 TileSpecification (agx::Vec3 refPoint, agx::Quat refRotation, agx::Real tileSize, size_t marginSize, size_t resolution, agx::Real maxDepth)
 Constructor. More...
 
 TileSpecification ()
 
agx::Vec3 convertTilePositionToWorld (agxTerrain::TileId id, agx::Vec2 tilePos) const
 Convert a local position in a tile to world coordinates. More...
 
agx::Vec3 convertTilePositionToWorld (agxTerrain::TileId id, agx::Vec3 tilePos) const
 The 2D version of this method is the same as calling this method with agx::Vec3(x,y,0) More...
 
agxTerrain::TileId convertWorldCoordinateToTileId (agx::Vec3 worldPos) const
 
agx::Vec3 convertWorldCoordinateToTilePosition (agx::Vec3 worldPos) const
 Return position in coordinate system defined by the XY-plane with local Z upwards. More...
 
agx::Real getMaximumDepth () const
 
agx::Vec3 getReferencePoint () const
 
agx::Quat getReferenceRotation () const
 
agx::Vec3 getTileCenter (agxTerrain::TileId id) const
 Return the local center position for tile id in the plane with tiles. More...
 
size_t getTileMarginSize () const
 
size_t getTileResolution () const
 
agx::Real getTileSize () const
 The full size of a tile. More...
 
agx::AffineMatrix4x4 getTileTransform (agxTerrain::TileId id, agx::Real zPos=0) const
 Return the transform that can be used to place the tile id correctly. More...
 
agx::AffineMatrix4x4 getTileTransform (agxTerrain::TileId id, agx::Vec3 localOffset) const
 Return a transform that can be used to position something at localOffset in the tile with id. More...
 

Detailed Description

A TileSpecification determines where in the world a 2D TileId is located and contains utility methods for coordinate transforms.

Definition at line 69 of file TileSpecification.h.

Constructor & Destructor Documentation

◆ TileSpecification() [1/2]

agxTerrain::TileSpecification::TileSpecification ( agx::Vec3  refPoint,
agx::Quat  refRotation,
agx::Real  tileSize,
size_t  marginSize,
size_t  resolution,
agx::Real  maxDepth 
)

Constructor.

Parameters
refPointReference point for 2d-grid used to positioning terrain tiles
refRotationReference rotation for 2d-grid
tileSizeSize in meter for a grid tile
marginSizeNumber of height values that should overlap on neighbor tiles
resolutionResolution for the tiles
maxDepthMaximum excavation depth for a tile

◆ TileSpecification() [2/2]

agxTerrain::TileSpecification::TileSpecification ( )

Member Function Documentation

◆ convertTilePositionToWorld() [1/2]

agx::Vec3 agxTerrain::TileSpecification::convertTilePositionToWorld ( agxTerrain::TileId  id,
agx::Vec2  tilePos 
) const

Convert a local position in a tile to world coordinates.

Parameters
idWhich tile
tilePoslocal position in tile
Returns
World position for a 2D position in a given tile

Definition at line 218 of file TileSpecification.h.

◆ convertTilePositionToWorld() [2/2]

agx::Vec3 agxTerrain::TileSpecification::convertTilePositionToWorld ( agxTerrain::TileId  id,
agx::Vec3  tilePos 
) const

The 2D version of this method is the same as calling this method with agx::Vec3(x,y,0)

Parameters
idWhich tile
tilePoslocal position in tile
Returns
World position for a 3D position in a given tile.

◆ convertWorldCoordinateToTileId()

agxTerrain::TileId agxTerrain::TileSpecification::convertWorldCoordinateToTileId ( agx::Vec3  worldPos) const
Returns
The TileId which contains the position pos

◆ convertWorldCoordinateToTilePosition()

agx::Vec3 agxTerrain::TileSpecification::convertWorldCoordinateToTilePosition ( agx::Vec3  worldPos) const

Return position in coordinate system defined by the XY-plane with local Z upwards.

Definition at line 224 of file TileSpecification.h.

◆ getMaximumDepth()

agx::Real agxTerrain::TileSpecification::getMaximumDepth ( ) const
Returns
Maximum excavation depth for a tile

Definition at line 213 of file TileSpecification.h.

◆ getReferencePoint()

agx::Vec3 agxTerrain::TileSpecification::getReferencePoint ( ) const
Returns
The world reference point

Definition at line 188 of file TileSpecification.h.

◆ getReferenceRotation()

agx::Quat agxTerrain::TileSpecification::getReferenceRotation ( ) const
Returns
Reference rotation for Z-axis

Definition at line 193 of file TileSpecification.h.

◆ getTileCenter()

agx::Vec3 agxTerrain::TileSpecification::getTileCenter ( agxTerrain::TileId  id) const

Return the local center position for tile id in the plane with tiles.

◆ getTileMarginSize()

size_t agxTerrain::TileSpecification::getTileMarginSize ( ) const
Returns
The margin size

Definition at line 203 of file TileSpecification.h.

◆ getTileResolution()

size_t agxTerrain::TileSpecification::getTileResolution ( ) const
Returns
How many height values that are used per dimension for tile

Definition at line 208 of file TileSpecification.h.

◆ getTileSize()

agx::Real agxTerrain::TileSpecification::getTileSize ( ) const

The full size of a tile.

Returns
The side length for a square tile

Definition at line 198 of file TileSpecification.h.

◆ getTileTransform() [1/2]

agx::AffineMatrix4x4 agxTerrain::TileSpecification::getTileTransform ( agxTerrain::TileId  id,
agx::Real  zPos = 0 
) const

Return the transform that can be used to place the tile id correctly.

Definition at line 231 of file TileSpecification.h.

References agx::AffineMatrix4x4T< Real >::translate().

◆ getTileTransform() [2/2]

agx::AffineMatrix4x4 agxTerrain::TileSpecification::getTileTransform ( agxTerrain::TileId  id,
agx::Vec3  localOffset 
) const

Return a transform that can be used to position something at localOffset in the tile with id.

Definition at line 240 of file TileSpecification.h.

References agx::AffineMatrix4x4T< Real >::translate().


The documentation for this class was generated from the following file: