1 line
4.8 KiB
JavaScript
1 line
4.8 KiB
JavaScript
"use strict";(self.webpackChunkstardust_website=self.webpackChunkstardust_website||[]).push([[745],{3905:function(e,t,r){r.d(t,{Zo:function(){return u},kt:function(){return m}});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var a=n.createContext({}),l=function(e){var t=n.useContext(a),r=t;return e&&(r="function"==typeof e?e(t):s(s({},t),e)),r},u=function(e){var t=l(e.components);return n.createElement(a.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,i=e.originalType,a=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),d=l(r),m=o,h=d["".concat(a,".").concat(m)]||d[m]||p[m]||i;return r?n.createElement(h,s(s({ref:t},u),{},{components:r})):n.createElement(h,s({ref:t},u))}));function m(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=r.length,s=new Array(i);s[0]=d;var c={};for(var a in t)hasOwnProperty.call(t,a)&&(c[a]=t[a]);c.originalType=e,c.mdxType="string"==typeof e?e:o,s[1]=c;for(var l=2;l<i;l++)s[l]=r[l];return n.createElement.apply(null,s)}return n.createElement.apply(null,r)}d.displayName="MDXCreateElement"},2144:function(e,t,r){r.r(t),r.d(t,{frontMatter:function(){return c},contentTitle:function(){return a},metadata:function(){return l},toc:function(){return u},default:function(){return d}});var n=r(7462),o=r(3366),i=(r(7294),r(3905)),s=["components"],c={},a="/",l={unversionedId:"stardust-protocol/server/objects/root",id:"stardust-protocol/server/objects/root",isDocsHomePage:!1,title:"/",description:"Object managing the client/server relationship as a whole.",source:"@site/docs/stardust-protocol/server/objects/root.md",sourceDirName:"stardust-protocol/server/objects",slug:"/stardust-protocol/server/objects/root",permalink:"/docs/stardust-protocol/server/objects/root",editUrl:"https://github.com/StardustXR/website/edit/main/docs/stardust-protocol/server/objects/root.md",version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"/input",permalink:"/docs/stardust-protocol/server/objects/input"},next:{title:"/spatial",permalink:"/docs/stardust-protocol/server/objects/spatial"}},u=[{value:"Signals",id:"signals",children:[{value:"<code>subscribeLogicStep(string path, string method)</code>",id:"subscribelogicstepstring-path-string-method",children:[]},{value:"<code>disconnect(null)</code>",id:"disconnectnull",children:[]}]}],p={toc:u};function d(e){var t=e.components,r=(0,o.Z)(e,s);return(0,i.kt)("wrapper",(0,n.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:""},"/"),(0,i.kt)("p",null,"Object managing the client/server relationship as a whole."),(0,i.kt)("h2",{id:"signals"},"Signals"),(0,i.kt)("h3",{id:"subscribelogicstepstring-path-string-method"},(0,i.kt)("inlineCode",{parentName:"h3"},"subscribeLogicStep(string path, string method)")),(0,i.kt)("p",null,"Executes ",(0,i.kt)("inlineCode",{parentName:"p"},"method")," on object at ",(0,i.kt)("inlineCode",{parentName:"p"},"path")," on the client when the main logic loop of the server starts each frame."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"method")," must have arguments of ",(0,i.kt)("inlineCode",{parentName:"p"},"(double delta, double timeToRender)"),". "),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"delta")," gives the time in seconds between the current time and the last time the logic loop executed while ",(0,i.kt)("inlineCode",{parentName:"p"},"timeToRender")," gives the time in ms since epoch when the current frame is expected to reach the user's eyes (returns 0 for now)."),(0,i.kt)("h3",{id:"disconnectnull"},(0,i.kt)("inlineCode",{parentName:"h3"},"disconnect(null)")),(0,i.kt)("p",null,"Lets the server know that the client wishes to disconnect. After this it can be assumed the client is disconnected from the server."))}d.isMDXComponent=!0}}]); |