mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 23:15:24 +03:00
deploy: de129e2e8e
This commit is contained in:
parent
a0f970dd85
commit
1c40649af2
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
<!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 `all_connections` fn in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, all_connections"><title>experiment::movement_v2::all_connections - 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='../../experiment/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'>experiment</a>::<wbr><a href='index.html'>movement_v2</a></p><script>window.sidebarCurrent = {name: 'all_connections', 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/experiment/movement_v2.rs.html#263-279' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement_v2</a>::<wbr><a class="fn" href=''>all_connections</a></span></h1><pre class='rust fn'>fn all_connections(i: <a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>, map: &<a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/btree/set/struct.BTreeSet.html" title="struct alloc::collections::btree::set::BTreeSet">BTreeSet</a><<a class="struct" href="../../map_model/objects/road/struct.DirectedRoadID.html" title="struct map_model::objects::road::DirectedRoadID">DirectedRoadID</a>></pre><div class='docblock'><p>All roads connected to this intersection, along with a direction assuming we're starting from
|
||||
the intersection. Arbitrary order.</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/experiment/movement_v2.rs.html#259-280' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement_v2</a>::<wbr><a class="fn" href=''>all_connections</a></span></h1><pre class='rust fn'>fn all_connections(i: <a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>, map: &<a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../map_model/objects/road/struct.DirectedRoadID.html" title="struct map_model::objects::road::DirectedRoadID">DirectedRoadID</a>, <a class="struct" href="../../geom/angle/struct.Angle.html" title="struct geom::angle::Angle">Angle</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></pre><div class='docblock'><p>All roads connected to this intersection, along with a direction assuming we're starting from
|
||||
the intersection. Ordered by angle.</p>
|
||||
</div></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>
|
@ -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 `default_connection` fn in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, default_connection"><title>experiment::movement_v2::default_connection - 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='../../experiment/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'>experiment</a>::<wbr><a href='index.html'>movement_v2</a></p><script>window.sidebarCurrent = {name: 'default_connection', 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/experiment/movement_v2.rs.html#282-295' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement_v2</a>::<wbr><a class="fn" href=''>default_connection</a></span></h1><pre class='rust fn'>fn default_connection(from: <a class="struct" href="../../map_model/objects/road/struct.DirectedRoadID.html" title="struct map_model::objects::road::DirectedRoadID">DirectedRoadID</a>, map: &<a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="struct" href="../../map_model/objects/road/struct.DirectedRoadID.html" title="struct map_model::objects::road::DirectedRoadID">DirectedRoadID</a></pre></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>
|
||||
<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_v2.rs.html#282-303' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement_v2</a>::<wbr><a class="fn" href=''>default_connection</a></span></h1><pre class='rust fn'>fn default_connection(from: <a class="struct" href="../../map_model/objects/road/struct.DirectedRoadID.html" title="struct map_model::objects::road::DirectedRoadID">DirectedRoadID</a>, map: &<a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="struct" href="../../map_model/objects/road/struct.DirectedRoadID.html" title="struct map_model::objects::road::DirectedRoadID">DirectedRoadID</a></pre></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>
|
@ -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 `dr_pl` fn in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, dr_pl"><title>experiment::movement_v2::dr_pl - 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='../../experiment/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'>experiment</a>::<wbr><a href='index.html'>movement_v2</a></p><script>window.sidebarCurrent = {name: 'dr_pl', 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/experiment/movement_v2.rs.html#297-303' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement_v2</a>::<wbr><a class="fn" href=''>dr_pl</a></span></h1><pre class='rust fn'>fn dr_pl(dr: <a class="struct" href="../../map_model/objects/road/struct.DirectedRoadID.html" title="struct map_model::objects::road::DirectedRoadID">DirectedRoadID</a>, map: &<a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="struct" href="../../geom/polyline/struct.PolyLine.html" title="struct geom::polyline::PolyLine">PolyLine</a></pre></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>
|
||||
<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_v2.rs.html#305-311' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../index.html'>experiment</a>::<wbr><a href='index.html'>movement_v2</a>::<wbr><a class="fn" href=''>dr_pl</a></span></h1><pre class='rust fn'>fn dr_pl(dr: <a class="struct" href="../../map_model/objects/road/struct.DirectedRoadID.html" title="struct map_model::objects::road::DirectedRoadID">DirectedRoadID</a>, map: &<a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="struct" href="../../geom/polyline/struct.PolyLine.html" title="struct geom::polyline::PolyLine">PolyLine</a></pre></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>
|
@ -1,10 +1,10 @@
|
||||
<!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_v2` mod in crate `experiment`."><meta name="keywords" content="rust, rustlang, rust-lang, movement_v2"><title>experiment::movement_v2 - 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_v2</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'>experiment</a></p><script>window.sidebarCurrent = {name: 'movement_v2', 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_v2.rs.html#1-303' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>experiment</a>::<wbr><a class="mod" href=''>movement_v2</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_v2.rs.html#1-311' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>experiment</a>::<wbr><a class="mod" href=''>movement_v2</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_v2::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_v2::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_v2::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.HACK.html" title='experiment::movement_v2::HACK constant'>HACK</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="constant" href="constant.ZOOM.html" title='experiment::movement_v2::ZOOM constant'>ZOOM</a></td><td class='docblock-short'></td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
|
||||
<table><tr class='module-item'><td><a class="fn" href="fn.all_connections.html" title='experiment::movement_v2::all_connections fn'>all_connections</a></td><td class='docblock-short'><p>All roads connected to this intersection, along with a direction assuming we're starting from
|
||||
the intersection. Arbitrary order.</p>
|
||||
the intersection. Ordered by angle.</p>
|
||||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.default_connection.html" title='experiment::movement_v2::default_connection fn'>default_connection</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.dr_pl.html" title='experiment::movement_v2::dr_pl fn'>dr_pl</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>
|
@ -1 +1 @@
|
||||
initSidebarItems({"constant":[["HACK",""],["ZOOM",""]],"enum":[["On",""]],"fn":[["all_connections","All roads connected to this intersection, along with a direction assuming we're starting from the intersection. Arbitrary order."],["default_connection",""],["dr_pl",""]],"struct":[["BuildingsAlongRoad",""],["Player",""]]});
|
||||
initSidebarItems({"constant":[["HACK",""],["ZOOM",""]],"enum":[["On",""]],"fn":[["all_connections","All roads connected to this intersection, along with a direction assuming we're starting from the intersection. Ordered by angle."],["default_connection",""],["dr_pl",""]],"struct":[["BuildingsAlongRoad",""],["Player",""]]});
|
File diff suppressed because one or more lines are too long
@ -7,9 +7,9 @@
|
||||
angle: <a class="struct" href="../../geom/angle/struct.Angle.html" title="struct geom::angle::Angle">Angle</a>,
|
||||
bldgs_along_road: <a class="struct" href="../../experiment/movement_v2/struct.BuildingsAlongRoad.html" title="struct experiment::movement_v2::BuildingsAlongRoad">BuildingsAlongRoad</a>,
|
||||
}</pre></div><h2 id='fields' class='fields small-section-header'>
|
||||
Fields<a href='#fields' class='anchor'></a></h2><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_v2/enum.On.html" title="enum experiment::movement_v2::On">On</a></code></span><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.angle" class="structfield small-section-header"><a href="#structfield.angle" class="anchor field"></a><code>angle: <a class="struct" href="../../geom/angle/struct.Angle.html" title="struct geom::angle::Angle">Angle</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_v2/struct.BuildingsAlongRoad.html" title="struct experiment::movement_v2::BuildingsAlongRoad">BuildingsAlongRoad</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_v2/struct.Player.html" title="struct experiment::movement_v2::Player">Player</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/experiment/movement_v2.rs.html#24-174' 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_v2/struct.Player.html" title="struct experiment::movement_v2::Player">Player</a></code><a class='srclink' href='../../src/experiment/movement_v2.rs.html#25-42' 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_v2.rs.html#45-113' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns any buildings we passed</p>
|
||||
</div><h4 id='method.event' class="method"><code>pub fn <a href='#method.event' class='fnname'>event</a>(&mut self, ctx: &mut EventCtx<'_>, 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>>)</code><a class='srclink' href='../../src/experiment/movement_v2.rs.html#115-143' 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_v2.rs.html#145-147' 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_v2.rs.html#149-152' 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_v2.rs.html#155-164' 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><h4 id='method.draw_next_step' class="method"><code>pub fn <a href='#method.draw_next_step' class='fnname'>draw_next_step</a>(&self, g: &mut GfxCtx<'_>, 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>>)</code><a class='srclink' href='../../src/experiment/movement_v2.rs.html#166-173' title='goto source code'>[src]</a></h4></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_v2/struct.Player.html" title="struct experiment::movement_v2::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_v2/struct.Player.html" title="struct experiment::movement_v2::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_v2/struct.Player.html" title="struct experiment::movement_v2::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_v2/struct.Player.html" title="struct experiment::movement_v2::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_v2/struct.Player.html" title="struct experiment::movement_v2::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>
|
||||
Fields<a href='#fields' class='anchor'></a></h2><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_v2/enum.On.html" title="enum experiment::movement_v2::On">On</a></code></span><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.angle" class="structfield small-section-header"><a href="#structfield.angle" class="anchor field"></a><code>angle: <a class="struct" href="../../geom/angle/struct.Angle.html" title="struct geom::angle::Angle">Angle</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_v2/struct.BuildingsAlongRoad.html" title="struct experiment::movement_v2::BuildingsAlongRoad">BuildingsAlongRoad</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_v2/struct.Player.html" title="struct experiment::movement_v2::Player">Player</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/experiment/movement_v2.rs.html#24-170' 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_v2/struct.Player.html" title="struct experiment::movement_v2::Player">Player</a></code><a class='srclink' href='../../src/experiment/movement_v2.rs.html#25-42' 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_v2.rs.html#45-113' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns any buildings we passed</p>
|
||||
</div><h4 id='method.event' class="method"><code>pub fn <a href='#method.event' class='fnname'>event</a>(&mut self, ctx: &mut EventCtx<'_>, 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>>)</code><a class='srclink' href='../../src/experiment/movement_v2.rs.html#115-139' 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_v2.rs.html#141-143' 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_v2.rs.html#145-148' 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_v2.rs.html#151-160' 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><h4 id='method.draw_next_step' class="method"><code>pub fn <a href='#method.draw_next_step' class='fnname'>draw_next_step</a>(&self, g: &mut GfxCtx<'_>, 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>>)</code><a class='srclink' href='../../src/experiment/movement_v2.rs.html#162-169' title='goto source code'>[src]</a></h4></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_v2/struct.Player.html" title="struct experiment::movement_v2::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_v2/struct.Player.html" title="struct experiment::movement_v2::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_v2/struct.Player.html" title="struct experiment::movement_v2::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_v2/struct.Player.html" title="struct experiment::movement_v2::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_v2/struct.Player.html" title="struct experiment::movement_v2::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>
|
||||
</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,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, 13 Dec 2020 02:43:22 +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> = "Sun, 13 Dec 2020 03:52:32 +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,6 +1,6 @@
|
||||
<!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 `angle` mod in crate `geom`."><meta name="keywords" content="rust, rustlang, rust-lang, angle"><title>geom::angle - 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 angle</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'><a href='../index.html'>geom</a></p><script>window.sidebarCurrent = {name: 'angle', 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/angle.rs.html#1-130' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>geom</a>::<wbr><a class="mod" href=''>angle</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/angle.rs.html#1-129' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>geom</a>::<wbr><a class="mod" href=''>angle</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.Angle.html" title='geom::angle::Angle struct'>Angle</a></td><td class='docblock-short'><p>An angle, stored in radians.</p>
|
||||
</td></tr></table></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,29 +1,30 @@
|
||||
<!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 `Angle` struct in crate `geom`."><meta name="keywords" content="rust, rustlang, rust-lang, Angle"><title>geom::angle::Angle - 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='../../geom/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Angle</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.approx_eq">approx_eq</a><a href="#method.degrees">degrees</a><a href="#method.invert_y">invert_y</a><a href="#method.new_rads">new_rads</a><a href="#method.normalized_degrees">normalized_degrees</a><a href="#method.normalized_radians">normalized_radians</a><a href="#method.opposite">opposite</a><a href="#method.reorient">reorient</a><a href="#method.rotate_degs">rotate_degs</a><a href="#method.shortest_rotation_towards">shortest_rotation_towards</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Add%3CAngle%3E">Add<Angle></a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Display">Display</a><a href="#impl-Div%3Cf64%3E">Div<f64></a><a href="#impl-Neg">Neg</a><a href="#impl-PartialEq%3CAngle%3E">PartialEq<Angle></a><a href="#impl-PartialOrd%3CAngle%3E">PartialOrd<Angle></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a><a href="#impl-Sum%3CAngle%3E">Sum<Angle></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-DeserializeOwned">DeserializeOwned</a><a href="#impl-From%3CT%3E">From<T></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-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='../index.html'>geom</a>::<wbr><a href='index.html'>angle</a></p><script>window.sidebarCurrent = {name: 'Angle', 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='../../geom/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Angle</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.approx_eq">approx_eq</a><a href="#method.degrees">degrees</a><a href="#method.invert_y">invert_y</a><a href="#method.new_rads">new_rads</a><a href="#method.normalized_degrees">normalized_degrees</a><a href="#method.normalized_radians">normalized_radians</a><a href="#method.opposite">opposite</a><a href="#method.reorient">reorient</a><a href="#method.rotate_degs">rotate_degs</a><a href="#method.shortest_rotation_towards">shortest_rotation_towards</a><a href="#method.simple_shortest_rotation_towards">simple_shortest_rotation_towards</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Add%3CAngle%3E">Add<Angle></a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Display">Display</a><a href="#impl-Div%3Cf64%3E">Div<f64></a><a href="#impl-Neg">Neg</a><a href="#impl-PartialEq%3CAngle%3E">PartialEq<Angle></a><a href="#impl-PartialOrd%3CAngle%3E">PartialOrd<Angle></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a><a href="#impl-Sum%3CAngle%3E">Sum<Angle></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-DeserializeOwned">DeserializeOwned</a><a href="#impl-From%3CT%3E">From<T></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-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='../index.html'>geom</a>::<wbr><a href='index.html'>angle</a></p><script>window.sidebarCurrent = {name: 'Angle', 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/geom/angle.rs.html#7' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>geom</a>::<wbr><a href='index.html'>angle</a>::<wbr><a class="struct" href=''>Angle</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Angle(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>);</pre></div><div class='docblock'><p>An angle, stored in radians.</p>
|
||||
</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="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#9-84' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedconstant.ZERO' class="associatedconstant"><code>pub const <a href='#associatedconstant.ZERO' class="constant"><b>ZERO</b></a>: <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#10' title='goto source code'>[src]</a></h4><h4 id='method.new_rads' class="method"><code>pub fn <a href='#method.new_rads' class='fnname'>new_rads</a>(rads: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#14-17' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create an angle in radians.</p>
|
||||
</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="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#9-83' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedconstant.ZERO' class="associatedconstant"><code>pub const <a href='#associatedconstant.ZERO' class="constant"><b>ZERO</b></a>: <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#10' title='goto source code'>[src]</a></h4><h4 id='method.new_rads' class="method"><code>pub fn <a href='#method.new_rads' class='fnname'>new_rads</a>(rads: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#14-17' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create an angle in radians.</p>
|
||||
</div><h4 id='method.degrees' class="method"><code>pub fn <a href='#method.degrees' class='fnname'>degrees</a>(degs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#20-22' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create an angle in degrees.</p>
|
||||
</div><h4 id='method.opposite' class="method"><code>pub fn <a href='#method.opposite' class='fnname'>opposite</a>(self) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#25-27' title='goto source code'>[src]</a></h4><div class='docblock'><p>Invert the direction of this angle.</p>
|
||||
</div><h4 id='method.invert_y' class="method"><code>pub(crate) fn <a href='#method.invert_y' class='fnname'>invert_y</a>(self) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#29-31' title='goto source code'>[src]</a></h4><h4 id='method.rotate_degs' class="method"><code>pub fn <a href='#method.rotate_degs' class='fnname'>rotate_degs</a>(self, degrees: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#34-36' title='goto source code'>[src]</a></h4><div class='docblock'><p>Rotates this angle by some degrees.</p>
|
||||
</div><h4 id='method.normalized_radians' class="method"><code>pub fn <a href='#method.normalized_radians' class='fnname'>normalized_radians</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a></code><a class='srclink' href='../../src/geom/angle.rs.html#39-46' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns [0, 2pi)</p>
|
||||
</div><h4 id='method.normalized_degrees' class="method"><code>pub fn <a href='#method.normalized_degrees' class='fnname'>normalized_degrees</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a></code><a class='srclink' href='../../src/geom/angle.rs.html#49-51' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns [0, 360)</p>
|
||||
</div><h4 id='method.shortest_rotation_towards' class="method"><code>pub fn <a href='#method.shortest_rotation_towards' class='fnname'>shortest_rotation_towards</a>(self, other: <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#55-60' title='goto source code'>[src]</a></h4><div class='docblock'><p>Logically this returns [-180, 180], but keep in mind when we print this angle, it'll
|
||||
</div><h4 id='method.simple_shortest_rotation_towards' class="method"><code>pub fn <a href='#method.simple_shortest_rotation_towards' class='fnname'>simple_shortest_rotation_towards</a>(self, other: <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a></code><a class='srclink' href='../../src/geom/angle.rs.html#54-57' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns [-180, 180]</p>
|
||||
</div><h4 id='method.shortest_rotation_towards' class="method"><code>pub fn <a href='#method.shortest_rotation_towards' class='fnname'>shortest_rotation_towards</a>(self, other: <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#61-63' title='goto source code'>[src]</a></h4><div class='docblock'><p>Logically this returns [-180, 180], but keep in mind when we print this angle, it'll
|
||||
normalize to be [0, 360].</p>
|
||||
</div><h4 id='method.approx_eq' class="method"><code>pub fn <a href='#method.approx_eq' class='fnname'>approx_eq</a>(self, other: <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>, within_degrees: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/geom/angle.rs.html#63-69' title='goto source code'>[src]</a></h4><div class='docblock'><p>True if this angle is within some degrees of another, accounting for rotation</p>
|
||||
</div><h4 id='method.reorient' class="method"><code>pub fn <a href='#method.reorient' class='fnname'>reorient</a>(self) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#73-83' title='goto source code'>[src]</a></h4><div class='docblock'><p>I don't know how to describe what this does. Use for rotating labels in map-space and making
|
||||
</div><h4 id='method.approx_eq' class="method"><code>pub fn <a href='#method.approx_eq' class='fnname'>approx_eq</a>(self, other: <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>, within_degrees: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/geom/angle.rs.html#66-68' title='goto source code'>[src]</a></h4><div class='docblock'><p>True if this angle is within some degrees of another, accounting for rotation</p>
|
||||
</div><h4 id='method.reorient' class="method"><code>pub fn <a href='#method.reorient' class='fnname'>reorient</a>(self) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#72-82' title='goto source code'>[src]</a></h4><div class='docblock'><p>I don't know how to describe what this does. Use for rotating labels in map-space and making
|
||||
sure the text is never upside-down.</p>
|
||||
</div></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-Add%3CAngle%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a><<a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Add%3CAngle%3E' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#92-98' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
|
||||
</div><h4 id='method.add' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add' class='fnname'>add</a>(self, other: <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#95-97' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
|
||||
</div></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-Add%3CAngle%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a><<a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Add%3CAngle%3E' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#91-97' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
|
||||
</div><h4 id='method.add' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add' class='fnname'>add</a>(self, other: <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#94-96' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
|
||||
</div></div><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="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#6' 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="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#6' 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-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.117/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.117/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="type" href="https://docs.rs/serde/1.0.117/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.117/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.117/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
|
||||
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#86-90' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../src/geom/angle.rs.html#87-89' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id='impl-Div%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Div%3Cf64%3E' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#108-117' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>/</code> operator.</p>
|
||||
</div><h4 id='method.div' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#tymethod.div' class='fnname'>div</a>(self, scalar: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#111-116' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>/</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#tymethod.div">Read more</a></p>
|
||||
</div></div><h3 id='impl-Neg' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html" title="trait core::ops::arith::Neg">Neg</a> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Neg' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#100-106' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-2' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
|
||||
</div><h4 id='method.neg' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#tymethod.neg' class='fnname'>neg</a>(self) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#103-105' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the unary <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#tymethod.neg">Read more</a></p>
|
||||
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#85-89' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../src/geom/angle.rs.html#86-88' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id='impl-Div%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Div%3Cf64%3E' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#107-116' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>/</code> operator.</p>
|
||||
</div><h4 id='method.div' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#tymethod.div' class='fnname'>div</a>(self, scalar: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#110-115' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>/</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#tymethod.div">Read more</a></p>
|
||||
</div></div><h3 id='impl-Neg' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html" title="trait core::ops::arith::Neg">Neg</a> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Neg' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#99-105' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-2' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
|
||||
</div><h4 id='method.neg' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#tymethod.neg' class='fnname'>neg</a>(self) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../../src/geom/angle.rs.html#102-104' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the unary <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#tymethod.neg">Read more</a></p>
|
||||
</div></div><h3 id='impl-PartialEq%3CAngle%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="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-PartialEq%3CAngle%3E' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#6' 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="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/geom/angle.rs.html#6' 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="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||||
@ -35,7 +36,7 @@ operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.h
|
||||
</div><h4 id='method.ge' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &<a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code>
|
||||
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
|
||||
</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.117/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></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="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Sum%3CAngle%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Sum.html" title="trait core::iter::traits::accum::Sum">Sum</a><<a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Sum%3CAngle%3E' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#119-130' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sum' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Sum.html#tymethod.sum' class='fnname'>sum</a><I>(iter: I) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>>, </span></code><a class='srclink' href='../../src/geom/angle.rs.html#120-129' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Method which takes an iterator and generates <code>Self</code> from the elements by
|
||||
</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="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Sum%3CAngle%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Sum.html" title="trait core::iter::traits::accum::Sum">Sum</a><<a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>> for <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Sum%3CAngle%3E' class='anchor'></a><a class='srclink' href='../../src/geom/angle.rs.html#118-129' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sum' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Sum.html#tymethod.sum' class='fnname'>sum</a><I>(iter: I) -> <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="struct" href="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>>, </span></code><a class='srclink' href='../../src/geom/angle.rs.html#119-128' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Method which takes an iterator and generates <code>Self</code> from the elements by
|
||||
"summing up" the items. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Sum.html#tymethod.sum">Read more</a></p>
|
||||
</div></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="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</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="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</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="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</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="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</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="../../geom/struct.Angle.html" title="struct geom::Angle">Angle</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>
|
||||
|
@ -1,29 +1,30 @@
|
||||
<!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 `Angle` struct in crate `geom`."><meta name="keywords" content="rust, rustlang, rust-lang, Angle"><title>geom::Angle - 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='../geom/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Angle</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.approx_eq">approx_eq</a><a href="#method.degrees">degrees</a><a href="#method.invert_y">invert_y</a><a href="#method.new_rads">new_rads</a><a href="#method.normalized_degrees">normalized_degrees</a><a href="#method.normalized_radians">normalized_radians</a><a href="#method.opposite">opposite</a><a href="#method.reorient">reorient</a><a href="#method.rotate_degs">rotate_degs</a><a href="#method.shortest_rotation_towards">shortest_rotation_towards</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Add%3CAngle%3E">Add<Angle></a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Display">Display</a><a href="#impl-Div%3Cf64%3E">Div<f64></a><a href="#impl-Neg">Neg</a><a href="#impl-PartialEq%3CAngle%3E">PartialEq<Angle></a><a href="#impl-PartialOrd%3CAngle%3E">PartialOrd<Angle></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a><a href="#impl-Sum%3CAngle%3E">Sum<Angle></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-DeserializeOwned">DeserializeOwned</a><a href="#impl-From%3CT%3E">From<T></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-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='index.html'>geom</a></p><script>window.sidebarCurrent = {name: 'Angle', 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='../geom/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Angle</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.approx_eq">approx_eq</a><a href="#method.degrees">degrees</a><a href="#method.invert_y">invert_y</a><a href="#method.new_rads">new_rads</a><a href="#method.normalized_degrees">normalized_degrees</a><a href="#method.normalized_radians">normalized_radians</a><a href="#method.opposite">opposite</a><a href="#method.reorient">reorient</a><a href="#method.rotate_degs">rotate_degs</a><a href="#method.shortest_rotation_towards">shortest_rotation_towards</a><a href="#method.simple_shortest_rotation_towards">simple_shortest_rotation_towards</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Add%3CAngle%3E">Add<Angle></a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Display">Display</a><a href="#impl-Div%3Cf64%3E">Div<f64></a><a href="#impl-Neg">Neg</a><a href="#impl-PartialEq%3CAngle%3E">PartialEq<Angle></a><a href="#impl-PartialOrd%3CAngle%3E">PartialOrd<Angle></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a><a href="#impl-Sum%3CAngle%3E">Sum<Angle></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-DeserializeOwned">DeserializeOwned</a><a href="#impl-From%3CT%3E">From<T></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-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='index.html'>geom</a></p><script>window.sidebarCurrent = {name: 'Angle', 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/geom/angle.rs.html#7' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>geom</a>::<wbr><a class="struct" href=''>Angle</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Angle(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>);</pre></div><div class='docblock'><p>An angle, stored in radians.</p>
|
||||
</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="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#9-84' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedconstant.ZERO' class="associatedconstant"><code>pub const <a href='#associatedconstant.ZERO' class="constant"><b>ZERO</b></a>: <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#10' title='goto source code'>[src]</a></h4><h4 id='method.new_rads' class="method"><code>pub fn <a href='#method.new_rads' class='fnname'>new_rads</a>(rads: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#14-17' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create an angle in radians.</p>
|
||||
</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="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#9-83' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedconstant.ZERO' class="associatedconstant"><code>pub const <a href='#associatedconstant.ZERO' class="constant"><b>ZERO</b></a>: <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#10' title='goto source code'>[src]</a></h4><h4 id='method.new_rads' class="method"><code>pub fn <a href='#method.new_rads' class='fnname'>new_rads</a>(rads: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#14-17' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create an angle in radians.</p>
|
||||
</div><h4 id='method.degrees' class="method"><code>pub fn <a href='#method.degrees' class='fnname'>degrees</a>(degs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#20-22' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create an angle in degrees.</p>
|
||||
</div><h4 id='method.opposite' class="method"><code>pub fn <a href='#method.opposite' class='fnname'>opposite</a>(self) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#25-27' title='goto source code'>[src]</a></h4><div class='docblock'><p>Invert the direction of this angle.</p>
|
||||
</div><h4 id='method.invert_y' class="method"><code>pub(crate) fn <a href='#method.invert_y' class='fnname'>invert_y</a>(self) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#29-31' title='goto source code'>[src]</a></h4><h4 id='method.rotate_degs' class="method"><code>pub fn <a href='#method.rotate_degs' class='fnname'>rotate_degs</a>(self, degrees: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#34-36' title='goto source code'>[src]</a></h4><div class='docblock'><p>Rotates this angle by some degrees.</p>
|
||||
</div><h4 id='method.normalized_radians' class="method"><code>pub fn <a href='#method.normalized_radians' class='fnname'>normalized_radians</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a></code><a class='srclink' href='../src/geom/angle.rs.html#39-46' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns [0, 2pi)</p>
|
||||
</div><h4 id='method.normalized_degrees' class="method"><code>pub fn <a href='#method.normalized_degrees' class='fnname'>normalized_degrees</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a></code><a class='srclink' href='../src/geom/angle.rs.html#49-51' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns [0, 360)</p>
|
||||
</div><h4 id='method.shortest_rotation_towards' class="method"><code>pub fn <a href='#method.shortest_rotation_towards' class='fnname'>shortest_rotation_towards</a>(self, other: <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#55-60' title='goto source code'>[src]</a></h4><div class='docblock'><p>Logically this returns [-180, 180], but keep in mind when we print this angle, it'll
|
||||
</div><h4 id='method.simple_shortest_rotation_towards' class="method"><code>pub fn <a href='#method.simple_shortest_rotation_towards' class='fnname'>simple_shortest_rotation_towards</a>(self, other: <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a></code><a class='srclink' href='../src/geom/angle.rs.html#54-57' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns [-180, 180]</p>
|
||||
</div><h4 id='method.shortest_rotation_towards' class="method"><code>pub fn <a href='#method.shortest_rotation_towards' class='fnname'>shortest_rotation_towards</a>(self, other: <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#61-63' title='goto source code'>[src]</a></h4><div class='docblock'><p>Logically this returns [-180, 180], but keep in mind when we print this angle, it'll
|
||||
normalize to be [0, 360].</p>
|
||||
</div><h4 id='method.approx_eq' class="method"><code>pub fn <a href='#method.approx_eq' class='fnname'>approx_eq</a>(self, other: <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>, within_degrees: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/geom/angle.rs.html#63-69' title='goto source code'>[src]</a></h4><div class='docblock'><p>True if this angle is within some degrees of another, accounting for rotation</p>
|
||||
</div><h4 id='method.reorient' class="method"><code>pub fn <a href='#method.reorient' class='fnname'>reorient</a>(self) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#73-83' title='goto source code'>[src]</a></h4><div class='docblock'><p>I don't know how to describe what this does. Use for rotating labels in map-space and making
|
||||
</div><h4 id='method.approx_eq' class="method"><code>pub fn <a href='#method.approx_eq' class='fnname'>approx_eq</a>(self, other: <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>, within_degrees: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/geom/angle.rs.html#66-68' title='goto source code'>[src]</a></h4><div class='docblock'><p>True if this angle is within some degrees of another, accounting for rotation</p>
|
||||
</div><h4 id='method.reorient' class="method"><code>pub fn <a href='#method.reorient' class='fnname'>reorient</a>(self) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#72-82' title='goto source code'>[src]</a></h4><div class='docblock'><p>I don't know how to describe what this does. Use for rotating labels in map-space and making
|
||||
sure the text is never upside-down.</p>
|
||||
</div></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-Add%3CAngle%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a><<a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Add%3CAngle%3E' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#92-98' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
|
||||
</div><h4 id='method.add' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add' class='fnname'>add</a>(self, other: <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#95-97' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
|
||||
</div></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-Add%3CAngle%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a><<a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Add%3CAngle%3E' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#91-97' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-1' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
|
||||
</div><h4 id='method.add' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add' class='fnname'>add</a>(self, other: <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#94-96' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
|
||||
</div></div><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="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#6' 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="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#6' 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-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.117/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.117/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="type" href="https://docs.rs/serde/1.0.117/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.117/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.117/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
|
||||
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#86-90' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/geom/angle.rs.html#87-89' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id='impl-Div%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Div%3Cf64%3E' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#108-117' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>/</code> operator.</p>
|
||||
</div><h4 id='method.div' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#tymethod.div' class='fnname'>div</a>(self, scalar: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#111-116' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>/</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#tymethod.div">Read more</a></p>
|
||||
</div></div><h3 id='impl-Neg' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html" title="trait core::ops::arith::Neg">Neg</a> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Neg' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#100-106' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-2' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
|
||||
</div><h4 id='method.neg' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#tymethod.neg' class='fnname'>neg</a>(self) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#103-105' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the unary <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#tymethod.neg">Read more</a></p>
|
||||
</div></div><h3 id='impl-Display' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#85-89' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../src/geom/angle.rs.html#86-88' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id='impl-Div%3Cf64%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Div%3Cf64%3E' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#107-116' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>/</code> operator.</p>
|
||||
</div><h4 id='method.div' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#tymethod.div' class='fnname'>div</a>(self, scalar: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#110-115' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>/</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#tymethod.div">Read more</a></p>
|
||||
</div></div><h3 id='impl-Neg' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html" title="trait core::ops::arith::Neg">Neg</a> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Neg' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#99-105' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-2' class="type"><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
|
||||
</div><h4 id='method.neg' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#tymethod.neg' class='fnname'>neg</a>(self) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a class='srclink' href='../src/geom/angle.rs.html#102-104' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the unary <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#tymethod.neg">Read more</a></p>
|
||||
</div></div><h3 id='impl-PartialEq%3CAngle%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="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-PartialEq%3CAngle%3E' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#6' 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="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/geom/angle.rs.html#6' 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="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||||
@ -35,7 +36,7 @@ operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.h
|
||||
</div><h4 id='method.ge' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &<a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code>
|
||||
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
|
||||
</div></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code>fn <a href='https://docs.rs/serde/1.0.117/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></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="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Sum%3CAngle%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Sum.html" title="trait core::iter::traits::accum::Sum">Sum</a><<a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Sum%3CAngle%3E' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#119-130' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sum' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Sum.html#tymethod.sum' class='fnname'>sum</a><I>(iter: I) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>>, </span></code><a class='srclink' href='../src/geom/angle.rs.html#120-129' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Method which takes an iterator and generates <code>Self</code> from the elements by
|
||||
</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="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#6' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Sum%3CAngle%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Sum.html" title="trait core::iter::traits::accum::Sum">Sum</a><<a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>> for <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a></code><a href='#impl-Sum%3CAngle%3E' class='anchor'></a><a class='srclink' href='../src/geom/angle.rs.html#118-129' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.sum' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Sum.html#tymethod.sum' class='fnname'>sum</a><I>(iter: I) -> <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="struct" href="../geom/struct.Angle.html" title="struct geom::Angle">Angle</a>>, </span></code><a class='srclink' href='../src/geom/angle.rs.html#119-128' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Method which takes an iterator and generates <code>Self</code> from the elements by
|
||||
"summing up" the items. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Sum.html#tymethod.sum">Read more</a></p>
|
||||
</div></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="../geom/struct.Angle.html" title="struct geom::Angle">Angle</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="../geom/struct.Angle.html" title="struct geom::Angle">Angle</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="../geom/struct.Angle.html" title="struct geom::Angle">Angle</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="../geom/struct.Angle.html" title="struct geom::Angle">Angle</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="../geom/struct.Angle.html" title="struct geom::Angle">Angle</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>
|
||||
|
File diff suppressed because one or more lines are too long
@ -304,8 +304,16 @@
|
||||
<span id="301">301</span>
|
||||
<span id="302">302</span>
|
||||
<span id="303">303</span>
|
||||
<span id="304">304</span>
|
||||
<span id="305">305</span>
|
||||
<span id="306">306</span>
|
||||
<span id="307">307</span>
|
||||
<span id="308">308</span>
|
||||
<span id="309">309</span>
|
||||
<span id="310">310</span>
|
||||
<span id="311">311</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">BTreeSet</span>, <span class="ident">HashMap</span>};
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashMap</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">abstutil</span>::{<span class="ident">wraparound_get</span>, <span class="ident">MultiMap</span>};
|
||||
<span class="kw">use</span> <span class="ident">geom</span>::{<span class="ident">Angle</span>, <span class="ident">Distance</span>, <span class="ident">PolyLine</span>, <span class="ident">Pt2D</span>, <span class="ident">Speed</span>};
|
||||
@ -331,7 +339,7 @@
|
||||
<span class="kw">impl</span> <span class="ident">Player</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">ctx</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="ident">app</span>: <span class="kw-2">&</span><span class="ident">App</span>, <span class="ident">start</span>: <span class="ident">IntersectionID</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Player</span> {
|
||||
<span class="ident">ctx</span>.<span class="ident">canvas</span>.<span class="ident">cam_zoom</span> <span class="op">=</span> <span class="ident">ZOOM</span>;
|
||||
<span class="kw">let</span> <span class="ident">dr</span> <span class="op">=</span> <span class="ident">all_connections</span>(<span class="ident">start</span>, <span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>).<span class="ident">into_iter</span>().<span class="ident">next</span>().<span class="ident">unwrap</span>();
|
||||
<span class="kw">let</span> <span class="ident">dr</span> <span class="op">=</span> <span class="ident">all_connections</span>(<span class="ident">start</span>, <span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>)[<span class="number">0</span>].<span class="number">0</span>;
|
||||
<span class="kw">let</span> <span class="ident">on</span> <span class="op">=</span> <span class="ident">On</span>::<span class="ident">Road</span> {
|
||||
<span class="ident">dr</span>,
|
||||
<span class="ident">dist</span>: <span class="ident">Distance</span>::<span class="ident">ZERO</span>,
|
||||
@ -427,11 +435,9 @@
|
||||
..
|
||||
} <span class="op">=</span> <span class="self">self</span>.<span class="ident">on</span>
|
||||
{
|
||||
<span class="kw">let</span> <span class="ident">all</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">DirectedRoadID</span><span class="op">></span> <span class="op">=</span> <span class="ident">all_connections</span>(<span class="ident">dr</span>.<span class="ident">dst_i</span>(<span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>), <span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>)
|
||||
.<span class="ident">into_iter</span>()
|
||||
.<span class="ident">collect</span>();
|
||||
<span class="kw">let</span> <span class="ident">idx</span> <span class="op">=</span> <span class="ident">all</span>.<span class="ident">iter</span>().<span class="ident">position</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">=</span><span class="op">=</span> <span class="ident">next_road</span>).<span class="ident">unwrap</span>() <span class="kw">as</span> <span class="ident">isize</span>;
|
||||
<span class="kw-2">*</span><span class="ident">next_road</span> <span class="op">=</span> <span class="kw-2">*</span><span class="ident">wraparound_get</span>(<span class="kw-2">&</span><span class="ident">all</span>, <span class="ident">idx</span> <span class="op">-</span> <span class="number">1</span>);
|
||||
<span class="kw">let</span> <span class="ident">all</span> <span class="op">=</span> <span class="ident">all_connections</span>(<span class="ident">dr</span>.<span class="ident">dst_i</span>(<span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>), <span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>);
|
||||
<span class="kw">let</span> <span class="ident">idx</span> <span class="op">=</span> <span class="ident">all</span>.<span class="ident">iter</span>().<span class="ident">position</span>(<span class="op">|</span>(<span class="ident">x</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">x</span> <span class="op">=</span><span class="op">=</span> <span class="ident">next_road</span>).<span class="ident">unwrap</span>() <span class="kw">as</span> <span class="ident">isize</span>;
|
||||
<span class="kw-2">*</span><span class="ident">next_road</span> <span class="op">=</span> <span class="ident">wraparound_get</span>(<span class="kw-2">&</span><span class="ident">all</span>, <span class="ident">idx</span> <span class="op">-</span> <span class="number">1</span>).<span class="number">0</span>;
|
||||
}
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">ctx</span>.<span class="ident">input</span>.<span class="ident">pressed</span>(<span class="ident">Key</span>::<span class="ident">RightArrow</span>) {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">On</span>::<span class="ident">Road</span> {
|
||||
@ -440,11 +446,9 @@
|
||||
..
|
||||
} <span class="op">=</span> <span class="self">self</span>.<span class="ident">on</span>
|
||||
{
|
||||
<span class="kw">let</span> <span class="ident">all</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">DirectedRoadID</span><span class="op">></span> <span class="op">=</span> <span class="ident">all_connections</span>(<span class="ident">dr</span>.<span class="ident">dst_i</span>(<span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>), <span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>)
|
||||
.<span class="ident">into_iter</span>()
|
||||
.<span class="ident">collect</span>();
|
||||
<span class="kw">let</span> <span class="ident">idx</span> <span class="op">=</span> <span class="ident">all</span>.<span class="ident">iter</span>().<span class="ident">position</span>(<span class="op">|</span><span class="ident">x</span><span class="op">|</span> <span class="ident">x</span> <span class="op">=</span><span class="op">=</span> <span class="ident">next_road</span>).<span class="ident">unwrap</span>() <span class="kw">as</span> <span class="ident">isize</span>;
|
||||
<span class="kw-2">*</span><span class="ident">next_road</span> <span class="op">=</span> <span class="kw-2">*</span><span class="ident">wraparound_get</span>(<span class="kw-2">&</span><span class="ident">all</span>, <span class="ident">idx</span> <span class="op">+</span> <span class="number">1</span>);
|
||||
<span class="kw">let</span> <span class="ident">all</span> <span class="op">=</span> <span class="ident">all_connections</span>(<span class="ident">dr</span>.<span class="ident">dst_i</span>(<span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>), <span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">map</span>);
|
||||
<span class="kw">let</span> <span class="ident">idx</span> <span class="op">=</span> <span class="ident">all</span>.<span class="ident">iter</span>().<span class="ident">position</span>(<span class="op">|</span>(<span class="ident">x</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">x</span> <span class="op">=</span><span class="op">=</span> <span class="ident">next_road</span>).<span class="ident">unwrap</span>() <span class="kw">as</span> <span class="ident">isize</span>;
|
||||
<span class="kw-2">*</span><span class="ident">next_road</span> <span class="op">=</span> <span class="ident">wraparound_get</span>(<span class="kw-2">&</span><span class="ident">all</span>, <span class="ident">idx</span> <span class="op">+</span> <span class="number">1</span>).<span class="number">0</span>;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -566,39 +570,51 @@
|
||||
}
|
||||
|
||||
<span class="doccomment">/// All roads connected to this intersection, along with a direction assuming we're starting from</span>
|
||||
<span class="doccomment">/// the intersection. Arbitrary order.</span>
|
||||
<span class="kw">fn</span> <span class="ident">all_connections</span>(<span class="ident">i</span>: <span class="ident">IntersectionID</span>, <span class="ident">map</span>: <span class="kw-2">&</span><span class="ident">Map</span>) <span class="op">-</span><span class="op">></span> <span class="ident">BTreeSet</span><span class="op"><</span><span class="ident">DirectedRoadID</span><span class="op">></span> {
|
||||
<span class="ident">map</span>.<span class="ident">get_i</span>(<span class="ident">i</span>)
|
||||
<span class="doccomment">/// the intersection. Ordered by angle.</span>
|
||||
<span class="kw">fn</span> <span class="ident">all_connections</span>(<span class="ident">i</span>: <span class="ident">IntersectionID</span>, <span class="ident">map</span>: <span class="kw-2">&</span><span class="ident">Map</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">DirectedRoadID</span>, <span class="ident">Angle</span>)<span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">all</span> <span class="op">=</span> <span class="ident">map</span>
|
||||
.<span class="ident">get_i</span>(<span class="ident">i</span>)
|
||||
.<span class="ident">roads</span>
|
||||
.<span class="ident">iter</span>()
|
||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">r</span><span class="op">|</span> {
|
||||
<span class="kw">let</span> <span class="ident">r</span> <span class="op">=</span> <span class="ident">map</span>.<span class="ident">get_r</span>(<span class="kw-2">*</span><span class="ident">r</span>);
|
||||
<span class="ident">DirectedRoadID</span> {
|
||||
<span class="ident">id</span>: <span class="ident">r</span>.<span class="ident">id</span>,
|
||||
<span class="ident">dir</span>: <span class="kw">if</span> <span class="ident">r</span>.<span class="ident">src_i</span> <span class="op">=</span><span class="op">=</span> <span class="ident">i</span> {
|
||||
<span class="ident">Direction</span>::<span class="ident">Fwd</span>
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">Direction</span>::<span class="ident">Back</span>
|
||||
},
|
||||
<span class="kw">let</span> <span class="ident">dir</span>;
|
||||
<span class="kw">let</span> <span class="ident">angle</span>;
|
||||
<span class="kw">if</span> <span class="ident">r</span>.<span class="ident">src_i</span> <span class="op">=</span><span class="op">=</span> <span class="ident">i</span> {
|
||||
<span class="ident">dir</span> <span class="op">=</span> <span class="ident">Direction</span>::<span class="ident">Fwd</span>;
|
||||
<span class="ident">angle</span> <span class="op">=</span> <span class="ident">r</span>.<span class="ident">center_pts</span>.<span class="ident">first_line</span>().<span class="ident">angle</span>();
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">dir</span> <span class="op">=</span> <span class="ident">Direction</span>::<span class="ident">Back</span>;
|
||||
<span class="ident">angle</span> <span class="op">=</span> <span class="ident">r</span>.<span class="ident">center_pts</span>.<span class="ident">last_line</span>().<span class="ident">angle</span>().<span class="ident">opposite</span>();
|
||||
}
|
||||
(<span class="ident">DirectedRoadID</span> { <span class="ident">id</span>: <span class="ident">r</span>.<span class="ident">id</span>, <span class="ident">dir</span> }, <span class="ident">angle</span>)
|
||||
})
|
||||
.<span class="ident">collect</span>()
|
||||
.<span class="ident">collect</span>::<span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="kw">_</span><span class="op">></span><span class="op">></span>();
|
||||
<span class="ident">all</span>.<span class="ident">sort_by_key</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">angle</span>)<span class="op">|</span> <span class="ident">angle</span>.<span class="ident">normalized_degrees</span>() <span class="kw">as</span> <span class="ident">i64</span>);
|
||||
<span class="ident">all</span>
|
||||
}
|
||||
|
||||
<span class="comment">// TODO Do the thing closest to "go straight"</span>
|
||||
<span class="kw">fn</span> <span class="ident">default_connection</span>(<span class="ident">from</span>: <span class="ident">DirectedRoadID</span>, <span class="ident">map</span>: <span class="kw-2">&</span><span class="ident">Map</span>) <span class="op">-</span><span class="op">></span> <span class="ident">DirectedRoadID</span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">all</span> <span class="op">=</span> <span class="ident">all_connections</span>(<span class="ident">from</span>.<span class="ident">dst_i</span>(<span class="ident">map</span>), <span class="ident">map</span>);
|
||||
<span class="kw">if</span> <span class="ident">all</span>.<span class="ident">len</span>() <span class="op">=</span><span class="op">=</span> <span class="number">1</span> {
|
||||
<span class="comment">// Deadend, we're forced to bounce back</span>
|
||||
<span class="ident">all</span>.<span class="ident">into_iter</span>().<span class="ident">next</span>().<span class="ident">unwrap</span>()
|
||||
<span class="kw">let</span> <span class="ident">outgoing_angle</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">from</span>.<span class="ident">dir</span> <span class="op">=</span><span class="op">=</span> <span class="ident">Direction</span>::<span class="ident">Fwd</span> {
|
||||
<span class="ident">map</span>.<span class="ident">get_r</span>(<span class="ident">from</span>.<span class="ident">id</span>).<span class="ident">center_pts</span>.<span class="ident">last_line</span>().<span class="ident">angle</span>()
|
||||
} <span class="kw">else</span> {
|
||||
<span class="comment">// Don't go back the same way we just came</span>
|
||||
<span class="ident">all</span>.<span class="ident">remove</span>(<span class="kw-2">&</span><span class="ident">DirectedRoadID</span> {
|
||||
<span class="ident">id</span>: <span class="ident">from</span>.<span class="ident">id</span>,
|
||||
<span class="ident">dir</span>: <span class="ident">from</span>.<span class="ident">dir</span>.<span class="ident">opposite</span>(),
|
||||
});
|
||||
<span class="ident">all</span>.<span class="ident">into_iter</span>().<span class="ident">next</span>().<span class="ident">unwrap</span>()
|
||||
}
|
||||
<span class="ident">map</span>.<span class="ident">get_r</span>(<span class="ident">from</span>.<span class="ident">id</span>)
|
||||
.<span class="ident">center_pts</span>
|
||||
.<span class="ident">first_line</span>()
|
||||
.<span class="ident">angle</span>()
|
||||
.<span class="ident">opposite</span>()
|
||||
};
|
||||
|
||||
<span class="comment">// Do the thing closest to "go straight"</span>
|
||||
<span class="ident">all_connections</span>(<span class="ident">from</span>.<span class="ident">dst_i</span>(<span class="ident">map</span>), <span class="ident">map</span>)
|
||||
.<span class="ident">into_iter</span>()
|
||||
.<span class="ident">min_by_key</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">angle</span>)<span class="op">|</span> {
|
||||
<span class="ident">outgoing_angle</span>
|
||||
.<span class="ident">simple_shortest_rotation_towards</span>(<span class="kw-2">*</span><span class="ident">angle</span>)
|
||||
.<span class="ident">abs</span>() <span class="kw">as</span> <span class="ident">usize</span>
|
||||
})
|
||||
.<span class="ident">unwrap</span>()
|
||||
.<span class="number">0</span>
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">dr_pl</span>(<span class="ident">dr</span>: <span class="ident">DirectedRoadID</span>, <span class="ident">map</span>: <span class="kw-2">&</span><span class="ident">Map</span>) <span class="op">-</span><span class="op">></span> <span class="ident">PolyLine</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, 13 Dec 2020 02:43:22 +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">"Sun, 13 Dec 2020 03:52:32 +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>
|
||||
|
@ -130,7 +130,6 @@
|
||||
<span id="127">127</span>
|
||||
<span id="128">128</span>
|
||||
<span id="129">129</span>
|
||||
<span id="130">130</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
|
||||
|
||||
@ -184,22 +183,21 @@
|
||||
<span class="self">self</span>.<span class="ident">normalized_radians</span>().<span class="ident">to_degrees</span>()
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Returns [-180, 180]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">simple_shortest_rotation_towards</span>(<span class="self">self</span>, <span class="ident">other</span>: <span class="ident">Angle</span>) <span class="op">-</span><span class="op">></span> <span class="ident">f64</span> {
|
||||
<span class="comment">// https://math.stackexchange.com/questions/110080/shortest-way-to-achieve-target-angle</span>
|
||||
((<span class="self">self</span>.<span class="ident">normalized_degrees</span>() <span class="op">-</span> <span class="ident">other</span>.<span class="ident">normalized_degrees</span>() <span class="op">+</span> <span class="number">540.0</span>) <span class="op">%</span> <span class="number">360.0</span>) <span class="op">-</span> <span class="number">180.0</span>
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Logically this returns [-180, 180], but keep in mind when we print this angle, it'll</span>
|
||||
<span class="doccomment">/// normalize to be [0, 360].</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">shortest_rotation_towards</span>(<span class="self">self</span>, <span class="ident">other</span>: <span class="ident">Angle</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Angle</span> {
|
||||
<span class="comment">// https://math.stackexchange.com/questions/110080/shortest-way-to-achieve-target-angle</span>
|
||||
<span class="ident">Angle</span>::<span class="ident">degrees</span>(
|
||||
((<span class="self">self</span>.<span class="ident">normalized_degrees</span>() <span class="op">-</span> <span class="ident">other</span>.<span class="ident">normalized_degrees</span>() <span class="op">+</span> <span class="number">540.0</span>) <span class="op">%</span> <span class="number">360.0</span>) <span class="op">-</span> <span class="number">180.0</span>,
|
||||
)
|
||||
<span class="ident">Angle</span>::<span class="ident">degrees</span>(<span class="self">self</span>.<span class="ident">simple_shortest_rotation_towards</span>(<span class="ident">other</span>))
|
||||
}
|
||||
|
||||
<span class="doccomment">/// True if this angle is within some degrees of another, accounting for rotation</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">approx_eq</span>(<span class="self">self</span>, <span class="ident">other</span>: <span class="ident">Angle</span>, <span class="ident">within_degrees</span>: <span class="ident">f64</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
|
||||
<span class="comment">// https://math.stackexchange.com/questions/110080/shortest-way-to-achieve-target-angle</span>
|
||||
<span class="comment">// This yields [-180, 180]</span>
|
||||
<span class="kw">let</span> <span class="ident">rotation</span> <span class="op">=</span>
|
||||
((<span class="self">self</span>.<span class="ident">normalized_degrees</span>() <span class="op">-</span> <span class="ident">other</span>.<span class="ident">normalized_degrees</span>() <span class="op">+</span> <span class="number">540.0</span>) <span class="op">%</span> <span class="number">360.0</span>) <span class="op">-</span> <span class="number">180.0</span>;
|
||||
<span class="ident">rotation</span>.<span class="ident">abs</span>() <span class="op"><</span> <span class="ident">within_degrees</span>
|
||||
<span class="self">self</span>.<span class="ident">simple_shortest_rotation_towards</span>(<span class="ident">other</span>).<span class="ident">abs</span>() <span class="op"><</span> <span class="ident">within_degrees</span>
|
||||
}
|
||||
|
||||
<span class="doccomment">/// I don't know how to describe what this does. Use for rotating labels in map-space and making</span>
|
||||
|
Loading…
Reference in New Issue
Block a user