Class THeightmap

Unit

Declaration

type THeightmap = class(TObject)

Description

Contains and manages the heightmap.

Please refer to the unit's documentation for more information.

See also
TWorld3D.Heightmap
Heightmap.
SetData
Set heightmap data.

Hierarchy

  • TObject
  • THeightmap

Overview

Methods

Public constructor Create;
Public destructor Destroy; override;
Public procedure Clear;
Public procedure SetData (aHeightmapBmp, aTextureBmp: ALLEGRO_BITMAPptr);
Public function GetHeightAt (const aPosition: TVector3D): Single; overload;
Public function GetHeightAt (const aX, aZ: GLfloat): Single; overload;
Public procedure Render (const aX, aZ: Single);

Properties

Public property MapScale: Single read fMapScale write SetMapScale;
Public property HeightScale: Single read fHeightScale write SetHeightScale;
Public property OwnsTextureMap: Boolean read GetOwnsTextureMap write SetOwnstextureMap;
Public property Visible: Boolean read fVisible write fVisible;
Public property UseLight: Boolean read fLight write fLight;
Public property TextureMap: ALLEGRO_BITMAPptr read GetTextureMap write SetTextureMap;

Description

Methods

Public constructor Create;

Constructor.

Public destructor Destroy; override;

Destructor.

Public procedure Clear;

Release all resources used by heightmap.

This removes all heightmap data, including the TextureMap. It also sets Visible to False.

See also
THeightmap.SetData
Set heightmap data.
THeightmap.TextureMap
Access to the texture map.
THeightmap.Visible
Is it visible?

Default if False.

Public procedure SetData (aHeightmapBmp, aTextureBmp: ALLEGRO_BITMAPptr);

Set heightmap data.

Bitmaps doesn't need to be the same size but heightmap size must be power of two and at least of 512 by 512 pixels.

Calling this method won't change the Visible property.

Parameters
aHeightmapBmp
A bitmap containing the heightmap data. If it's 8bpp it will use the index, else it will use the red channel.
aTextureBmp
A bitmap containing the texture used to map the heightmap.
See also
THeightmap.TextureMap
Access to the texture map.
THeightmap.Clear
Release all resources used by heightmap.
THeightmap.OwnsTextureMap
Should free the texture map when destroyed.
THeightmap.MapScale
Factor to scale map.
THeightmap.HeightScale
Factor to scale height.
Public function GetHeightAt (const aPosition: TVector3D): Single; overload;

Return height in the given point.

Public function GetHeightAt (const aX, aZ: GLfloat): Single; overload;
 
Public procedure Render (const aX, aZ: Single);

Render the heightmap.

Parameters
aX
Camera X coordinates
aZ
Camera Z coordinate.
See also
THeightmap.Visible
Is it visible?

Default if False.

THeightmap.UseLight
Should use lights when rendering the heightmap.

Properties

Public property MapScale: Single read fMapScale write SetMapScale;

Factor to scale map.

See also
THeightmap.HeightScale
Factor to scale height.
Public property HeightScale: Single read fHeightScale write SetHeightScale;

Factor to scale height.

See also
THeightmap.MapScale
Factor to scale map.
Public property OwnsTextureMap: Boolean read GetOwnsTextureMap write SetOwnstextureMap;

Should free the texture map when destroyed.

See also
THeightmap.TextureMap
Access to the texture map.
THeightmap.SetData
Set heightmap data.
Public property Visible: Boolean read fVisible write fVisible;

Is it visible?

Default if False.

See also
THeightmap.Render
Render the heightmap.
THeightmap.Clear
Release all resources used by heightmap.
Public property UseLight: Boolean read fLight write fLight;

Should use lights when rendering the heightmap.

Setting it to False may improve the heightmap looking if the texture map includes shading. Also would make it render a tad faster.

Default is True

See also
THeightmap.Render
Render the heightmap.
THeightmap.TextureMap
Access to the texture map.
Public property TextureMap: ALLEGRO_BITMAPptr read GetTextureMap write SetTextureMap;

Access to the texture map.

See also
THeightmap.OwnsTextureMap
Should free the texture map when destroyed.
THeightmap.SetData
Set heightmap data.

Generated by PasDoc 0.15.0. Generated on 2025-07-31 11:41:01.