LDKTerrainChannel
typedef enum LDKTerrainChannel{
LDK_TERRAIN_CHANNEL_R=0,
LDK_TERRAIN_CHANNEL_G,
LDK_TERRAIN_CHANNEL_B,
LDK_TERRAIN_CHANNEL_A
}LDKTerrainChannel;
typedef enum LDKTerrainChannel{
LDK_TERRAIN_CHANNEL_R=0,
LDK_TERRAIN_CHANNEL_G,
LDK_TERRAIN_CHANNEL_B,
LDK_TERRAIN_CHANNEL_A
}LDKTerrainChannel;
typedef struct LDKTerrainSystem{
LDKAssetImage heightmap;
LDKTerrainChannel height_channel;
float cell_size;
float height_scale;
float height_offset;
bool center_on_origin;
float origin_x;
float origin_z;
u32 chunk_size;
LDKAssetMaterial material;
LDKAssetTextureAtlas texture_atlas;
u32 surface_count;
XSmallstr surface_0_name;
float surface_0_min_height;
float surface_0_blend_width;
rgba32 surface_0_color;
u64 surface_0_sprite_id;
Vec2 surface_0_uv_scale;
float surface_0_texture_weight;
XSmallstr surface_1_name;
float surface_1_min_height;
float surface_1_blend_width;
rgba32 surface_1_color;
u64 surface_1_sprite_id;
Vec2 surface_1_uv_scale;
float surface_1_texture_weight;
XSmallstr surface_2_name;
float surface_2_min_height;
float surface_2_blend_width;
rgba32 surface_2_color;
u64 surface_2_sprite_id;
Vec2 surface_2_uv_scale;
float surface_2_texture_weight;
XSmallstr surface_3_name;
float surface_3_min_height;
float surface_3_blend_width;
rgba32 surface_3_color;
u64 surface_3_sprite_id;
Vec2 surface_3_uv_scale;
float surface_3_texture_weight;
XSmallstr surface_4_name;
float surface_4_min_height;
float surface_4_blend_width;
rgba32 surface_4_color;
u64 surface_4_sprite_id;
Vec2 surface_4_uv_scale;
float surface_4_texture_weight;
XSmallstr surface_5_name;
float surface_5_min_height;
float surface_5_blend_width;
rgba32 surface_5_color;
u64 surface_5_sprite_id;
Vec2 surface_5_uv_scale;
float surface_5_texture_weight;
XSmallstr surface_6_name;
float surface_6_min_height;
float surface_6_blend_width;
rgba32 surface_6_color;
u64 surface_6_sprite_id;
Vec2 surface_6_uv_scale;
float surface_6_texture_weight;
XSmallstr surface_7_name;
float surface_7_min_height;
float surface_7_blend_width;
rgba32 surface_7_color;
u64 surface_7_sprite_id;
Vec2 surface_7_uv_scale;
float surface_7_texture_weight;
bool casts_shadows;
u32 data_width;
u32 data_height;
u32 chunk_count;
u32 visible_chunk_count;
u32 mesh_update_count;
bool has_geometry;
}LDKTerrainSystem;
Query terrain height at a world-space X/Z point.
LDK_API bool ldk_terrain_height_at_world(
float world_x,
float world_z,
float *out_height
);
float world_xfloat world_zfloat *out_heightTrue if the operation succeeds; false otherwise.
Initialize the terrain system.
int ldk_terrain_system_initialize(void *data);
void *dataSystem initialization status code.
Check whether the terrain system is active.
LDK_API bool ldk_terrain_system_is_active(void);
True when the queried condition holds; false otherwise.
Shut down the terrain system.
void ldk_terrain_system_terminate(void *data);
void *dataUpdate the terrain system.
void ldk_terrain_system_update(
void *data,
const LDKEntityGroup *group,
float dt
);
void *dataconst LDKEntityGroup *groupfloat dt