Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
# Unreleased

## Breaking Changes

### SceneNode3d and SceneNode2d: Recursive vs Non-Recursive Methods

Methods that previously modified both a node and all its descendants now only modify the current node.
Use the new `_recursive` suffix variants for the previous behavior.

**Renamed methods (now non-recursive by default):**

`SceneNode3d`:
- `set_material`, `set_material_with_name`
- `set_color`, `set_texture`, `set_texture_from_file`, `set_texture_from_memory`, `set_texture_with_name`
- `set_lines_width`, `set_lines_color`, `set_points_size`, `set_points_color`
- `set_surface_rendering_activation`, `enable_backface_culling`
- `set_local_scale`, `set_visible`
- `set_metallic`, `set_roughness`, `set_emissive`
- `set_normal_map`, `set_normal_map_from_file`, `set_normal_map_from_memory`, `set_normal_map_with_name`
- `set_ao_map`, `set_ao_map_from_file`, `set_ao_map_from_memory`, `set_ao_map_with_name`
- `set_emissive_map`, `set_emissive_map_from_file`, `set_emissive_map_from_memory`, `set_emissive_map_with_name`
- `modify_vertices`, `read_vertices`, `recompute_normals`, `modify_normals`, `read_normals`
- `modify_uvs`, `read_uvs`, `modify_faces`, `read_faces`

`SceneNode2d`:
- `set_material`, `set_material_with_name`
- `set_color`, `set_texture`, `set_texture_from_file`, `set_texture_from_memory`, `set_texture_with_name`
- `set_lines_width`, `set_lines_color`, `set_points_size`, `set_points_color`
- `set_surface_rendering_activation`
- `set_local_scale`, `set_visible`
- `modify_vertices`, `read_vertices`, `modify_uvs`, `read_uvs`, `modify_faces`, `read_faces`

**New recursive variants:**
All the above methods now have `_recursive` suffix versions (e.g., `set_color_recursive`) that apply to the node and all descendants.

**Helper method renames:**
- `apply_to_objects_mut` → `apply_to_objects_mut_recursive` / `apply_to_object_mut` (new)
- `apply_to_objects` → `apply_to_objects_recursive` / `apply_to_object` (new)
- `apply_to_scene_nodes_mut` → `apply_to_scene_nodes_mut_recursive`
- `apply_to_scene_nodes` → `apply_to_scene_nodes_recursive`

# v0.39.1

Update website links in documentations.
Expand Down
4 changes: 2 additions & 2 deletions examples/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ async fn main() {

g1.add_cube(1.0, 5.0, 1.0);
g1.add_cube(5.0, 1.0, 1.0);
g1.set_color(RED);
g1.set_color_recursive(RED);

g2.add_cube(1.0, 5.0, 1.0);
g2.add_cube(1.0, 1.0, 5.0);
g2.set_color(GREEN);
g2.set_color_recursive(GREEN);

let rot1 = Quat::from_axis_angle(Vec3::Y, 0.014);
let rot2 = Quat::from_axis_angle(Vec3::X, 0.014);
Expand Down
6 changes: 2 additions & 4 deletions examples/rectangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ async fn main() {
let mut window = Window::new("Kiss3d: rectangle").await;
let mut camera = PanZoomCamera2d::new(Vec2::ZERO, 5.0);
let mut scene = SceneNode2d::empty();
let mut c = scene.add_rectangle(100.0, 150.0);

c.set_color(RED);
let mut c = scene.add_rectangle(100.0, 150.0).set_color(RED);

let rot = 0.014;

while window.render_2d(&mut scene, &mut camera).await {
c.append_rotation(rot);
c.rotate(rot);
}
}
Loading