Add terrain material layer painting
CI / Format, lint, test, build (push) Waiting to run

This commit is contained in:
Rbanh committed 2026-07-12 21:00:13 -04:00
1 parent 293811aecd
commit d1a56f77cc
23 files changed
+1730 -62

No files matched your search

+8 -8
View File
@@ -41,11 +41,11 @@ impl TerrainSculptMode {
}
#[derive(Debug, Clone, Copy)]
struct TerrainHit {
entity: Entity,
local: Vec3,
world: Vec3,
world_rotation: Quat,
pub(super) struct TerrainHit {
pub(super) entity: Entity,
pub(super) local: Vec3,
pub(super) world: Vec3,
pub(super) world_rotation: Quat,
}
#[derive(Debug, Clone)]
@@ -324,7 +324,7 @@ fn sculpt_history_label(mode: TerrainSculptMode) -> &'static str {
}
}
fn active_scene_ray(
pub(super) fn active_scene_ray(
cameras: &Query<(&Camera, &GlobalTransform), With<EditorCamera>>,
pointer: bevy_egui::egui::Pos2,
scene_rect: bevy_egui::egui::Rect,
@@ -336,7 +336,7 @@ fn active_scene_ray(
scene_view_ray(camera, transform, pointer, scene_rect)
}
fn terrain_ray_hit(
pub(super) fn terrain_ray_hit(
entity: Entity,
terrain: &TerrainDesc,
global: &GlobalTransform,
@@ -495,7 +495,7 @@ fn apply_dab(
}
}
fn smooth_falloff(normalized_distance: f32) -> f32 {
pub(super) fn smooth_falloff(normalized_distance: f32) -> f32 {
let t = (1.0 - normalized_distance).clamp(0.0, 1.0);
t * t * (3.0 - 2.0 * t)
}