Skip to content

Commit

Permalink
[#72] Fix backside
Browse files Browse the repository at this point in the history
  • Loading branch information
Orchaldir committed Sep 20, 2023
1 parent 667f90e commit 63af208
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions rpg_tools_rendering/src/rendering/equipment/shirt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ fn render_torso(

if from_front {
add_neckline(&torso_aabb, torso, shirt, &mut builder);
} else {
add_straight(&torso_aabb, torso, &mut builder)
}

let polygon = builder.build();
Expand Down Expand Up @@ -66,14 +68,14 @@ fn add_neckline(aabb: &AABB, torso: &TorsoConfig, shirt: &Shirt, builder: &mut P
Neckline::Boat => add_round(&aabb, torso, builder, 0.7, 0.05),

Check warning on line 68 in rpg_tools_rendering/src/rendering/equipment/shirt.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> rpg_tools_rendering/src/rendering/equipment/shirt.rs:68:37 | 68 | Neckline::Boat => add_round(&aabb, torso, builder, 0.7, 0.05), | ^^^^^ help: change this to: `aabb` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
Neckline::Crew => add_round(&aabb, torso, builder, 0.3, 0.1),

Check warning on line 69 in rpg_tools_rendering/src/rendering/equipment/shirt.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> rpg_tools_rendering/src/rendering/equipment/shirt.rs:69:37 | 69 | Neckline::Crew => add_round(&aabb, torso, builder, 0.3, 0.1), | ^^^^^ help: change this to: `aabb` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Neckline::DeepV => add_v(&aabb, torso, builder, 0.4),

Check warning on line 70 in rpg_tools_rendering/src/rendering/equipment/shirt.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> rpg_tools_rendering/src/rendering/equipment/shirt.rs:70:34 | 70 | Neckline::DeepV => add_v(&aabb, torso, builder, 0.4), | ^^^^^ help: change this to: `aabb` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Neckline::None => {}
Neckline::None => add_straight(&aabb, torso, builder),

Check warning on line 71 in rpg_tools_rendering/src/rendering/equipment/shirt.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> rpg_tools_rendering/src/rendering/equipment/shirt.rs:71:40 | 71 | Neckline::None => add_straight(&aabb, torso, builder), | ^^^^^ help: change this to: `aabb` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Neckline::Scoop => add_round(&aabb, torso, builder, 0.5, 0.2),

Check warning on line 72 in rpg_tools_rendering/src/rendering/equipment/shirt.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> rpg_tools_rendering/src/rendering/equipment/shirt.rs:72:38 | 72 | Neckline::Scoop => add_round(&aabb, torso, builder, 0.5, 0.2), | ^^^^^ help: change this to: `aabb` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Neckline::V => add_v(&aabb, torso, builder, 0.2),

Check warning on line 73 in rpg_tools_rendering/src/rendering/equipment/shirt.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> rpg_tools_rendering/src/rendering/equipment/shirt.rs:73:30 | 73 | Neckline::V => add_v(&aabb, torso, builder, 0.2), | ^^^^^ help: change this to: `aabb` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
}
}

fn add_round(
aabb: &&AABB,
aabb: &AABB,
torso: &TorsoConfig,
builder: &mut Polygon2dBuilder,
width: f32,
Expand All @@ -84,8 +86,13 @@ fn add_round(
builder.add_mirrored_points(aabb, width * 0.7, depth, false);
}

fn add_v(aabb: &&AABB, torso: &TorsoConfig, builder: &mut Polygon2dBuilder, depth: f32) {
fn add_v(aabb: &AABB, torso: &TorsoConfig, builder: &mut Polygon2dBuilder, depth: f32) {
let width = torso.shoulder_width / 3.0;
builder.add_mirrored_points(aabb, width, 0.0, true);
builder.add_point(aabb.get_point(0.5, depth), true);
}

fn add_straight(aabb: &AABB, torso: &TorsoConfig, builder: &mut Polygon2dBuilder) {
let width = torso.shoulder_width / 3.0;
builder.add_mirrored_points(aabb, width, 0.0, true);
}

0 comments on commit 63af208

Please sign in to comment.