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),
Neckline::Crew => add_round(&aabb, torso, builder, 0.3, 0.1),
Neckline::DeepV => add_v(&aabb, torso, builder, 0.4),
Neckline::None => {}
Neckline::None => add_straight(&aabb, torso, builder),
Neckline::Scoop => add_round(&aabb, torso, builder, 0.5, 0.2),
Neckline::V => add_v(&aabb, torso, builder, 0.2),
}
}

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.