Files
website/docs/getting-started/making-clients.html
github-actions[bot] fbd1574278 deploy: d2ad2cd898
2022-09-30 18:50:33 +00:00

17 lines
17 KiB
HTML

<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="Docusaurus v2.0.0-beta.3">
<title data-react-helmet="true">Making Clients | Stardust XR</title><meta data-react-helmet="true" property="og:url" content="https://stardustxr.org/docs/getting-started/making-clients"><meta data-react-helmet="true" name="docusaurus_locale" content="en"><meta data-react-helmet="true" name="docusaurus_version" content="current"><meta data-react-helmet="true" name="docusaurus_tag" content="docs-default-current"><meta data-react-helmet="true" property="og:title" content="Making Clients | Stardust XR"><meta data-react-helmet="true" name="description" content="A Stardust client is at its core an executable that connects to a stardust server instance at $XDGRUNTIMEDIR/stardust-[0-32], sends and receives messages according to the Stardust protocol."><meta data-react-helmet="true" property="og:description" content="A Stardust client is at its core an executable that connects to a stardust server instance at $XDGRUNTIMEDIR/stardust-[0-32], sends and receives messages according to the Stardust protocol."><link data-react-helmet="true" rel="shortcut icon" href="/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://stardustxr.org/docs/getting-started/making-clients"><link data-react-helmet="true" rel="alternate" href="https://stardustxr.org/docs/getting-started/making-clients" hreflang="en"><link data-react-helmet="true" rel="alternate" href="https://stardustxr.org/docs/getting-started/making-clients" hreflang="x-default"><link rel="stylesheet" href="/assets/css/styles.8598596e.css">
<link rel="preload" href="/assets/js/runtime~main.9e9f151c.js" as="script">
<link rel="preload" href="/assets/js/main.96ca8946.js" as="script">
</head>
<body>
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus">
<div><a href="#" class="skipToContent_OuoZ">Skip to main content</a></div><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Navigation bar toggle" class="navbar__toggle clean-btn" type="button" tabindex="0"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><img src="/img/icon.webp" alt="Stardust XR logo, a yellow astroid with smaller white astroids around it" class="themedImage_TMUO themedImage--light_4Vu1 navbar__logo"><img src="/img/icon.webp" alt="Stardust XR logo, a yellow astroid with smaller white astroids around it" class="themedImage_TMUO themedImage--dark_uzRr navbar__logo"><b class="navbar__title">Stardust XR</b></a><a class="navbar__item navbar__link" href="/roadmap">Roadmap</a><a class="navbar__item navbar__link navbar__link--active" href="/docs/getting-started/overview">Docs</a></div><div class="navbar__items navbar__items--right"><a href="https://twitter.com/stardustxr" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link"><span>Twitter<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a><a href="https://discord.gg/A9w7fKE" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link"><span>Discord<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a><a href="https://matrix.to/#/#stardustxr:matrix.org" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link"><span>Matrix<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a><a href="https://github.com/StardustXR" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link"><span>GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/"><img src="/img/icon.webp" alt="Stardust XR logo, a yellow astroid with smaller white astroids around it" class="themedImage_TMUO themedImage--light_4Vu1 navbar__logo"><img src="/img/icon.webp" alt="Stardust XR logo, a yellow astroid with smaller white astroids around it" class="themedImage_TMUO themedImage--dark_uzRr navbar__logo"><b class="navbar__title">Stardust XR</b></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" href="/roadmap">Roadmap</a></li><li class="menu__list-item"><a class="menu__link navbar__link--active" href="/docs/getting-started/overview">Docs</a></li><li class="menu__list-item"><a href="https://twitter.com/stardustxr" target="_blank" rel="noopener noreferrer" class="menu__link"><span>Twitter<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a></li><li class="menu__list-item"><a href="https://discord.gg/A9w7fKE" target="_blank" rel="noopener noreferrer" class="menu__link"><span>Discord<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a></li><li class="menu__list-item"><a href="https://matrix.to/#/#stardustxr:matrix.org" target="_blank" rel="noopener noreferrer" class="menu__link"><span>Matrix<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a></li><li class="menu__list-item"><a href="https://github.com/StardustXR" target="_blank" rel="noopener noreferrer" class="menu__link"><span>GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a></li></ul></div></div></div></nav><div class="main-wrapper docs-wrapper doc-page"><div class="docPage_lDyR"><aside class="docSidebarContainer_0YBq"><div class="sidebar_a3j0"><nav class="menu menu--responsive thin-scrollbar menu_cyFh menuWithAnnouncementBar_+O1J" aria-label="Sidebar navigation"><button aria-label="Open menu" aria-haspopup="true" class="button button--secondary button--sm menu__button" type="button"><svg class="sidebarMenuIcon_iZzd" width="24" height="24" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><ul class="menu__list"><li class="menu__list-item"><a class="menu__link menu__link--sublist menu__link--active" href="#">Getting Started</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/overview">Overview</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tech-overview">Technical Overview</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install">Installation</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/starting">Starting</a></li><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active active" tabindex="0" href="/docs/getting-started/making-clients">Making Clients</a></li></ul></li></ul></nav></div></aside><main class="docMainContainer_r8cw"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_zHA2"><div class="docItemContainer_oiyr"><article><div class="markdown"><header><h1 class="h1Heading_dC7a">Making Clients</h1></header><p>A Stardust client is at its core an executable that connects to a stardust server instance at <code>$XDG_RUNTIME_DIR/stardust-[0-32]</code>, sends and receives messages according to the Stardust protocol.</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_WiXH" id="rust"></a>Rust<a class="hash-link" href="#rust" title="Direct link to heading">#</a></h2><p>Stardust uses Rust due to its speed and reliability in build and runtime, so you will need to install cargo (preferably through <a href="https://rustup.rs/" target="_blank" rel="noopener noreferrer">rustup</a>). If you&#x27;re unsure how to use Rust then a great guide is at <a href="https://doc.rust-lang.org/book/" target="_blank" rel="noopener noreferrer">https://doc.rust-lang.org/book/</a>.</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_WiXH" id="stardust-xr"></a>stardust-xr<a class="hash-link" href="#stardust-xr" title="Direct link to heading">#</a></h2><p><code>stardust-xr</code> is a connecting library for servers and clients that deals with the lowest level of connecting to ensure basic compatibility is ensured. As a client developer you most likely won&#x27;t need it, but it&#x27;s good to know about it.</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_WiXH" id="fusion"></a>Fusion<a class="hash-link" href="#fusion" title="Direct link to heading">#</a></h2><p><code>stardust-xr-fusion</code> is the high level library you&#x27;ll probably be using to create your clients. It features structs for all Stardust objects and trait-based + async systems for handling events from the server.</p><p>To get started, create a new Rust project using</p><div class="codeBlockContainer_J+bg"><div class="codeBlockContent_csEI bash"><pre tabindex="0" class="prism-code language-bash codeBlock_rtdJ thin-scrollbar" style="color:#9CDCFE;background-color:#1E1E1E"><code class="codeBlockLines_1zSZ"><span class="token-line" style="color:#9CDCFE"><span class="token plain">cargo new</span></span></code></pre><button type="button" aria-label="Copy code to clipboard" class="copyButton_M3SB clean-btn">Copy</button></div></div><p>and include the <code>stardust-xr-fusion</code> dependency in your <code>cargo.toml</code>. Documentation will be available at <a href="https://docs.rs/crate/stardust-xr-fusion/latest" target="_blank" rel="noopener noreferrer">https://docs.rs/crate/stardust-xr-fusion/latest</a>.</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_WiXH" id="molecules"></a>Molecules<a class="hash-link" href="#molecules" title="Direct link to heading">#</a></h2><p><code>stardust-xr-molecules</code> is an even higher level widget library built on Fusion similar to <a href="https://github.com/microsoft/MixedRealityToolkit-Unity" target="_blank" rel="noopener noreferrer">MRTK</a> to get your clients up and running faster. Documentation will be available at <a href="https://docs.rs/crate/stardust-xr-molecules/latest" target="_blank" rel="noopener noreferrer">https://docs.rs/crate/stardust-xr-molecules/latest</a>.</p></div><footer class="row docusaurus-mt-lg"><div class="col"><a href="https://github.com/StardustXR/website/edit/main/docs/getting-started/making-clients.md" target="_blank" rel="noreferrer noopener"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_mS5F" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_wj+Z"></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages navigation"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/docs/getting-started/starting"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">« Starting</div></a></div><div class="pagination-nav__item pagination-nav__item--next"></div></nav></div></div><div class="col col--3"><div class="tableOfContents_vrFS thin-scrollbar"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#rust" class="table-of-contents__link">Rust</a></li><li><a href="#stardust-xr" class="table-of-contents__link">stardust-xr</a></li><li><a href="#fusion" class="table-of-contents__link">Fusion</a></li><li><a href="#molecules" class="table-of-contents__link">Molecules</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Docs</div><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/docs/getting-started/roadmap">Roadmap</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/getting-started/overview">Getting Started</a></li></ul></div><div class="col footer__col"><div class="footer__title">Community</div><ul class="footer__items"><li class="footer__item"><a href="https://discord.gg/A9w7fKE" target="_blank" rel="noopener noreferrer" class="footer__link-item"><span>Discord<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a></li><li class="footer__item"><a href="https://matrix.to/#/#stardustxr:matrix.org" target="_blank" rel="noopener noreferrer" class="footer__link-item"><span>Matrix<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a></li><li class="footer__item"><a href="https://twitter.com/stardustxr" target="_blank" rel="noopener noreferrer" class="footer__link-item"><span>Twitter<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a></li><li class="footer__item"><a href="https://github.com/StardustXR" target="_blank" rel="noopener noreferrer" class="footer__link-item"><span>Stardust XR (GitHub)<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a></li></ul></div><div class="col footer__col"><div class="footer__title">Code</div><ul class="footer__items"><li class="footer__item"><a href="https://github.com/StardustXR/stardust-xr-server" target="_blank" rel="noopener noreferrer" class="footer__link-item"><span>Stardust XR (Server)<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a></li><li class="footer__item"><a href="https://github.com/StardustXR/stardust-xr" target="_blank" rel="noopener noreferrer" class="footer__link-item"><span>stardust-xr (includes Fusion)<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a></li><li class="footer__item"><a href="https://github.com/StardustXR/flatland" target="_blank" rel="noopener noreferrer" class="footer__link-item"><span>Flatland<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_wgqa"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></span></a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2022 Nova King</div></div></div></footer></div>
<script src="/assets/js/runtime~main.9e9f151c.js"></script>
<script src="/assets/js/main.96ca8946.js"></script>
</body>
</html>