mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 23:15:24 +03:00
deploy: 4c947f05f6
This commit is contained in:
parent
4da67fc6f1
commit
71d67b79ae
@ -1,17 +1,17 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `On` enum in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, On"><title>experiment::movement::On - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../experiment/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum On</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Intersection">Intersection</a><a href="#variant.Road">Road</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.get_connections">get_connections</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-PartialEq%3COn%3E">PartialEq<On></a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Downcast">Downcast</a><a href="#impl-DowncastSync">DowncastSync</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement</a></p><script>window.sidebarCurrent = {name: 'On', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/experiment/movement.rs.html#161-165' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement</a>::<wbr><a class="enum" href=''>On</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>enum On {
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/experiment/movement.rs.html#185-189' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement</a>::<wbr><a class="enum" href=''>On</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>enum On {
|
||||
Intersection(<a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>),
|
||||
Road(<a class="struct" href="../../map_model/objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>, <a class="struct" href="../../geom/distance/struct.Distance.html" title="struct geom::distance::Distance">Distance</a>),
|
||||
}</pre></div><h2 id='variants' class='variants small-section-header'>
|
||||
Variants<a href='#variants' class='anchor'></a></h2>
|
||||
<div id="variant.Intersection" class="variant small-section-header"><a href="#variant.Intersection" class="anchor field"></a><code>Intersection(<a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>)</code></div><div id="variant.Road" class="variant small-section-header"><a href="#variant.Road" class="anchor field"></a><code>Road(<a class="struct" href="../../map_model/objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>, <a class="struct" href="../../geom/distance/struct.Distance.html" title="struct geom::distance::Distance">Distance</a>)</code></div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/experiment/movement.rs.html#167-193' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_connections' class="method"><code>fn <a href='#method.get_connections' class='fnname'>get_connections</a>(<br> &self, <br> app: &<a class="struct" href="../../map_gui/simple_app/struct.SimpleApp.html" title="struct map_gui::simple_app::SimpleApp">SimpleApp</a><<a class="struct" href="../../experiment/session/struct.Session.html" title="struct experiment::session::Session">Session</a>><br>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../../map_model/objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#168-192' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/experiment/movement.rs.html#160' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#160' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
<div id="variant.Intersection" class="variant small-section-header"><a href="#variant.Intersection" class="anchor field"></a><code>Intersection(<a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>)</code></div><div id="variant.Road" class="variant small-section-header"><a href="#variant.Road" class="anchor field"></a><code>Road(<a class="struct" href="../../map_model/objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>, <a class="struct" href="../../geom/distance/struct.Distance.html" title="struct geom::distance::Distance">Distance</a>)</code></div><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/experiment/movement.rs.html#191-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_connections' class="method"><code>fn <a href='#method.get_connections' class='fnname'>get_connections</a>(<br> &self, <br> app: &<a class="struct" href="../../map_gui/simple_app/struct.SimpleApp.html" title="struct map_gui::simple_app::SimpleApp">SimpleApp</a><<a class="struct" href="../../experiment/session/struct.Session.html" title="struct experiment::session::Session">Session</a>><br>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../../map_model/objects/road/struct.RoadID.html" title="struct map_model::objects::road::RoadID">RoadID</a>>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#192-216' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/experiment/movement.rs.html#184' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#184' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div><h4 id='method.clone_from' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||
</div></div><h3 id='impl-PartialEq%3COn%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a>> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-PartialEq%3COn%3E' class='anchor'></a><a class='srclink' href='../../src/experiment/movement.rs.html#160' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#160' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
|
||||
</div></div><h3 id='impl-PartialEq%3COn%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a>> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-PartialEq%3COn%3E' class='anchor'></a><a class='srclink' href='../../src/experiment/movement.rs.html#184' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#184' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
|
||||
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||||
</div><h4 id='method.ne' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#160' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||||
</div></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../src/experiment/movement.rs.html#160' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div><h4 id='method.ne' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#184' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||||
</div></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../src/experiment/movement.rs.html#184' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
</div></div><h3 id='impl-Downcast' class='impl'><code class='in-band'>impl<T> Downcast for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a href='#impl-Downcast' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_any' class="method hidden"><code>fn <a href='#method.into_any' class='fnname'>into_any</a>(self: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><T>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> + 'static></code></h4><div class='docblock hidden'><p>Convert <code>Box<dyn Trait></code> (where <code>Trait: Downcast</code>) to <code>Box<dyn Any></code>. <code>Box<dyn Any></code> can
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `movement` mod in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, movement"><title>experiment::movement - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../experiment/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module movement</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li></ul></div><p class='location'><a href='../index.html'>experiment</a></p><script>window.sidebarCurrent = {name: 'movement', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/experiment/movement.rs.html#1-239' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>experiment</a>::<wbr><a class="mod" href=''>movement</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/experiment/movement.rs.html#1-263' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>experiment</a>::<wbr><a class="mod" href=''>movement</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<table><tr class='module-item'><td><a class="struct" href="struct.BuildingsAlongRoad.html" title='experiment::movement::BuildingsAlongRoad struct'>BuildingsAlongRoad</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Player.html" title='experiment::movement::Player struct'>Player</a></td><td class='docblock-short'></td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
|
||||
<table><tr class='module-item'><td><a class="enum" href="enum.On.html" title='experiment::movement::On enum'>On</a></td><td class='docblock-short'></td></tr></table><h2 id='constants' class='section-header'><a href="#constants">Constants</a></h2>
|
||||
<table><tr class='module-item'><td><a class="constant" href="constant.ZOOM.html" title='experiment::movement::ZOOM constant'>ZOOM</a></td><td class='docblock-short'></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "experiment";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
File diff suppressed because one or more lines are too long
@ -1,14 +1,14 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Player` struct in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, Player"><title>experiment::movement::Player - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../experiment/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Player</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.bldgs_along_road">bldgs_along_road</a><a href="#structfield.controls">controls</a><a href="#structfield.on">on</a><a href="#structfield.pos">pos</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.apply_displacement">apply_displacement</a><a href="#method.get_angle">get_angle</a><a href="#method.get_pos">get_pos</a><a href="#method.new">new</a><a href="#method.on_good_road">on_good_road</a><a href="#method.update_with_speed">update_with_speed</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Downcast">Downcast</a><a href="#impl-DowncastSync">DowncastSync</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement</a></p><script>window.sidebarCurrent = {name: 'Player', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../experiment/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Player</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.bldgs_along_road">bldgs_along_road</a><a href="#structfield.controls">controls</a><a href="#structfield.on">on</a><a href="#structfield.pos">pos</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.apply_displacement">apply_displacement</a><a href="#method.get_angle">get_angle</a><a href="#method.get_pos">get_pos</a><a href="#method.new">new</a><a href="#method.on_good_road">on_good_road</a><a href="#method.pos_to_on">pos_to_on</a><a href="#method.update_with_speed">update_with_speed</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Downcast">Downcast</a><a href="#impl-DowncastSync">DowncastSync</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement</a></p><script>window.sidebarCurrent = {name: 'Player', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/experiment/movement.rs.html#14-20' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement</a>::<wbr><a class="struct" href=''>Player</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Player {
|
||||
pos: <a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>,
|
||||
on: <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a>,
|
||||
bldgs_along_road: <a class="struct" href="../../experiment/movement/struct.BuildingsAlongRoad.html" title="struct experiment::movement::BuildingsAlongRoad">BuildingsAlongRoad</a>,
|
||||
controls: <a class="struct" href="../../experiment/controls/struct.InstantController.html" title="struct experiment::controls::InstantController">InstantController</a>,
|
||||
}</pre></div><h2 id='fields' class='fields small-section-header'>
|
||||
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.pos" class="structfield small-section-header"><a href="#structfield.pos" class="anchor field"></a><code>pos: <a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a></code></span><span id="structfield.on" class="structfield small-section-header"><a href="#structfield.on" class="anchor field"></a><code>on: <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code></span><span id="structfield.bldgs_along_road" class="structfield small-section-header"><a href="#structfield.bldgs_along_road" class="anchor field"></a><code>bldgs_along_road: <a class="struct" href="../../experiment/movement/struct.BuildingsAlongRoad.html" title="struct experiment::movement::BuildingsAlongRoad">BuildingsAlongRoad</a></code></span><span id="structfield.controls" class="structfield small-section-header"><a href="#structfield.controls" class="anchor field"></a><code>controls: <a class="struct" href="../../experiment/controls/struct.InstantController.html" title="struct experiment::controls::InstantController">InstantController</a></code></span><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../experiment/movement/struct.Player.html" title="struct experiment::movement::Player">Player</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/experiment/movement.rs.html#22-158' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a>(<br> ctx: &mut EventCtx<'_>, <br> app: &<a class="struct" href="../../map_gui/simple_app/struct.SimpleApp.html" title="struct map_gui::simple_app::SimpleApp">SimpleApp</a><<a class="struct" href="../../experiment/session/struct.Session.html" title="struct experiment::session::Session">Session</a>>, <br> start: <a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a><br>) -> <a class="struct" href="../../experiment/movement/struct.Player.html" title="struct experiment::movement::Player">Player</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#23-35' title='goto source code'>[src]</a></h4><h4 id='method.update_with_speed' class="method"><code>pub fn <a href='#method.update_with_speed' class='fnname'>update_with_speed</a>(<br> &mut self, <br> ctx: &mut EventCtx<'_>, <br> app: &<a class="struct" href="../../map_gui/simple_app/struct.SimpleApp.html" title="struct map_gui::simple_app::SimpleApp">SimpleApp</a><<a class="struct" href="../../experiment/session/struct.Session.html" title="struct experiment::session::Session">Session</a>>, <br> speed: <a class="struct" href="../../geom/speed/struct.Speed.html" title="struct geom::speed::Speed">Speed</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>></code><a class='srclink' href='../../src/experiment/movement.rs.html#38-51' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns any buildings we passed</p>
|
||||
</div><h4 id='method.apply_displacement' class="method"><code>fn <a href='#method.apply_displacement' class='fnname'>apply_displacement</a>(<br> &mut self, <br> ctx: &mut EventCtx<'_>, <br> app: &<a class="struct" href="../../map_gui/simple_app/struct.SimpleApp.html" title="struct map_gui::simple_app::SimpleApp">SimpleApp</a><<a class="struct" href="../../experiment/session/struct.Session.html" title="struct experiment::session::Session">Session</a>>, <br> dx: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>, <br> dy: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>, <br> recurse: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>></code><a class='srclink' href='../../src/experiment/movement.rs.html#53-137' title='goto source code'>[src]</a></h4><h4 id='method.get_pos' class="method"><code>pub fn <a href='#method.get_pos' class='fnname'>get_pos</a>(&self) -> <a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#139-141' title='goto source code'>[src]</a></h4><h4 id='method.get_angle' class="method"><code>pub fn <a href='#method.get_angle' class='fnname'>get_angle</a>(&self) -> <a class="struct" href="../../geom/angle/struct.Angle.html" title="struct geom::angle::Angle">Angle</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#143-145' title='goto source code'>[src]</a></h4><h4 id='method.on_good_road' class="method"><code>pub fn <a href='#method.on_good_road' class='fnname'>on_good_road</a>(&self, app: &<a class="struct" href="../../map_gui/simple_app/struct.SimpleApp.html" title="struct map_gui::simple_app::SimpleApp">SimpleApp</a><<a class="struct" href="../../experiment/session/struct.Session.html" title="struct experiment::session::Session">Session</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#148-157' title='goto source code'>[src]</a></h4><div class='docblock'><p>Is the player currently on a road with a bus or bike lane?</p>
|
||||
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.pos" class="structfield small-section-header"><a href="#structfield.pos" class="anchor field"></a><code>pos: <a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a></code></span><span id="structfield.on" class="structfield small-section-header"><a href="#structfield.on" class="anchor field"></a><code>on: <a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a></code></span><span id="structfield.bldgs_along_road" class="structfield small-section-header"><a href="#structfield.bldgs_along_road" class="anchor field"></a><code>bldgs_along_road: <a class="struct" href="../../experiment/movement/struct.BuildingsAlongRoad.html" title="struct experiment::movement::BuildingsAlongRoad">BuildingsAlongRoad</a></code></span><span id="structfield.controls" class="structfield small-section-header"><a href="#structfield.controls" class="anchor field"></a><code>controls: <a class="struct" href="../../experiment/controls/struct.InstantController.html" title="struct experiment::controls::InstantController">InstantController</a></code></span><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../experiment/movement/struct.Player.html" title="struct experiment::movement::Player">Player</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/experiment/movement.rs.html#22-182' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a>(<br> ctx: &mut EventCtx<'_>, <br> app: &<a class="struct" href="../../map_gui/simple_app/struct.SimpleApp.html" title="struct map_gui::simple_app::SimpleApp">SimpleApp</a><<a class="struct" href="../../experiment/session/struct.Session.html" title="struct experiment::session::Session">Session</a>>, <br> start: <a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a><br>) -> <a class="struct" href="../../experiment/movement/struct.Player.html" title="struct experiment::movement::Player">Player</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#23-35' title='goto source code'>[src]</a></h4><h4 id='method.update_with_speed' class="method"><code>pub fn <a href='#method.update_with_speed' class='fnname'>update_with_speed</a>(<br> &mut self, <br> ctx: &mut EventCtx<'_>, <br> app: &<a class="struct" href="../../map_gui/simple_app/struct.SimpleApp.html" title="struct map_gui::simple_app::SimpleApp">SimpleApp</a><<a class="struct" href="../../experiment/session/struct.Session.html" title="struct experiment::session::Session">Session</a>>, <br> speed: <a class="struct" href="../../geom/speed/struct.Speed.html" title="struct geom::speed::Speed">Speed</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>></code><a class='srclink' href='../../src/experiment/movement.rs.html#38-51' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns any buildings we passed</p>
|
||||
</div><h4 id='method.pos_to_on' class="method"><code>fn <a href='#method.pos_to_on' class='fnname'>pos_to_on</a>(&self, app: &<a class="struct" href="../../map_gui/simple_app/struct.SimpleApp.html" title="struct map_gui::simple_app::SimpleApp">SimpleApp</a><<a class="struct" href="../../experiment/session/struct.Session.html" title="struct experiment::session::Session">Session</a>>, pos: <a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../../experiment/movement/enum.On.html" title="enum experiment::movement::On">On</a>></code><a class='srclink' href='../../src/experiment/movement.rs.html#53-89' title='goto source code'>[src]</a></h4><h4 id='method.apply_displacement' class="method"><code>fn <a href='#method.apply_displacement' class='fnname'>apply_displacement</a>(<br> &mut self, <br> ctx: &mut EventCtx<'_>, <br> app: &<a class="struct" href="../../map_gui/simple_app/struct.SimpleApp.html" title="struct map_gui::simple_app::SimpleApp">SimpleApp</a><<a class="struct" href="../../experiment/session/struct.Session.html" title="struct experiment::session::Session">Session</a>>, <br> dx: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>, <br> dy: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>, <br> recurse: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>></code><a class='srclink' href='../../src/experiment/movement.rs.html#91-161' title='goto source code'>[src]</a></h4><h4 id='method.get_pos' class="method"><code>pub fn <a href='#method.get_pos' class='fnname'>get_pos</a>(&self) -> <a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#163-165' title='goto source code'>[src]</a></h4><h4 id='method.get_angle' class="method"><code>pub fn <a href='#method.get_angle' class='fnname'>get_angle</a>(&self) -> <a class="struct" href="../../geom/angle/struct.Angle.html" title="struct geom::angle::Angle">Angle</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#167-169' title='goto source code'>[src]</a></h4><h4 id='method.on_good_road' class="method"><code>pub fn <a href='#method.on_good_road' class='fnname'>on_good_road</a>(&self, app: &<a class="struct" href="../../map_gui/simple_app/struct.SimpleApp.html" title="struct map_gui::simple_app::SimpleApp">SimpleApp</a><<a class="struct" href="../../experiment/session/struct.Session.html" title="struct experiment::session::Session">Session</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/experiment/movement.rs.html#172-181' title='goto source code'>[src]</a></h4><div class='docblock'><p>Is the player currently on a road with a bus or bike lane?</p>
|
||||
</div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../experiment/movement/struct.Player.html" title="struct experiment::movement::Player">Player</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../experiment/movement/struct.Player.html" title="struct experiment::movement::Player">Player</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../experiment/movement/struct.Player.html" title="struct experiment::movement::Player">Player</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../experiment/movement/struct.Player.html" title="struct experiment::movement::Player">Player</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../experiment/movement/struct.Player.html" title="struct experiment::movement::Player">Player</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BUILT_TIME_UTC` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>game::pregame::built_info::BUILT_TIME_UTC - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../../index.html'>game</a>::<wbr><a href='../index.html'>pregame</a>::<wbr><a href='index.html'>built_info</a></p><script>window.sidebarCurrent = {name: 'BUILT_TIME_UTC', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-f38555f90777146b/out/built.rs.html#49' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../../index.html'>game</a>::<wbr><a href='../index.html'>pregame</a>::<wbr><a href='index.html'>built_info</a>::<wbr><a class="constant" href=''>BUILT_TIME_UTC</a></span></h1><pre class='rust const'>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Sun, 06 Dec 2020 05:10:43 +0000";</pre><div class='docblock'><p>The built-time in RFC2822, UTC</p>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-f38555f90777146b/out/built.rs.html#49' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../../index.html'>game</a>::<wbr><a href='../index.html'>pregame</a>::<wbr><a href='index.html'>built_info</a>::<wbr><a class="constant" href=''>BUILT_TIME_UTC</a></span></h1><pre class='rust const'>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Mon, 07 Dec 2020 03:44:42 +0000";</pre><div class='docblock'><p>The built-time in RFC2822, UTC</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `fix_angles` fn in crate `geom`."><meta name="keywords" content="rust, rustlang, rust-lang, fix_angles"><title>geom::polyline::fix_angles - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../geom/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>geom</a>::<wbr><a href='index.html'>polyline</a></p><script>window.sidebarCurrent = {name: 'fix_angles', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/geom/polyline.rs.html#819-842' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>geom</a>::<wbr><a href='index.html'>polyline</a>::<wbr><a class="fn" href=''>fix_angles</a></span></h1><pre class='rust fn'>fn fix_angles(orig: &<a class="struct" href="../../geom/struct.PolyLine.html" title="struct geom::PolyLine">PolyLine</a>, result: <a class="struct" href="../../geom/struct.PolyLine.html" title="struct geom::PolyLine">PolyLine</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../geom/struct.PolyLine.html" title="struct geom::PolyLine">PolyLine</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "geom";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/geom/polyline.rs.html#821-844' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>geom</a>::<wbr><a href='index.html'>polyline</a>::<wbr><a class="fn" href=''>fix_angles</a></span></h1><pre class='rust fn'>fn fix_angles(orig: &<a class="struct" href="../../geom/struct.PolyLine.html" title="struct geom::PolyLine">PolyLine</a>, result: <a class="struct" href="../../geom/struct.PolyLine.html" title="struct geom::PolyLine">PolyLine</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../geom/struct.PolyLine.html" title="struct geom::PolyLine">PolyLine</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "geom";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `pts_to_line_string` fn in crate `geom`."><meta name="keywords" content="rust, rustlang, rust-lang, pts_to_line_string"><title>geom::polyline::pts_to_line_string - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../geom/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>geom</a>::<wbr><a href='index.html'>polyline</a></p><script>window.sidebarCurrent = {name: 'pts_to_line_string', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/geom/polyline.rs.html#859-865' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>geom</a>::<wbr><a href='index.html'>polyline</a>::<wbr><a class="fn" href=''>pts_to_line_string</a></span></h1><pre class='rust fn'>fn pts_to_line_string(raw_pts: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../geom/struct.Pt2D.html" title="struct geom::Pt2D">Pt2D</a>>) -> LineString<<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "geom";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/geom/polyline.rs.html#861-867' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>geom</a>::<wbr><a href='index.html'>polyline</a>::<wbr><a class="fn" href=''>pts_to_line_string</a></span></h1><pre class='rust fn'>fn pts_to_line_string(raw_pts: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../geom/struct.Pt2D.html" title="struct geom::Pt2D">Pt2D</a>>) -> LineString<<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "geom";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `to_set` fn in crate `geom`."><meta name="keywords" content="rust, rustlang, rust-lang, to_set"><title>geom::polyline::to_set - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../geom/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>geom</a>::<wbr><a href='index.html'>polyline</a></p><script>window.sidebarCurrent = {name: 'to_set', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/geom/polyline.rs.html#845-857' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>geom</a>::<wbr><a href='index.html'>polyline</a>::<wbr><a class="fn" href=''>to_set</a></span></h1><pre class='rust fn'>fn to_set(pts: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="struct" href="../../geom/struct.Pt2D.html" title="struct geom::Pt2D">Pt2D</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../../geom/struct.HashablePt2D.html" title="struct geom::HashablePt2D">HashablePt2D</a>>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../../geom/struct.HashablePt2D.html" title="struct geom::HashablePt2D">HashablePt2D</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "geom";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/geom/polyline.rs.html#847-859' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>geom</a>::<wbr><a href='index.html'>polyline</a>::<wbr><a class="fn" href=''>to_set</a></span></h1><pre class='rust fn'>fn to_set(pts: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="struct" href="../../geom/struct.Pt2D.html" title="struct geom::Pt2D">Pt2D</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../../geom/struct.HashablePt2D.html" title="struct geom::HashablePt2D">HashablePt2D</a>>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../../geom/struct.HashablePt2D.html" title="struct geom::HashablePt2D">HashablePt2D</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "geom";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `polyline` mod in crate `geom`."><meta name="keywords" content="rust, rustlang, rust-lang, polyline"><title>geom::polyline - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../geom/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module polyline</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../index.html'>geom</a></p><script>window.sidebarCurrent = {name: 'polyline', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/geom/polyline.rs.html#1-865' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>geom</a>::<wbr><a class="mod" href=''>polyline</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/geom/polyline.rs.html#1-867' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>geom</a>::<wbr><a class="mod" href=''>polyline</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<table><tr class='module-item'><td><a class="struct" href="struct.PolyLine.html" title='geom::polyline::PolyLine struct'>PolyLine</a></td><td class='docblock-short'></td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
|
||||
<table><tr class='module-item'><td><a class="enum" href="enum.ArrowCap.html" title='geom::polyline::ArrowCap enum'>ArrowCap</a></td><td class='docblock-short'></td></tr></table><h2 id='constants' class='section-header'><a href="#constants">Constants</a></h2>
|
||||
<table><tr class='module-item'><td><a class="constant" href="constant.MITER_THRESHOLD.html" title='geom::polyline::MITER_THRESHOLD constant'>MITER_THRESHOLD</a></td><td class='docblock-short'></td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -240,11 +240,35 @@
|
||||
<span id="237">237</span>
|
||||
<span id="238">238</span>
|
||||
<span id="239">239</span>
|
||||
<span id="240">240</span>
|
||||
<span id="241">241</span>
|
||||
<span id="242">242</span>
|
||||
<span id="243">243</span>
|
||||
<span id="244">244</span>
|
||||
<span id="245">245</span>
|
||||
<span id="246">246</span>
|
||||
<span id="247">247</span>
|
||||
<span id="248">248</span>
|
||||
<span id="249">249</span>
|
||||
<span id="250">250</span>
|
||||
<span id="251">251</span>
|
||||
<span id="252">252</span>
|
||||
<span id="253">253</span>
|
||||
<span id="254">254</span>
|
||||
<span id="255">255</span>
|
||||
<span id="256">256</span>
|
||||
<span id="257">257</span>
|
||||
<span id="258">258</span>
|
||||
<span id="259">259</span>
|
||||
<span id="260">260</span>
|
||||
<span id="261">261</span>
|
||||
<span id="262">262</span>
|
||||
<span id="263">263</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">HashMap</span>, <span class="ident">HashSet</span>};
|
||||
|
||||
<span class="kw">use</span> <span class="ident">abstutil</span>::<span class="ident">MultiMap</span>;
|
||||
<span class="kw">use</span> <span class="ident">geom</span>::{<span class="ident">Angle</span>, <span class="ident">Circle</span>, <span class="ident">Distance</span>, <span class="ident">Pt2D</span>, <span class="ident">Speed</span>};
|
||||
<span class="kw">use</span> <span class="ident">geom</span>::{<span class="ident">Angle</span>, <span class="ident">Circle</span>, <span class="ident">Distance</span>, <span class="ident">PolyLine</span>, <span class="ident">Pt2D</span>, <span class="ident">Speed</span>};
|
||||
<span class="kw">use</span> <span class="ident">map_gui</span>::<span class="ident">ID</span>;
|
||||
<span class="kw">use</span> <span class="ident">map_model</span>::{<span class="ident">BuildingID</span>, <span class="ident">Direction</span>, <span class="ident">IntersectionID</span>, <span class="ident">LaneType</span>, <span class="ident">RoadID</span>};
|
||||
<span class="kw">use</span> <span class="ident">widgetry</span>::<span class="ident">EventCtx</span>;
|
||||
@ -293,6 +317,44 @@
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">pos_to_on</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">app</span>: <span class="kw-2">&</span><span class="ident">App</span>, <span class="ident">pos</span>: <span class="ident">Pt2D</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">On</span><span class="op">></span> {
|
||||
<span class="comment">// Make sure we only move between roads/intersections that're actually connected. Don't</span>
|
||||
<span class="comment">// warp to bridges/tunnels.</span>
|
||||
<span class="kw">let</span> (<span class="ident">valid_roads</span>, <span class="ident">valid_intersections</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">on</span>.<span class="ident">get_connections</span>(<span class="ident">app</span>);
|
||||
|
||||
<span class="comment">// Make sure we're still on the road</span>
|
||||
<span class="kw">for</span> <span class="ident">id</span> <span class="kw">in</span> <span class="ident">app</span>
|
||||
.<span class="ident">draw_map</span>
|
||||
.<span class="ident">get_matching_objects</span>(<span class="ident">Circle</span>::<span class="ident">new</span>(<span class="ident">pos</span>, <span class="ident">Distance</span>::<span class="ident">meters</span>(<span class="number">3.0</span>)).<span class="ident">get_bounds</span>())
|
||||
{
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">ID</span>::<span class="ident">Intersection</span>(<span class="ident">i</span>) <span class="op">=</span> <span class="ident">id</span> {
|
||||
<span class="kw">if</span> <span class="ident">valid_intersections</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">i</span>) <span class="op">&&</span> <span class="ident">app</span>.<span class="ident">map</span>.<span class="ident">get_i</span>(<span class="ident">i</span>).<span class="ident">polygon</span>.<span class="ident">contains_pt</span>(<span class="ident">pos</span>) {
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">On</span>::<span class="ident">Intersection</span>(<span class="ident">i</span>));
|
||||
}
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="kw">let</span> <span class="ident">ID</span>::<span class="ident">Road</span>(<span class="ident">r</span>) <span class="op">=</span> <span class="ident">id</span> {
|
||||
<span class="kw">let</span> <span class="ident">road</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">map</span>.<span class="ident">get_r</span>(<span class="ident">r</span>);
|
||||
<span class="kw">if</span> <span class="ident">valid_roads</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">r</span>)
|
||||
<span class="op">&&</span> <span class="op">!</span><span class="ident">road</span>.<span class="ident">is_light_rail</span>()
|
||||
<span class="op">&&</span> <span class="ident">road</span>.<span class="ident">get_thick_polygon</span>(<span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>).<span class="ident">contains_pt</span>(<span class="ident">pos</span>)
|
||||
{
|
||||
<span class="comment">// Where along the road are we?</span>
|
||||
<span class="kw">let</span> <span class="ident">pt_on_center_line</span> <span class="op">=</span> <span class="ident">road</span>.<span class="ident">center_pts</span>.<span class="ident">project_pt</span>(<span class="ident">pos</span>);
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">dist</span>, <span class="kw">_</span>)) <span class="op">=</span> <span class="ident">road</span>.<span class="ident">center_pts</span>.<span class="ident">dist_along_of_point</span>(<span class="ident">pt_on_center_line</span>)
|
||||
{
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">On</span>::<span class="ident">Road</span>(<span class="ident">r</span>, <span class="ident">dist</span>));
|
||||
} <span class="kw">else</span> {
|
||||
<span class="macro">error</span><span class="macro">!</span>(
|
||||
<span class="string">"{} snapped to {} on {}, but dist_along_of_point failed"</span>,
|
||||
<span class="ident">pos</span>, <span class="ident">pt_on_center_line</span>, <span class="ident">r</span>
|
||||
);
|
||||
<span class="kw">return</span> <span class="prelude-val">None</span>;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="prelude-val">None</span>
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">apply_displacement</span>(
|
||||
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
|
||||
<span class="ident">ctx</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>,
|
||||
@ -302,47 +364,8 @@
|
||||
<span class="ident">recurse</span>: <span class="ident">bool</span>,
|
||||
) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">BuildingID</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="ident">new_pos</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">pos</span>.<span class="ident">offset</span>(<span class="ident">dx</span>, <span class="ident">dy</span>);
|
||||
|
||||
<span class="comment">// Make sure we only move between roads/intersections that're actually connected. Don't</span>
|
||||
<span class="comment">// warp to bridges/tunnels.</span>
|
||||
<span class="kw">let</span> (<span class="ident">valid_roads</span>, <span class="ident">valid_intersections</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">on</span>.<span class="ident">get_connections</span>(<span class="ident">app</span>);
|
||||
|
||||
<span class="comment">// Make sure we're still on the road</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">on</span> <span class="op">=</span> <span class="prelude-val">None</span>;
|
||||
<span class="kw">for</span> <span class="ident">id</span> <span class="kw">in</span> <span class="ident">app</span>
|
||||
.<span class="ident">draw_map</span>
|
||||
.<span class="ident">get_matching_objects</span>(<span class="ident">Circle</span>::<span class="ident">new</span>(<span class="self">self</span>.<span class="ident">pos</span>, <span class="ident">Distance</span>::<span class="ident">meters</span>(<span class="number">3.0</span>)).<span class="ident">get_bounds</span>())
|
||||
{
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">ID</span>::<span class="ident">Intersection</span>(<span class="ident">i</span>) <span class="op">=</span> <span class="ident">id</span> {
|
||||
<span class="kw">if</span> <span class="ident">valid_intersections</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">i</span>) <span class="op">&&</span> <span class="ident">app</span>.<span class="ident">map</span>.<span class="ident">get_i</span>(<span class="ident">i</span>).<span class="ident">polygon</span>.<span class="ident">contains_pt</span>(<span class="ident">new_pos</span>)
|
||||
{
|
||||
<span class="ident">on</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">On</span>::<span class="ident">Intersection</span>(<span class="ident">i</span>));
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="kw">let</span> <span class="ident">ID</span>::<span class="ident">Road</span>(<span class="ident">r</span>) <span class="op">=</span> <span class="ident">id</span> {
|
||||
<span class="kw">let</span> <span class="ident">road</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">map</span>.<span class="ident">get_r</span>(<span class="ident">r</span>);
|
||||
<span class="kw">if</span> <span class="ident">valid_roads</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">r</span>)
|
||||
<span class="op">&&</span> <span class="op">!</span><span class="ident">road</span>.<span class="ident">is_light_rail</span>()
|
||||
<span class="op">&&</span> <span class="ident">road</span>.<span class="ident">get_thick_polygon</span>(<span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>).<span class="ident">contains_pt</span>(<span class="ident">new_pos</span>)
|
||||
{
|
||||
<span class="comment">// Where along the road are we?</span>
|
||||
<span class="kw">let</span> <span class="ident">pt_on_center_line</span> <span class="op">=</span> <span class="ident">road</span>.<span class="ident">center_pts</span>.<span class="ident">project_pt</span>(<span class="ident">new_pos</span>);
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">dist</span>, <span class="kw">_</span>)) <span class="op">=</span> <span class="ident">road</span>.<span class="ident">center_pts</span>.<span class="ident">dist_along_of_point</span>(<span class="ident">pt_on_center_line</span>)
|
||||
{
|
||||
<span class="ident">on</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">On</span>::<span class="ident">Road</span>(<span class="ident">r</span>, <span class="ident">dist</span>));
|
||||
} <span class="kw">else</span> {
|
||||
<span class="macro">error</span><span class="macro">!</span>(
|
||||
<span class="string">"{} snapped to {} on {}, but dist_along_of_point failed"</span>,
|
||||
<span class="ident">new_pos</span>, <span class="ident">pt_on_center_line</span>, <span class="ident">r</span>
|
||||
);
|
||||
}
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buildings_passed</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">new_on</span>) <span class="op">=</span> <span class="ident">on</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">new_on</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">pos_to_on</span>(<span class="ident">app</span>, <span class="ident">new_pos</span>) {
|
||||
<span class="self">self</span>.<span class="ident">pos</span> <span class="op">=</span> <span class="ident">new_pos</span>;
|
||||
<span class="ident">ctx</span>.<span class="ident">canvas</span>.<span class="ident">center_on_map_pt</span>(<span class="self">self</span>.<span class="ident">pos</span>);
|
||||
|
||||
@ -355,8 +378,6 @@
|
||||
<span class="self">self</span>.<span class="ident">on</span> <span class="op">=</span> <span class="ident">new_on</span>;
|
||||
} <span class="kw">else</span> {
|
||||
<span class="comment">// We went out of bounds. Undo this movement.</span>
|
||||
<span class="comment">// TODO Draw a line between the old and new position, and snap to the boundary of</span>
|
||||
<span class="comment">// whatever we hit.</span>
|
||||
|
||||
<span class="comment">// Apply horizontal and vertical movement independently, so we "slide" along boundaries</span>
|
||||
<span class="comment">// if possible</span>
|
||||
@ -369,10 +390,37 @@
|
||||
<span class="ident">buildings_passed</span>.<span class="ident">extend</span>(<span class="self">self</span>.<span class="ident">apply_displacement</span>(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="number">0.0</span>, <span class="ident">dy</span>, <span class="bool-val">false</span>));
|
||||
}
|
||||
|
||||
<span class="comment">// If we're stuck, try bouncing in the opposite direction.</span>
|
||||
<span class="comment">// TODO This is jittery and we can sometimes go out of bounds now. :D</span>
|
||||
<span class="comment">// Are we stuck?</span>
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">pos</span> <span class="op">=</span><span class="op">=</span> <span class="ident">orig</span> {
|
||||
<span class="ident">buildings_passed</span>.<span class="ident">extend</span>(<span class="self">self</span>.<span class="ident">apply_displacement</span>(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="op">-</span><span class="ident">dx</span>, <span class="op">-</span><span class="ident">dy</span>, <span class="bool-val">false</span>));
|
||||
<span class="kw">if</span> <span class="bool-val">true</span> {
|
||||
<span class="comment">// Resolve by just bouncing in the opposite direction. Jittery, but we keep</span>
|
||||
<span class="comment">// moving.</span>
|
||||
<span class="ident">buildings_passed</span>.<span class="ident">extend</span>(<span class="self">self</span>.<span class="ident">apply_displacement</span>(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="op">-</span><span class="ident">dx</span>, <span class="op">-</span><span class="ident">dy</span>, <span class="bool-val">false</span>));
|
||||
} <span class="kw">else</span> {
|
||||
<span class="comment">// Find the exact point on the boundary where we go out of bounds</span>
|
||||
<span class="kw">let</span> <span class="ident">old_ring</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">on</span> {
|
||||
<span class="ident">On</span>::<span class="ident">Intersection</span>(<span class="ident">i</span>) <span class="op">=</span><span class="op">></span> <span class="ident">app</span>.<span class="ident">map</span>.<span class="ident">get_i</span>(<span class="ident">i</span>).<span class="ident">polygon</span>.<span class="ident">clone</span>().<span class="ident">into_ring</span>(),
|
||||
<span class="ident">On</span>::<span class="ident">Road</span>(<span class="ident">r</span>, <span class="kw">_</span>) <span class="op">=</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="ident">road</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">map</span>.<span class="ident">get_r</span>(<span class="ident">r</span>);
|
||||
<span class="ident">road</span>.<span class="ident">center_pts</span>
|
||||
.<span class="ident">to_thick_ring</span>(<span class="number">2.0</span> <span class="op">*</span> <span class="ident">road</span>.<span class="ident">get_half_width</span>(<span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>))
|
||||
}
|
||||
};
|
||||
<span class="comment">// TODO Brittle order, but should be the first from the PolyLine's</span>
|
||||
<span class="comment">// perspective</span>
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">pt</span>) <span class="op">=</span> <span class="ident">old_ring</span>
|
||||
.<span class="ident">all_intersections</span>(<span class="kw-2">&</span><span class="ident">PolyLine</span>::<span class="ident">must_new</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="self">self</span>.<span class="ident">pos</span>, <span class="ident">new_pos</span>]))
|
||||
.<span class="ident">get</span>(<span class="number">0</span>)
|
||||
{
|
||||
<span class="ident">buildings_passed</span>.<span class="ident">extend</span>(<span class="self">self</span>.<span class="ident">apply_displacement</span>(
|
||||
<span class="ident">ctx</span>,
|
||||
<span class="ident">app</span>,
|
||||
<span class="ident">pt</span>.<span class="ident">x</span>() <span class="op">-</span> <span class="self">self</span>.<span class="ident">pos</span>.<span class="ident">x</span>(),
|
||||
<span class="ident">pt</span>.<span class="ident">y</span>() <span class="op">-</span> <span class="self">self</span>.<span class="ident">pos</span>.<span class="ident">y</span>(),
|
||||
<span class="bool-val">false</span>,
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +114,7 @@
|
||||
<span class="doccomment">/// The output of `rustdoc -V`</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"rustdoc 1.48.0 (7eac88abb 2020-11-16)"</span>;
|
||||
<span class="doccomment">/// The built-time in RFC2822, UTC</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Sun, 06 Dec 2020 05:10:43 +0000"</span>;
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Mon, 07 Dec 2020 03:44:42 +0000"</span>;
|
||||
<span class="doccomment">/// The target architecture, given by `cfg!(target_arch)`.</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">CFG_TARGET_ARCH</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"x86_64"</span>;
|
||||
<span class="doccomment">/// The endianness, given by `cfg!(target_endian)`.</span>
|
||||
|
@ -866,6 +866,8 @@
|
||||
<span id="863">863</span>
|
||||
<span id="864">864</span>
|
||||
<span id="865">865</span>
|
||||
<span id="866">866</span>
|
||||
<span id="867">867</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashSet</span>;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
|
||||
@ -1314,11 +1316,13 @@
|
||||
<span class="ident">result</span>
|
||||
}
|
||||
|
||||
<span class="doccomment">/// The resulting polygon is manually triangulated and doesn't have a valid outer Ring.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">make_polygons</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">width</span>: <span class="ident">Distance</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Polygon</span> {
|
||||
<span class="comment">// TODO How to tune this?</span>
|
||||
<span class="self">self</span>.<span class="ident">make_polygons_with_miter_threshold</span>(<span class="ident">width</span>, <span class="ident">MITER_THRESHOLD</span>)
|
||||
}
|
||||
|
||||
<span class="doccomment">/// The resulting polygon is manually triangulated and doesn't have a valid outer Ring.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">make_polygons_with_miter_threshold</span>(
|
||||
<span class="kw-2">&</span><span class="self">self</span>,
|
||||
<span class="ident">width</span>: <span class="ident">Distance</span>,
|
||||
|
Loading…
Reference in New Issue
Block a user