Class HeightFieldGeometry#

Inheritance Relationships#

Base Type#

Class Documentation#

class HeightFieldGeometry : public Karana::Scene::AbstractStaticGeometry#

Geometry class for a 2D heightfield with a given x, y extent and z values on a grid.

See Scene layer for more discussion on the scene layer.

Public Types

using Float2Grid = Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic>#

2-D grid with the same layout type as coal

Public Functions

HeightFieldGeometry(float size_x, float size_y, const Float2Grid &heights)#

HeightFieldGeometry constructor from side-lengths. The constructor is not meant to be called directly. Please use the corresponding create(…) method instead to create an instance.

Parameters:
  • size_x – side length in the x direction

  • size_y – side length in the y direction

  • heights – 2D grid of heights, with top-left corner at [0, 0] entry

HeightFieldGeometry(const HeightFieldGeometry&)#

Copy constructor.

HeightFieldGeometry &operator=(const HeightFieldGeometry&) = delete#
HeightFieldGeometry(HeightFieldGeometry&&) = delete#
HeightFieldGeometry &operator=(HeightFieldGeometry&&) = delete#
virtual Karana::Core::ks_ptr<StaticMeshGeometry> computeMesh() const override#

Convert to a triangular mesh.

Returns:

The converted mesh

virtual Karana::Math::AABB aabb() const override#

Compute the axis-aligned bounding box (AABB).

Returns:

The AABB

Public Members

const float size_x#

side length in the x direction

const float size_y#

side length in the y direction

const Float2Grid heights#

side length in the z direction

Public Static Functions

static Karana::Core::ks_ptr<HeightFieldGeometry> create(float size_x, float size_y, const Float2Grid &heights)#

Create a new instance of HeightFieldGeometry from side-lengths.

Parameters:
  • size_x – side length in the x direction

  • size_y – side length in the y direction

  • heights – 2D grid of heights, with top-left at [0, 0] entry

Returns:

A pointer to the newly created instance of HeightFieldGeometry.