Class HeightFieldGeometry#

Inheritance Relationships#

Base Type#

Class Documentation#

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

Northwest-origin 2D heightfield with fixed X/Y extents and sampled Z values.

The height matrix is indexed as (row, column). Grid sample (0, 0) is located at the local origin. Increasing the column index advances toward +X (east), while increasing the row index advances toward -Y (south). Consequently, the heightfield occupies [0, size_x] x [-size_y, 0] in its local frame.

See Scene layer for more discussion on the scene layer.

Public Types

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

Height samples indexed as (row, column), with rows toward -Y and columns toward +X.

Public Functions

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

Construct a northwest-origin heightfield.

Parameters:
  • size_x – Extent in the positive local X direction; finite and positive.

  • size_y – Extent in the negative local Y direction; finite and positive.

  • heights – Height grid with at least two rows and columns. Entry (0, 0) is at local (0, 0); columns advance toward positive X and rows advance toward negative Y.

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#
Returns:

A triangle mesh using the same northwest-origin local frame.

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

Local bounds spanning [0, size_x] x [-size_y, 0].

Public Members

const float size_x#

Extent in the positive local X direction.

const float size_y#

Extent in the negative local Y direction, stored as a positive length.

const Float2Grid heights#

Height samples with rows toward -Y and columns toward +X.

Public Static Functions

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

Create a northwest-origin heightfield.

Parameters:
  • size_x – Extent in the positive local X direction; finite and positive.

  • size_y – Extent in the negative local Y direction; finite and positive.

  • heights – Height grid with at least two rows and columns. Entry (0, 0) is at local (0, 0); columns advance toward positive X and rows advance toward negative Y.

Returns:

A pointer to the new heightfield geometry.