Skip to content

Commit

Permalink
Boost pad fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
VirxEC committed Oct 31, 2023
1 parent 4b0363c commit dc50958
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ fn load_texture(name: &str, asset_server: &AssetServer) -> Handle<Image> {
asset_server.load(path)
}

const DOUBLE_SIDED_MATS: [&str; 27] = [
const DOUBLE_SIDED_MATS: [&str; 28] = [
"Trees.Materials.LombardyPoplar_B_NoWind_MIC",
"Trees.Materials.LombardyPoplar_B_Mat",
"FutureTech.Materials.ForceField_HexGage_MIC",
Expand Down Expand Up @@ -172,6 +172,7 @@ const DOUBLE_SIDED_MATS: [&str; 27] = [
"Proto_BBall.SM.BackBoard_Teams_MIC",
"Proto_BBall.Materials.BBall_Rim_MAT_INST",
"Pickup_Boost.Materials.BoostPad_Large_MIC",
"Pickup_Boost.Materials.BoostPad_Small_MIC",
];

const TRANSPARENT_MATS: [&str; 2] = [
Expand Down
23 changes: 23 additions & 0 deletions src/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,11 @@ fn update_pads(
.find(|(_, loc)| loc.distance_squared(pad.position.xy()) < 25.)
.map(|(i, _)| large_boost_pad_loc_rots.rots[i]);
transform.rotate_y(rotation.unwrap_or_default().to_radians());
if state.game_mode == GameMode::Soccer {
transform.translation.y += 2.6;
} else if state.game_mode == GameMode::Hoops {
transform.translation.y += 5.2;
}

pad_glows.large.clone()
} else {
Expand All @@ -573,6 +578,24 @@ fn update_pads(
{
transform.rotate_y(PI.copysign(transform.translation.x * transform.translation.z) / 4.);
}
} else if state.game_mode == GameMode::Hoops {
if transform.translation.z > 2810. {
transform.rotate_y(PI / 3.);
}

if (500f32..1537.).contains(&transform.translation.x.abs())
&& (0f32..1025.).contains(&transform.translation.z)
{
transform.rotate_y(PI / 3.);
}

if (511f32..513.).contains(&transform.translation.x.abs())
&& (511f32..513.).contains(&transform.translation.z.abs())
{
transform.rotate_y(PI.copysign(transform.translation.x * transform.translation.z) / 12.);
}

transform.translation.y += 5.7;
}

pad_glows.small.clone()
Expand Down

0 comments on commit dc50958

Please sign in to comment.