mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 23:43:25 +03:00
allow a NaN in kinematics
This commit is contained in:
parent
0c6f7c424d
commit
3e00789960
@ -5,7 +5,6 @@
|
||||
- try fixed pt again, for determinism purposes mostly
|
||||
- go through and use less f64's... like LANE_THICKNESS, make_polygons, Circle::new, project_away
|
||||
- audit inner_foo()'s
|
||||
- rerun import, all tests, screenshots
|
||||
|
||||
- change internal pt2d representation to int. JUST get that working first.
|
||||
- clamp distances first, not points?
|
||||
|
@ -851,7 +851,7 @@ impl DrivingSimState {
|
||||
};
|
||||
|
||||
let body = if let Some(ref parking) = c.parking {
|
||||
let progress: f64 = (time - parking.started_at).as_time() / TIME_TO_PARK_OR_DEPART;
|
||||
let progress = (time - parking.started_at).as_time() / TIME_TO_PARK_OR_DEPART;
|
||||
assert!(progress >= 0.0 && progress <= 1.0);
|
||||
let project_away_ratio = if parking.is_parking {
|
||||
progress
|
||||
|
@ -166,7 +166,8 @@ impl Vehicle {
|
||||
/ (2.0 * dist.inner_meters()),
|
||||
);
|
||||
// TODO might validlyish be NaN, so just f64 here
|
||||
let required_time: f64 = (speed / normal_case * -1.0).inner_seconds();
|
||||
let required_time =
|
||||
-1.0 * speed.inner_meters_per_second() / normal_case.inner_meters_per_second_squared();
|
||||
|
||||
if self.debug {
|
||||
debug!(
|
||||
|
@ -312,7 +312,7 @@ impl Pedestrian {
|
||||
);
|
||||
let line = Line::new(sidewalk_pos.pt(map), street_pos.pt(map));
|
||||
|
||||
let progress: f64 = (now - bp.started_at).as_time() / TIME_TO_PREPARE_BIKE;
|
||||
let progress = (now - bp.started_at).as_time() / TIME_TO_PREPARE_BIKE;
|
||||
assert!(progress >= 0.0 && progress <= 1.0);
|
||||
let ratio = if bp.is_parking {
|
||||
1.0 - progress
|
||||
|
Loading…
Reference in New Issue
Block a user