Class TCastleTerrainData

Unit

Declaration

type TCastleTerrainData = class(TCastleComponent)

Description

Terrain (height map) data that can be used for TCastleTerrain.Data.

Hierarchy

Overview

Methods

Protected procedure DoChange;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public function Height(const Coord, TexCoord: TVector2): Single; virtual; abstract;
Public procedure AddChangeNotification(const Notify: TNotifyEvent);
Public procedure RemoveChangeNotification(const Notify: TNotifyEvent);

Description

Methods

Protected procedure DoChange;

Use this in descendants implementation to notify that data (affecting Height results) changed. In the base class, it takes care to run notifications registered by AddChangeNotification.

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Public destructor Destroy; override;

This item has no description.

Public function Height(const Coord, TexCoord: TVector2): Single; virtual; abstract;

Return height for given terrain point.

Parameters
Coord
The queried terrain height. Coord.X is the X position in local terrain coordinate space. Coord.Y is the Z position in local terrain coordinate space. They are in the range determined by TCastleTerrain.Size.
TexCoord
The texture coordinate at this point, assuming that TCastleTerrain.Size and texture UV scale would cancel each other, making both TexCoord.X and TexCoord.Y always in [0..1] range.

Note that TexCoord.Y grows in different direction than Coord.Y, this means that textures have natural look when viewer from above the terrain (otherwise they would seem flipped in one direction in CGE right-handed coordinate system).

Public procedure AddChangeNotification(const Notify: TNotifyEvent);

Add notification when data (affecting Height results) changes.

Public procedure RemoveChangeNotification(const Notify: TNotifyEvent);

Remove notification when data (affecting Height results) changes.


Generated by PasDoc 0.16.0-snapshot.